query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
7427f698937531ca05e94442ae10601a
|
Returns and sets the preamble as a string (any text that is before the first MIME boundary) source://mail//lib/mail/body.rb219
|
[
{
"docid": "83b464c863daa7dda2ebf221a70b6518",
"score": "0.6057816",
"text": "def preamble=(_arg0); end",
"title": ""
}
] |
[
{
"docid": "72e7917b91d6b998e0aeff0ff4426fec",
"score": "0.72887534",
"text": "def preamble\n @preamble\n end",
"title": ""
},
{
"docid": "35e3b385f4e9385f3cf81ca57bb4a4f5",
"score": "0.66401744",
"text": "def preamble=( val )\n @preamble = val\n end",
"title": ""
},
{
"docid": "e89761294295d6da701e483326cdbe41",
"score": "0.6564139",
"text": "def send_preamble\n self.send_raw(AMQ::Protocol::PREAMBLE)\n end",
"title": ""
},
{
"docid": "d17a89e4e1a07599e9257b048fe3fdf8",
"score": "0.65456796",
"text": "def send_preamble\n self.send_raw(AMQ::Protocol::PREAMBLE)\n end",
"title": ""
},
{
"docid": "d05deef74d4efe70293b1f48e1d216be",
"score": "0.6509515",
"text": "def preamble_chunk(chunk)\n end",
"title": ""
},
{
"docid": "cb9676231696f7d73b6467bbad3d58a6",
"score": "0.6383041",
"text": "def preamble\n end",
"title": ""
},
{
"docid": "087094f6a3e6bd80f8e2c1819095d200",
"score": "0.6378099",
"text": "def static_preamble\n preamble = []\n\n unless ONLY_ASCII_IDENTS\n preamble << \"#![feature(non_ascii_idents)]\"\n end\n\n preamble.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "ee85f9759cf4d783cc335e7045c5c283",
"score": "0.63607186",
"text": "def send_preamble\n @transport.write(AMQ::Protocol::PREAMBLE)\n @logger.debug \"Sent protocol preamble\"\n end",
"title": ""
},
{
"docid": "3a2a3ef1e86f997824309bae81136976",
"score": "0.6346918",
"text": "def body\n if self.multipart? # what if it is message/rfc822 ?\n @preamble \n else\n # decode\n case self.header('content-transfer-encoding')\n when 'quoted-printable'\n body = @body.decode_quoted_printable\n when 'base64'\n body = @body.decode_base64\n else\n # matches nil when there is no header or an unrecognised encoding\n body = @body\n end\n \n # convert to UTF-8 if text\n if self.content_type.media_type == 'text'\n charset = self.content_type.params['charset'] || 'us-ascii'\n body.iconv!('utf-8', charset)\n end\n\n body\n end\n end",
"title": ""
},
{
"docid": "722c9e0d09aa6f99b0c1d5c43e29d640",
"score": "0.62254244",
"text": "def preamble\n @data[/\\A(\\s*(#.*?)?\\n)+/]\n end",
"title": ""
},
{
"docid": "722c9e0d09aa6f99b0c1d5c43e29d640",
"score": "0.62254244",
"text": "def preamble\n @data[/\\A(\\s*(#.*?)?\\n)+/]\n end",
"title": ""
},
{
"docid": "ef9814ab8fb094d74c7b76cbbb5bc37f",
"score": "0.6215693",
"text": "def convert_preamble node\n if add_chapter(node).nil?\n if (first_block = node.blocks[0]) && first_block.style == 'abstract' ||\n # REVIEW: should we treat the preamble as an abstract in general?\n first_block && node.blocks.size == 1\n convert_abstract first_block\n else\n node.content\n end\n end\n end",
"title": ""
},
{
"docid": "b7538294fbfac24f8089ca7cc4ef9a32",
"score": "0.6070039",
"text": "def response_preamble\n end",
"title": ""
},
{
"docid": "b7538294fbfac24f8089ca7cc4ef9a32",
"score": "0.6070039",
"text": "def response_preamble\n end",
"title": ""
},
{
"docid": "6006b7ede5e28e3798fda449417afd7a",
"score": "0.6045734",
"text": "def encoded\n if multipart?\n encoded_parts = parts.map { |p| p.to_s }\n ([preamble] + encoded_parts).join(crlf_boundary) + end_boundary + epilogue.to_s\n else\n raw_source\n end\n end",
"title": ""
},
{
"docid": "80b97c3bb1f3cb3a8d14381261abd5da",
"score": "0.60213184",
"text": "def preamble; end",
"title": ""
},
{
"docid": "fb4178f6cab9715ed39c0cee11cb0c6e",
"score": "0.59457594",
"text": "def first_record_preamble\n return nil unless header[:first_rec_group] > 0\n cursor(header[:first_rec_group]).name(\"header\") do |c|\n type_and_flag = c.name(\"type\") { c.get_uint8 }\n type = type_and_flag & RECORD_TYPE_MASK\n type = RECORD_TYPES[type] || type\n single_record = (type_and_flag & SINGLE_RECORD_MASK) > 0\n case type\n when :MULTI_REC_END, :DUMMY_RECORD\n { :type => type }\n else\n {\n :type => type,\n :single_record => single_record,\n :space => c.name(\"space\") { c.get_ic_uint32 },\n :page_number => c.name(\"page_number\") { c.get_ic_uint32 },\n }\n end\n end\n end",
"title": ""
},
{
"docid": "2c91fe13e7143e0d3e4f952315a88265",
"score": "0.5943687",
"text": "def full_body\n preamble + body + epilogue\n end",
"title": ""
},
{
"docid": "4f6ef8f9b8bd0a72dfb5fb801735e36c",
"score": "0.58640856",
"text": "def preamble?\n @in_preamble\n end",
"title": ""
},
{
"docid": "cb9cc06d52c5964dc6d5783fad1aa96d",
"score": "0.5832981",
"text": "def gen_preamble file, b_singleton, ct_name, global_name\n marshaler_gen = MarshalerGenerator.new @signature\n marshaler_gen.gen_preamble file, b_singleton, ct_name, global_name\n end",
"title": ""
},
{
"docid": "131e1b8c2026b3bd15527acfcef49773",
"score": "0.57999873",
"text": "def preamble(condition_summary, effect_summary, opts = {})\n if opts[:preamble] == false\n \"\"\n elsif condition_summary.blank?\n \"Customers\"\n else\n \"Customers who\"\n end\n end",
"title": ""
},
{
"docid": "e51e74fc7f1541f385256b4eb72c0055",
"score": "0.57974976",
"text": "def add_preamble(src); end",
"title": ""
},
{
"docid": "f46869403d64913e950b5adc9e60b801",
"score": "0.5780326",
"text": "def break_body \n\n\t\t# I opted to go with counting backwards from the plain text content type\n\t\t# as I found some emails contain more than one boundary code with multiparts\n\t\tcode = @text.scan(/^--(.+)(\\n)(Content-Type: text\\/plain)/).join\n\n\t\t# Grab the exact unique string of characters\n\t\tboundary = '--' + code.gsub(/\\nContent-Type: text\\/plain/, \"\")\n\n\t\t# Split the sections by the boundary\n\t\theader, content = @text.split(boundary)\n\n\t\t# Call methods with relevant parts\n\t\tparse_head(header)\n\t\tparse_content(content)\n\tend",
"title": ""
},
{
"docid": "0374efd514f8e87e47c3b3b5f598f993",
"score": "0.57177126",
"text": "def precompiled_preamble(locals)\n original = super\n \"__in_erb_template = true\\n\" << original.rpartition(\"\\n\").first << \"#{@outvar} = _buf = ActiveSupport::SafeBuffer.new\\n\"\n end",
"title": ""
},
{
"docid": "bc728ecb841dea81f4fe5b21eb41f89e",
"score": "0.5700595",
"text": "def read_preamble(cursor)\n type_and_flag = cursor.name(\"type\") { cursor.read_uint8 }\n type = type_and_flag & RECORD_TYPE_MASK\n type = RECORD_TYPES[type] || type\n # Whether this is a single record for a single page.\n single_record = (type_and_flag & SINGLE_RECORD_MASK).positive?\n case type\n when :MULTI_REC_END, :DUMMY_RECORD\n Preamble.new(type: type)\n else\n Preamble.new(\n type: type,\n single_record: single_record,\n space: cursor.name(\"space\") { cursor.read_ic_uint32 },\n page_number: cursor.name(\"page_number\") { cursor.read_ic_uint32 }\n )\n end\n end",
"title": ""
},
{
"docid": "02f5f71c207edba63227fb2341ceace7",
"score": "0.55913574",
"text": "def down_preamble\n\n end",
"title": ""
},
{
"docid": "ff20ad8639990c05754f44cf4c7c908e",
"score": "0.55414534",
"text": "def text_body\n require 'cgi'\n require 'nokogiri'\n if original_body.present?\n body_text = Mail.new(self.original_body).actual_message\n body_text = self.subject if body_text.blank?\n else\n body_text = body\n end\n body_text = Nokogiri::HTML(CGI.unescapeHTML(body_text)).content.gsub(/\\r/, ' ').gsub(/\\n/, ' ').gsub('%', ' ').gsub('\\\\', ' ')\n .gsub(/\\u00a0/, ' ').gsub('\"', '').split(/[[:space:]]/).delete_if(&:empty?).join(' ') rescue body_text\n end",
"title": ""
},
{
"docid": "6454590c7c23ca106180f9577a14fabb",
"score": "0.5536307",
"text": "def preamble\n @ignored_variables.\n map {|name| escape_variable(name) }.\n join(\"\\n\")\n end",
"title": ""
},
{
"docid": "c7da72c6d6fadb7b1a36c053939de4e6",
"score": "0.54984957",
"text": "def preamble\n result = ''\n result +=\n case @options[:environment]\n when 'longtable'\n \"\\\\usepackage{longtable}\\n\"\n else\n ''\n end\n result += \"\\\\usepackage[pdftex,table,x11names]{xcolor}\\n\"\n result\n end",
"title": ""
},
{
"docid": "80f3f8ccbf1a862e5448c3cd6d1403e3",
"score": "0.5490248",
"text": "def email_body\n part_to_use = last_email.text_part || last_email.html_part || last_email\n\n # return the message body without the header information\n part_to_use.body.decoded\n end",
"title": ""
},
{
"docid": "36dd0eded16e0f3b229d3a50ce035c46",
"score": "0.5471065",
"text": "def body_to_s()\n body = Array.new()\n \n # simple message with one part\n if(!multipart?())\n return(@text)\n else\n body << \"This is a multi-part message in MIME format.\\r\\n\\r\\n--#{@attachmentboundary}\\r\\nContent-Type: multipart/alternative; boundary=\\\"#{@bodyboundary}\\\"\"\n \n if(@attachments.length > 0)\n # text part\n body << \"#{buildbodyboundary(\"text/plain; charset=#{@charset}; format=flowed\", 'quoted-printable')}\\r\\n\\r\\n#{quote_if_necessary(@text, @charset)}\"\n \n # html part if one is provided\n if @html\n body << \"#{buildbodyboundary(\"text/html; charset=#{@charset}\", 'quoted-printable')}\\r\\n\\r\\n#{quote_if_necessary(@html, @charset)}\"\n end\n \n body << \"--#{@bodyboundary}--\"\n \n # and, the attachments\n if(@attachments.length > 0)\n @attachments.each() { |attachment|\n body << \"#{buildattachmentboundary(attachment)}\\r\\n\\r\\n#{attachment['attachment']}\"\n }\n body << \"\\r\\n--#{@attachmentboundary}--\"\n end\n else\n # text part\n body << \"#{buildbodyboundary(\"text/plain; charset=#{@charset}; format=flowed\", 'quoted-printable')}\\r\\n\\r\\n#{quote_if_necessary(@text, @charset)}\"\n \n # html part\n body << \"#{buildbodyboundary(\"text/html; charset=#{@charset}\", 'quoted-printable')}\\r\\n\\r\\n#{quote_if_necessary(@html, @charset)}\"\n \n body << \"--#{@bodyboundary}--\"\n end\n \n return(body.join(\"\\r\\n\\r\\n\"))\n end\n end",
"title": ""
},
{
"docid": "05b80516267b2161c4795ece822248b8",
"score": "0.5402093",
"text": "def preamble\n case(@content_type)\n when :json then\n return \"[\"\n when :xml then\n return REXML::XMLDecl.new(1.0, \"UTF-8\").to_s + \"<#{@content.model.name.tableize} type='array'>\"\n else\n return \"\"\n end\n end",
"title": ""
},
{
"docid": "f4f87d32d55c00eb9c98e93e77f36428",
"score": "0.5328524",
"text": "def split_at_empty(message)\n parts = message.split(/^\\s$/, 2)\n header_fields = RubyEmail::HeaderFields.new \n header_fields.raw = parts[HEADER].strip\n @message.header_fields = header_fields\n body = RubyEmail::Body.new\n body.raw = parts[BODY].strip\n @message.body = body\n end",
"title": ""
},
{
"docid": "b480dd9ba5ed4c70e1ca8e633456939d",
"score": "0.5321942",
"text": "def buildbodyboundary(type, encoding)\n\t\treturn(\"--#{@bodyboundary}\\r\\nContent-Type: #{type}\\r\\nContent-Transfer-Encoding: #{encoding}\")\n\tend",
"title": ""
},
{
"docid": "b480dd9ba5ed4c70e1ca8e633456939d",
"score": "0.5321942",
"text": "def buildbodyboundary(type, encoding)\n\t\treturn(\"--#{@bodyboundary}\\r\\nContent-Type: #{type}\\r\\nContent-Transfer-Encoding: #{encoding}\")\n\tend",
"title": ""
},
{
"docid": "0791eae067988a2eef2c95f0d5451164",
"score": "0.5321293",
"text": "def buildbodyboundary(type, encoding)\n return(\"--#{@bodyboundary}\\r\\nContent-Type: #{type}\\r\\nContent-Transfer-Encoding: #{encoding}\")\n end",
"title": ""
},
{
"docid": "ef4cfbc64be943c0e4616d0a260eb141",
"score": "0.530998",
"text": "def parse_message\n header_part, body_part = raw_source.split(/#{CRLF}#{WSP}*#{CRLF}/m, 2)\n if header_part =~ HEADER_LINE\n self.header = header_part\n self.body = body_part\n else\n self.header = \"Content-Type: text/plain\\r\\n\"\n self.body = raw_source\n end\n end",
"title": ""
},
{
"docid": "2afca4792678e9c2d28532746ee97214",
"score": "0.53063756",
"text": "def preamble(node)\n result = []\n\n # NOTE: *list is V3, verse is V2, paragraph is both\n abstractable_contexts = %i{paragraph dlist olist ulist verse open}\n\n abstract_blocks = node.blocks.take_while do |block|\n abstractable_contexts.include? block.context\n end\n\n remainder_blocks = node.blocks[abstract_blocks.length..-1]\n\n result << noko do |xml|\n if abstract_blocks.any?\n xml.abstract do |xml_abstract|\n xml_abstract << abstract_blocks.map(&:render).flatten.join(\"\\n\")\n end\n end\n xml << remainder_blocks.map(&:render).flatten.join(\"\\n\")\n end\n\n result << \"</front><middle>\"\n result\n end",
"title": ""
},
{
"docid": "35ca07c2c2e40aeac340b17b2467961b",
"score": "0.5297601",
"text": "def body_to_s()\n\t\tbody = Array.new()\n\t\t\n\t\t# simple message with one part\n\t\tif(!multipart?())\n\t\t\treturn(@text)\n\t\telse\n\t\t\tbody << \"This is a multi-part message in MIME format.\\r\\n\\r\\n--#{@attachmentboundary}\\r\\nContent-Type: multipart/alternative; boundary=\\\"#{@bodyboundary}\\\"\"\n\t\t\t\n\t\t\tif(@attachments.length > 0)\n\t\t\t\t# text part\n\t\t\t\tbody << \"#{buildbodyboundary('text/plain; charset=ISO-8859-1; format=flowed', '7bit')}\\r\\n\\r\\n#{@text}\"\n\t\t\t\t\n\t\t\t\t# html part if one is provided\n\t\t\t\tif @html\n\t\t\t\t\tbody << \"#{buildbodyboundary('text/html; charset=ISO-8859-1', '7bit')}\\r\\n\\r\\n#{@html}\"\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tbody << \"--#{@bodyboundary}--\"\n\t\t\t\t\n\t\t\t\t# and, the attachments\n\t\t\t\tif(@attachments.length > 0)\n\t\t\t\t\[email protected]() { |attachment|\n\t\t\t\t\t\tbody << \"#{buildattachmentboundary(attachment)}\\r\\n\\r\\n#{attachment['attachment']}\"\n\t\t\t\t\t}\n\t\t\t\t\tbody << \"\\r\\n--#{@attachmentboundary}--\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t# text part\n\t\t\t\tbody << \"#{buildbodyboundary('text/plain; charset=ISO-8859-1; format=flowed', '7bit')}\\r\\n\\r\\n#{@text}\"\n\t\t\t\t\n\t\t\t\t# html part\n\t\t\t\tbody << \"#{buildbodyboundary('text/html; charset=ISO-8859-1', '7bit')}\\r\\n\\r\\n#{@html}\"\n\t\t\t\t\n\t\t\t\tbody << \"--#{@bodyboundary}--\"\n\t\t\tend\n\t\t\t\n\t\t\treturn(body.join(\"\\r\\n\\r\\n\"))\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f61d22d0ae9388b9d1d1bfc39cba16d7",
"score": "0.52953345",
"text": "def without_preamble(message)\n message.gsub(/Validation failed:/, '')\n end",
"title": ""
},
{
"docid": "fb64ae21960b42736bef2e1302875b47",
"score": "0.52878857",
"text": "def prepare_for_send\n @header.delete(ACTIVE_MAILBOX_CHECKSUM)\n \n #remove preceding \"From ...\" line\n @header.mbox_from = nil\n \n self\n end",
"title": ""
},
{
"docid": "ed817bb0098589e8b0d3b375808b3695",
"score": "0.52797234",
"text": "def make_preamble(task)\n preamble = @preamble\n task_pa = YAML.load(task)\n if task_pa.kind_of?(Hash) && task_pa.has_key?('EZQ')\n pa = YAML.load(preamble)\n task_pa.deep_merge(pa)\n preamble = task_pa\n end\n return [task.sub(/-{3}\\nEZQ.+?\\.{3}\\n/m,''),preamble]\n end",
"title": ""
},
{
"docid": "99cd0645c0612a7404ccbd93f66006c0",
"score": "0.5242411",
"text": "def raw\n if email.mime_type =~ /\\Amultipart\\/(alternative|related|mixed)\\Z/\n if email.html_part\n return email.html_part.body.to_s\n elsif email.text_part\n return email.text_part.body.to_s\n end\n end\n\n return email.body.to_s\n end",
"title": ""
},
{
"docid": "c0cf930113fbd8ce8b0924d2c1393091",
"score": "0.5236393",
"text": "def extract_body\n self.email_body =\n if self.mail.multipart? && self.mail.html_part\n self.document.at_css('body').inner_html.encode('utf-8')\n elsif self.mail.multipart? && self.mail.text_part\n self.mail.text_part.body.decoded\n else\n self.mail.decoded\n end\n end",
"title": ""
},
{
"docid": "1470c74ede5ea95f6cc246578a2b4cab",
"score": "0.5236169",
"text": "def test_quote_boundary\n mail = TMail::Mail.new\n @body = 'boundary=\"----_=_NextPart_001_01CE0390.F97F1AD6\" ; type=\"multipart/alternative\"'\n mail.quote_boundary\n assert_equal('boundary=\"----_=_NextPart_001_01CE0390.F97F1AD6\" ; type=\"multipart/alternative\"',@body)\n end",
"title": ""
},
{
"docid": "acfdffcc622f0774c778ae2cd07e71fc",
"score": "0.5205298",
"text": "def body_to_s()\n\t\tbody = Array.new()\n\n\t\t# simple message with one part\n\t\tif(!multipart?())\n\t\t\treturn(@text)\n\t\telse\n\t\t\tbody << \"This is a multi-part message in MIME format.\\r\\n\\r\\n--#{@attachmentboundary}\\r\\nContent-Type: multipart/alternative; boundary=\\\"#{@bodyboundary}\\\"\"\n\n\t\t\tif(@attachments.length > 0)\n populate_content(body)\n\n\t\t\t\t# and, the attachments\n\t\t\t\tif(@attachments.length > 0)\n\t\t\t\t\[email protected]() { |attachment|\n\t\t\t\t\t\tbody << \"#{buildattachmentboundary(attachment[1], 'base64', attachment[0])}\\r\\n\\r\\n#{attachment[2]}\"\n\t\t\t\t\t}\n\t\t\t\t\tbody << \"\\r\\n--#{@attachmentboundary}--\"\n\t\t\t\tend\n\t\t\telse\n populate_content(body)\n\t\t\tend\n\n\t\t\treturn(body.join(\"\\r\\n\\r\\n\"))\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8d34fffe55dfd88652180b9e59d4270c",
"score": "0.5203644",
"text": "def to_body\n if (body = self.to_str).null?\n \"\"\n elsif body.split(/\\n/).length == 1\n body.chomp.sub(/^(?:\\s*\\w+(?:\\(.*\\))??\\s*(?:do\\s+|\\{\\s*))(.*)\\s*(?:end|\\})$/, '\\1').strip\n else\n body.split(/\\n/)[1..-2].join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "de234bc160d6b9ea980e7d1cfb28d1e4",
"score": "0.5159113",
"text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end",
"title": ""
},
{
"docid": "9f95361cf5e95156660c6c2cbddcb24a",
"score": "0.5145953",
"text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end",
"title": ""
},
{
"docid": "b5d64668bbe581064bb799a2bd02634d",
"score": "0.51335055",
"text": "def formatTextHeader\n outTextHeader = \"Content-Type: text/plain; charset=us-ascii\\n\"\n outTextHeader += \"Content-Transfer-Encoding: 7bit\\n\\n\"\n outTextHeader += @text + \"\\n\"\n end",
"title": ""
},
{
"docid": "a2760c2609cf5bee0e51ffc1d17ac460",
"score": "0.51213586",
"text": "def make_raw_result(preamble)\n fname = \"output_#{@id}.txt\"\n body = \"\"\n if File.exists?(fname)\n body = File.read(fname)\n # Pull out any preamble set directly in the body, merge it into the\n # standard preamble, then remove the preamble from the body.\n if !body.empty? and body =~ /-{3}\\nEZQ/\n begin\n by = YAML.load(body)\n if by.kind_of?(Hash) && by.has_key?('EZQ')\n preamble.merge!(by)\n body.sub!(/-{3}\\nEZQ.+?\\.{3}\\n/m,'')\n end\n rescue\n # This is triggered on a failed YAML load. Carry on; the body might\n # not be valid YAML, and that's okay.\n end\n end\n else\n body = '{}' #'No output'\n end\n if @compress_result_message\n @logger.info 'Compressing raw message'\n body = Base64.encode64(Zlib::Deflate.deflate(body,9))\n end\n return body\n end",
"title": ""
},
{
"docid": "cf38a7b0c25cdaf4caa7f669a2c81211",
"score": "0.51162905",
"text": "def subject_raw\n self.header('subject')\n end",
"title": ""
},
{
"docid": "d080939d5bc67b149ed822a33456e0a8",
"score": "0.5106138",
"text": "def prepare_body(body, env)\n Backend::Listener.threescale_extensions(env)[:no_body] ? ''.freeze : body\n end",
"title": ""
},
{
"docid": "a4f02aa0484acf03e3ea372490b07cf3",
"score": "0.50911444",
"text": "def read_body\n email.body_to_mime.parts.map { |part| \n [\n part.content_type,\n part.body.encode(\"UTF-8\", \"binary\", invalid: :replace, undef: :replace, replace: \"\")\n ].join(\": \")\n }.join(\"\\n\")\n # .gsub('\\n', \"\\n\").gsub('\\r', \"\\r\").gsub('\\t', \"\\t\")\n end",
"title": ""
},
{
"docid": "fd9de62da6520643dd1c6089f7646bed",
"score": "0.5083516",
"text": "def body(text,html=false)\n textpart=RMail::Message.new\n if html\n textpart.header.add('Content-Type', 'text/html', nil,\n \t\t'boundary' => @marker)\n else\n textpart.header.add('Content-Type', 'text/plain', nil,\n \t\t'boundary' => @marker)\n end\n textpart.header['Content-Transfer-Encoding']=\"8bit\"\n textpart.body=text\n @msg_parts << textpart\n end",
"title": ""
},
{
"docid": "e2650c9502021f5b19d3faee2cd05888",
"score": "0.5079409",
"text": "def body\n return @body if defined?(@body) && @body\n @body ||= content.split(\"~~\", 2).join(\"\").chomp\n end",
"title": ""
},
{
"docid": "64abc3bd16e17efc684740d9745c4051",
"score": "0.50496525",
"text": "def multipart_body_begin\n end",
"title": ""
},
{
"docid": "d185b606c7f2c70a169314c613b62731",
"score": "0.5038783",
"text": "def header\n @header ||= (@email.header.nil? || @email.header.to_s.nil? ? [] : @email.header.to_s.split(\"\\r\\n\"))\n rescue\n []\n end",
"title": ""
},
{
"docid": "863d10814b4fc8d94aa826b242e3ec3c",
"score": "0.50205165",
"text": "def preamble\n [\n 'ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev',\n 'update_config=1'\n ]\n end",
"title": ""
},
{
"docid": "6feb59477f5bddd1459b6cdfbe539eb5",
"score": "0.5012804",
"text": "def plain_text_body\n get_mime_part(@message, 'text/plain').to_s\n end",
"title": ""
},
{
"docid": "549561316c05dda90f6803e638acfee6",
"score": "0.4998549",
"text": "def init_with_boundary(boundary)\n @boundary = \"\\r\\n--\" + boundary\n @lookbehind = \"\\0\"*(@boundary.length + 8)\n @state = :start\n\n @boundary_chars = {}\n @boundary.each_byte do |b|\n @boundary_chars[b.chr] = true\n end\n end",
"title": ""
},
{
"docid": "6d895f553290a9dc5006f790fb1fdf57",
"score": "0.49894983",
"text": "def body\n c = note.content and c =~ /.*\\n/ and $'\n end",
"title": ""
},
{
"docid": "618cd087624a9f9c0e37f3a277d7dd66",
"score": "0.49835402",
"text": "def fix_encoding(raw_eml)\n m = Mail.new(raw_eml)\n\n m.body = fix_body_encoding(m.body, m.charset)\n\n m.parts.each do |part|\n part.body = fix_body_encoding(part.body, part.charset)\n end\n\n m.encoded\n end",
"title": ""
},
{
"docid": "cb617534ccccd2179f00d1ecf39d1a79",
"score": "0.49677965",
"text": "def fmessage\n \"From: <#{from}>\\nTo: <#{to}>\\nMIME-Version: 1.0\\nContent-type: text/html; charset=UTF-8\\nSubject: #{fsubject}\\n\\n#{code_html}\"\n end",
"title": ""
},
{
"docid": "9551eb90f80aa9fb84b38c34d66ceb5b",
"score": "0.49662763",
"text": "def buildEmailSubject()\n begin\n configParams = BWAParams.new()\n configParams.loadFromFile()\n library = configParams.getLibraryName()\n fcBarcode = configParams.getFCBarcode()\n rescue\n if fcBarcode == nil || fcBarcode.empty?()\n fcBarcode = \"unknown\"\n end\n end\n\n # Fill in the fields for sending the email\n @emailSubject = \"Illumina Alignment Results : Flowcell \" + fcBarcode.to_s\n\n if library != nil && !library.empty?\n @emailSubject = @emailSubject + \" Library : \" + library.to_s\n end\n end",
"title": ""
},
{
"docid": "371dfcff731182b7f5c17e85d4c95eec",
"score": "0.49647754",
"text": "def message_body\n self.body.strip.split($/).first\n end",
"title": ""
},
{
"docid": "88b340becb2c0785b5dc8b6c7063ea22",
"score": "0.496469",
"text": "def messageBody()\n return \"\" ;\n end",
"title": ""
},
{
"docid": "88b340becb2c0785b5dc8b6c7063ea22",
"score": "0.496469",
"text": "def messageBody()\n return \"\" ;\n end",
"title": ""
},
{
"docid": "9112aa7341be93f02dfe9e37ca92e4b9",
"score": "0.49518466",
"text": "def encoded\n raise \"No body defined\" unless @body\n raise \"No sender defined\" unless @from\n raise \"No recipients defined\" unless @to\n\n # gmosx: From is typically NOT an array.\n\n from = @from.is_a?(Array) ? @from.join(\", \") : @from\n buf = \"From: #{from}\\n\"\n\n to = @to.is_a?(Array) ? @to.join(\", \") : @to\n buf << \"To: #{to}\\n\"\n\n if @cc\n cc = @cc.is_a?(Array) ? @cc.join(\", \") : @cc\n buf << \"Cc: #{cc}\\n\"\n end\n\n if @bcc\n bcc = @bcc.is_a?(Array) ? @bcc.join(\", \") : @bcc\n buf << \"Bcc: #{bcc}\\n\"\n end\n\n buf << \"Subject: #@subject\\n\" if @subject\n\n buf << \"Content-Type: #@content_type; charset=#@charset\\n\"\n\n buf << \"\\n\"\n buf << @body\n\n return buf\n end",
"title": ""
},
{
"docid": "307412f5bf93de2c02b40480a7246946",
"score": "0.49435842",
"text": "def unquoted_body\n raise(TypeError, \"Can not unquote a multipart message.\") if multipart?\n # decode body and convert charset\n Utils.unquote_and_convert_to(decode, @header.charset)\n end",
"title": ""
},
{
"docid": "555b387be1fdd1e3a43ef0aef9a99ce3",
"score": "0.49339896",
"text": "def messageHeader(messageBody)\n bodySize = messageBody.size ;\n wholeSize = bodySize + MessageSize_HeaderShort ;\n if(isLongMessage(wholeSize))\n wholeSize = bodySize + MessageSize_HeaderLong ;\n return [0, wholeSize, identifier()].pack(\"CNC\") ;\n else\n return [wholeSize, identifier()].pack(\"CC\") ;\n end\n end",
"title": ""
},
{
"docid": "0665415ba19db5a0a19ff0866ea914b6",
"score": "0.49278527",
"text": "def make_body\r\n rand_str = String.rand_alpha(rand(10)+1)\r\n rand_nam = String.rand_alpha(rand(20)+1)\r\n \"v=0\\r\\n\" +\r\n \"o=- #{rand(0xffffffff)} 1 IN IP4 0.0.0.0\\r\\n\" +\r\n \"s=MPEG-1 or 2 Audio, streamed by #{rand_str}\\r\\n\" +\r\n \"i=#{@mpfile}\\r\\n\" +\r\n \"t=0 0\\r\\n\" +\r\n \"a=tool:#{rand_nam}\\r\\n\" +\r\n \"a=type:broadcast\\r\\n\" +\r\n \"a=control:*\\r\\n\" +\r\n \"a=range:npt=0-213.077\\r\\n\" +\r\n \"a=x-qt-text-nam:MPEG-1 or 2 Audio, streamed by #{rand_str}\\r\\n\" +\r\n \"a=x-qt-text-inf:#{@mpfile}\\r\\n\" +\r\n \"m=audio 0 RTP/AVP 14\\r\\n\" +\r\n \"c=IN IP4 0.0.0.0\\r\\n\" +\r\n \"a=control:track1\\r\\n\"\r\n end",
"title": ""
},
{
"docid": "fabc0927e5481ee31b6f3308973f9d10",
"score": "0.49165437",
"text": "def as_comment_body\n\t\tcomment_body = self.body[0,40].dump\n\t\tcomment_body[-1,0] = '...' unless comment_body == self.body.dump\n\t\treturn \"Text (%d bytes): %s\" % [ self.body.length, comment_body ]\n\tend",
"title": ""
},
{
"docid": "e7e8e09118a637ed7a38c1cf77820d29",
"score": "0.49094585",
"text": "def discard_mail_body(content)\n content.gsub(/^(.*?)\\r\\n\\r\\n.*$/m, '\\1')\n end",
"title": ""
},
{
"docid": "bbf90a8cb25e474db80453e58a2ac53d",
"score": "0.49073482",
"text": "def to_s\n return [start_line, @headers].join(CRLF)\n end",
"title": ""
},
{
"docid": "65f85f93b504752452dee3ac26a8b86e",
"score": "0.4898046",
"text": "def build\n set_header(\"Mail-From\", \"#{ENV[\"USER\"]}@localhost ENVID=#{envelope_id}\")\n set_header(\"Date\", Time.now.rfc2822)\n set_header(\"Message-ID\", \"<#{Time.now.to_f}.#{Process.pid}@#{get_header(\"from\").to_s.split(\"@\", 2)[1]}>\")\n\n if multipart?\n set_header(\"Mime-Version\", \"1.0\")\n if attachments?\n set_header(\"Content-Type\", \"multipart/mixed; boundary=\\\"#{attachment_boundary}\\\"\")\n else\n set_header(\"Content-Type\", \"multipart/alternative; boundary=\\\"#{body_boundary}\\\"\")\n end\n end\n\n build_headers + build_body\n end",
"title": ""
},
{
"docid": "3d80a7986a8a91e64e6eb4a7caa53105",
"score": "0.4894274",
"text": "def generate_mms_message\n text = Rex::MIME::Message.new\n text.add_part(self.message, 'text/plain; charset=UTF-8', nil)\n body = Rex::MIME::Message.new\n body.add_part(text.to_s, \"multipart/alternative; boundary=#{text.bound}\", nil)\n if self.attachment\n body.add_part(self.attachment, \"#{content_type}; name=\\\"#{attachment_name}\\\"\", 'base64', \"attachment; filename=\\\"#{attachment_name}\\\"\")\n end\n\n mms = \"MIME-Version: 1.0\\n\"\n mms << \"From: #{self.from}\\n\"\n mms << \"To: #{self.to}\\n\"\n mms << \"Subject: #{self.subject}\\n\"\n mms << \"Content-Type: multipart/mixed; boundary=#{body.bound}\\n\"\n mms << \"\\n\"\n mms << body.to_s.gsub(/\\-\\-\\r\\n\\r\\n\\-\\-_/, \"--\\n--_\")\n\n mms\n end",
"title": ""
},
{
"docid": "5f8a15ce5167784c655fc314a14b2352",
"score": "0.48836574",
"text": "def genHead1\n parts = self.getParts\n return \"#{parts[\"prefix\"]} #{parts[\"adjective\"]} #{parts[\"buzzword\"]} #{parts[\"hack\"]} #{parts[\"part\"]} #{parts[\"verb\"]} #{parts[\"buzzword2\"]}\"\n end",
"title": ""
},
{
"docid": "25f00ab5c7ca4b1176545936f33e4a24",
"score": "0.4881283",
"text": "def email_primary_header_css\n email_css(\n \"font-family: #{FONT_FAMILY}\",\n \"line-height: #{LINE_HEIGHT}\",\n \"color: #{FONT_COLOR}\",\n 'font-size: 30px',\n 'font-weight: bold',\n 'margin: 0 0 18px 0',\n 'padding: 0 0 17px 0',\n 'border-bottom: 1px solid #eeeeee'\n )\n end",
"title": ""
},
{
"docid": "f23565abf100de4700273a741b9bbf2b",
"score": "0.48760214",
"text": "def pack\n if self.class.send_only_header\n rawbody=[].pack('')\n else\n rawbody = body.pack(pattern)\n end\n\n [type, rawbody.length].pack('LL') + rawbody\n end",
"title": ""
},
{
"docid": "37135ec826fa42ef393f23cc2eb6cca8",
"score": "0.48679832",
"text": "def parse_body(buffer)\n super(buffer)\n @id = shift_short(buffer)\n\n return if buffer.empty?\n raise ProtocolException, 'Extra bytes at end of Publish Acknowledgment packet'\n end",
"title": ""
},
{
"docid": "8dee922af71500411604ec468179ef25",
"score": "0.4865529",
"text": "def qprintd(argv1 = nil, heads = {})\n return nil unless argv1\n return argv1.unpack('M').first unless heads['content-type']\n return argv1.unpack('M').first if heads['content-type'].empty?\n\n # Quoted-printable encoded part is the part of the text\n boundary00 = Sisimai::MIME.boundary(heads['content-type'], 0)\n\n # Decoded using unpack('M') entire body string when the boundary string\n # or \"Content-Transfer-Encoding: quoted-printable\" are not included in\n # the message body.\n return argv1.unpack('M').first if boundary00.empty?\n return argv1.unpack('M').first unless argv1.downcase =~ ReE[:'quoted-print']\n\n boundary01 = Sisimai::MIME.boundary(heads['content-type'], 1)\n bodystring = ''\n notdecoded = ''\n getencoded = ''\n lowercased = ''\n\n encodename = nil\n ctencoding = nil\n mimeinside = false\n mustencode = false\n hasdivided = argv1.split(\"\\n\")\n\n while e = hasdivided.shift do\n # This is a multi-part message in MIME format. Your mail reader does not\n # understand MIME message format.\n # --=_gy7C4Gpes0RP4V5Bs9cK4o2Us2ZT57b-3OLnRN+4klS8dTmQ\n # Content-Type: text/plain; charset=iso-8859-15\n # Content-Transfer-Encoding: quoted-printable\n if mimeinside\n # Quoted-Printable encoded text block\n if e == boundary00\n # The next boundary string has appeared\n # --=_gy7C4Gpes0RP4V5Bs9cK4o2Us2ZT57b-3OLnRN+4klS8dTmQ\n getencoded = Sisimai::String.to_utf8(notdecoded.unpack('M').first, encodename)\n bodystring << getencoded << e + \"\\n\"\n\n notdecoded = ''\n mimeinside = false\n ctencoding = false\n encodename = nil\n else\n # Inside of Quoted-Printable encoded text\n if e.size > 76\n # Invalid line exists in \"quoted-printable\" part\n e = [e].pack('M').chomp\n else\n # A bounce message generated by Office365(Outlook) include lines\n # which are not proper as Quoted-Printable:\n # - `=` is not encoded\n # - Longer than 76 charaters a line\n #\n # Content-Transfer-Encoding: quoted-printable\n # X-Microsoft-Exchange-Diagnostics:\n # 1;SLXP216MB0381;27:IdH7U/WHGgJu6J8lFrE7KvVxhnAwyKrNbSXMFYs3/Gzz6ZdXYYjzHj55K2O+cndpeVwkvBJqmo6y0IF4AhLfHtFzznw/BzhERU6wi/TCWRpyjYuW8v0/aTcflH3oAdgZ4Pwrp7PxLiiA8rYgU/E7SQ==\n # ...\n mustencode = true\n while true do\n break if e.end_with?(' ', \"\\t\")\n break if e.split('').any? { |c| c.ord < 32 || c.ord > 126 }\n if e.end_with?('=')\n # Padding character of Base64 or not\n break if e =~ /[\\+\\/0-9A-Za-z]{32,}[=]+\\z/\n else\n if e.include?('=') && ! e.upcase.include?('=3D')\n # Including \"=\" not as \"=3D\"\n break\n end\n end\n mustencode = false\n break\n end\n e = [e].pack('M').chomp if mustencode\n mustencode = false\n end\n notdecoded << e + \"\\n\"\n end\n else\n # NOT Quoted-Printable encoded text block\n lowercased = e.downcase\n if e =~ /\\A[-]{2}[^\\s]+[^-]\\z/\n # Start of the boundary block\n # --=_gy7C4Gpes0RP4V5Bs9cK4o2Us2ZT57b-3OLnRN+4klS8dTmQ\n unless e == boundary00\n # New boundary string has appeared\n boundary00 = e\n boundary01 = e + '--'\n end\n elsif cv = lowercased.match(ReE[:'with-charset']) || lowercased.match(ReE[:'only-charset'])\n # Content-Type: text/plain; charset=ISO-2022-JP\n encodename = cv[1]\n mimeinside = true if ctencoding\n\n elsif lowercased =~ ReE[:'quoted-print']\n # Content-Transfer-Encoding: quoted-printable\n ctencoding = true\n mimeinside = true if encodename\n\n elsif e == boundary01\n # The end of boundary block\n # --=_gy7C4Gpes0RP4V5Bs9cK4o2Us2ZT57b-3OLnRN+4klS8dTmQ--\n mimeinside = false\n end\n\n bodystring << e + \"\\n\"\n end\n end\n\n bodystring << notdecoded unless notdecoded.empty?\n return bodystring\n end",
"title": ""
},
{
"docid": "8757c777910ce7babe2cdefabc420c1b",
"score": "0.48633134",
"text": "def generate_message sender, receiver, subject, plain_message, html_message\n boundary = \"GHR_#{SecureRandom.hex}\"\n\n <<~EMAIL\n From: GitHub Reminder <#{sender}>\n Date: #{DateTime.now.httpdate} \n To: #{receiver} <#{receiver}>\n Subject: #{subject} \n Content-type: multipart/alternative; boundary=\"#{boundary}\"\n\n > Unsupported MIME type?\n\n --#{boundary}\n Content-type: text/plain;\tcharset=\"UTF-8\"\n\n #{plain_message}\n\n --#{boundary}\n Content-type: text/html; charset=\"UTF-8\"\n\n #{html_message}\n\n --#{boundary}--\n EMAIL\n end",
"title": ""
},
{
"docid": "bac6921abdff791bd2b21c236c6815c9",
"score": "0.4858646",
"text": "def plain_text_body(email)\n parts = email.parts.collect {|c| (c.respond_to?(:parts) && !c.parts.empty?) ? c.parts : c}.flatten\n if parts.empty?\n parts << email\n end\n plain_text_part = parts.detect {|p| p.content_type == 'text/plain'}\n if plain_text_part.nil?\n # no text/plain part found, assuming html-only email\n # strip html tags and remove doctype directive\n plain_text_body = strip_tags(@email.body.to_s)\n plain_text_body.gsub! %r{^<!DOCTYPE .*$}, ''\n else\n plain_text_body = plain_text_part.body.to_s\n end\n plain_text_body.strip!\n return plain_text_body\n end",
"title": ""
},
{
"docid": "e954aef3a547962b2af68aa52a420870",
"score": "0.4849952",
"text": "def plain_text_body(email)\n parts = email.parts.collect {|c| (c.respond_to?(:parts) && !c.parts.empty?) ? c.parts : c}.flatten\n if parts.empty?\n parts << email\n end\n plain_text_part = parts.detect {|p| p.content_type == 'text/plain'}\n if plain_text_part.nil?\n # no text/plain part found, assuming html-only email\n # strip html tags and remove doctype directive\n plain_text_body = strip_tags(email.body.to_s)\n plain_text_body.gsub! %r{^<!DOCTYPE .*$}, ''\n else\n plain_text_body = plain_text_part.body.to_s\n end\n plain_text_body.strip!\n return plain_text_body\n end",
"title": ""
},
{
"docid": "c814de4a58c3f280ea464922fa150fb8",
"score": "0.4844531",
"text": "def normal_header\n nh = { \n subject: \"BHL #{site_name} Contact Form from #{username} about #{type}\",\n to: \"#{Settings.contact_address}\",\n from: \"#{email}\"\n }\n return nh\n end",
"title": ""
},
{
"docid": "5b97accc2422140e68c3765af2839e19",
"score": "0.48353985",
"text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end",
"title": ""
},
{
"docid": "bd67ee2fb18dcf6f3c919859228f10dc",
"score": "0.48337212",
"text": "def first_line_parts\n @first_line_parts ||= @text.split(/\\n/)[0].strip.split(' will be ')\n end",
"title": ""
},
{
"docid": "29dce0589a51b070b20ee62f62fd65ab",
"score": "0.48322913",
"text": "def to_s()\n\t\t# all emails get a unique message-id\n\t\tremove_header(\"Message-ID\")\n\t\tadd_header(\"Message-ID\", \"<#{Time.now.to_f()}.#{Process.euid()}.#{String.new.object_id()}>\")\n\n\t\tif(get_header(\"Date\").length == 0)\n\t\t\tadd_header(\"Date\", Time.now.strftime(\"%a, %d %B %Y %H:%M:%S %Z\"))\n\t\tend\n\n\t\t# Add a mime header if we don't already have one and we have multiple parts\n\t\tif(multipart?())\n\t\t\tif(get_header(\"MIME-Version\").length == 0)\n\t\t\t\tadd_header(\"MIME-Version\", \"1.0\")\n\t\t\tend\n\n\t\t\tif(get_header(\"Content-Type\").length == 0)\n\t\t\t\tif(@attachments.length == 0)\n\t\t\t\t\tadd_header(\"Content-Type\", \"multipart/alternative;boundary=\\\"#{@bodyboundary}\\\"\")\n\t\t\t\telse\n\t\t\t\t\tadd_header(\"Content-Type\", \"multipart/mixed; boundary=\\\"#{@attachmentboundary}\\\"\")\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\treturn(\"#{headers_to_s()}#{body_to_s()}\")\n\tend",
"title": ""
},
{
"docid": "214dd0f4d2c8618022acbb1880a101df",
"score": "0.4831874",
"text": "def message_header\n ''.tap do |buffer|\n # timestamp, or timestamp delta for chunk types 1 & 2 (3 bytes)\n if [0, 1, 2].include?(chunk_type)\n if extended_timestamp?\n buffer << [0xFF].pack('C')\n buffer << [0xFFFF].pack('S')\n else\n buffer << [(timestamp & 0xFF0000) >> 16].pack('C')\n buffer << [(timestamp & 0x00FFFF)].pack('S')\n end\n end\n\n # message length (3 bytes) and message type id (1 byte)\n if [0, 1].include?(chunk_type)\n buffer << [((data.size & 0x18) << 8) | (message_type_id & 0x8)].pack('L')\n end\n\n # message stream id (4 bytes)\n if [0].include?(chunk_type)\n buffer << [message_stream_id].pack('L')\n end\n end\n end",
"title": ""
},
{
"docid": "d15680da9be06ef1f350f54a1fe449ec",
"score": "0.48314443",
"text": "def message\n \"From: <#{from}>\\nTo: <#{to}>\\nMIME-Version: 1.0\\nContent-type: text/html; charset=UTF-8\\nSubject: #{subject}\\n\\n#{code_html}\"\n end",
"title": ""
},
{
"docid": "c7750e0b9220faabdd789bf98ecd0af7",
"score": "0.48310947",
"text": "def initial_headers_split request\n\thead, body = head_body_split request\n\tinitial, headers = if head.include?(\"\\r\\n\")\n\t\t head.split(\"\\r\\n\", 2)\n\t\t else\n\t\t \t head.split(\"\\n\", 2)\n\t\t end\nend",
"title": ""
},
{
"docid": "91927af29dd0e00c0374e761ec60174c",
"score": "0.48270327",
"text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end",
"title": ""
},
{
"docid": "68adc12cacc6e6011e08dd7bd2f2bd86",
"score": "0.48236033",
"text": "def first_line\n str = buffer[start_line]\n if multiline?\n str[start_pos, str.size] = lines.first\n else\n if must_extend?(str)\n str = extend_start(str)\n str[start_pos] = lines.first\n else\n str.insert(start_pos, lines.first)\n end\n end\n str\n end",
"title": ""
},
{
"docid": "9c177af6b53adcd569cde5139b98aaff",
"score": "0.48176897",
"text": "def strip_boundary\n\t\tself.log.debug \"Stripping boundary:\\n%p at:\\n%p\" % [ @boundary, @buffer[0,40] ]\n\t\tself.strip( @boundary )\n\tend",
"title": ""
},
{
"docid": "335e6d879772345dcadcec32dc168060",
"score": "0.48067883",
"text": "def quoted_part_to_append_to_email\n if self.message_type == 'followup' && !self.incoming_message_followup.nil?\n return \"\\n\\n-----Original Message-----\\n\\n\" + self.incoming_message_followup.get_body_for_quoting + \"\\n\"\n else\n return \"\"\n end\n end",
"title": ""
},
{
"docid": "8ce192cb0eeac1cca7c1d5f1295be992",
"score": "0.48062712",
"text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end",
"title": ""
},
{
"docid": "53fc5031eb68a22eec4a609926de71f9",
"score": "0.4792224",
"text": "def breathing_preamble\n response = \"\"\n typew(\"#{@name}, it's ok to feel down.\")\n typew(\"But it's also important not to stay there too long\")\n typew(\"Remember, you are an incredible individual.\")\n clear()\n typew(\"We are going to do a set of breathing exercises\")\n typew(\"Employing a relaxed breathing pattern calms the nervous system.\")\n typew(\"Would you like to do this exercise, #{@name}?(Y/N)\")\n response = gets.strip.downcase\n return response\n end",
"title": ""
},
{
"docid": "4cbaf3f257d1604fee1bd477cbbd9bd4",
"score": "0.47915745",
"text": "def body_text\n @body.join unless @body.nil?\n end",
"title": ""
},
{
"docid": "75b9da245e4b93d6fbd077551807a897",
"score": "0.4789841",
"text": "def buildattachmentboundary(type, encoding, filename)\n\t\tdisposition = \"\\r\\nContent-Disposition: inline; filename=\\\"#{filename}\\\"\"\n\t\treturn(\"--#{@attachmentboundary}\\r\\nContent-Type: #{type}; name=\\\"#{filename}\\\"\\r\\nContent-Transfer-Encoding: #{encoding}#{disposition}\")\n\tend",
"title": ""
}
] |
fe66b95c50640b3cdfedf469e1625f20
|
Identify and describe the Ruby method(s) you implemented. We used is_a? which tests an object to determine whether it is a certain data type. We used << which pushes an element to an array or hash. We used if/else as a conditional to help sort the elements to the output array We used .each to iterate over the input array in order to sort it _______________________________________________________________________ =begin PSEUDOCODE: "my_hash_splitting_method": 1) Make new array to hold output arrays to make sure that original array is not changed (nondestructive). 2) Go through each element and check how old each pet is. 3) IF element age is less than 4 (years old), put a copy of the name of the pet AND its age into "young pet" array within the output array 4) IF element age is greater than 4 (years old), put a copy of the name of the pet AND its age into "old pet" array within the output array 5) Return the output array =end
|
[
{
"docid": "c5e96fef21730fe44362d352c73d9cf8",
"score": "0.7247627",
"text": "def my_hash_splitting_method(source, age)\n all_pets_array = [[],[]]\n source.each do | name, pets_age |\n if pets_age < age\n all_pets_array[0] << [name, pets_age]\n else\n all_pets_array[1] << [name, pets_age]\n end\n end\n all_pets_array\nend",
"title": ""
}
] |
[
{
"docid": "bc47602cf743db10b20c7782d265b5e0",
"score": "0.70485175",
"text": "def my_hash_splitting_method(source, age)\n all_pets_array = []\n # all_pets_array << source.select{ |name, pets_age| pets_age < age }\n # all_pets_array << source.select{ |name, pets_age| pets_age >= age }\n all_pets_array << source.each_with_object([]) do |pet_data, array|\n array << pet_data if pet_data[1] < 4 #[[\"Hooibe\", 3], [\"Annabelle\", 0], [\"Ditto\", 3]] \"Dittos\" => 3\n end\n all_pets_array << source.each_with_object([]) do |(pet, age), array|\n array << [pet, age] if age >= 4\n end\n # hash[key] = value #how you add stuff to a hash\nend",
"title": ""
},
{
"docid": "65118303ee411af60a1154413cb00a12",
"score": "0.6342093",
"text": "def my_hash_splitting_method(source, age)\n new_array = [[],[]]\n source.each do | key, value |\n if value <= age\n new_array[0].push([key, value])\n else\n new_array[1].push([key, value])\n end\n end\n return new_array\nend",
"title": ""
},
{
"docid": "150b0784a521f9ce9873223196084d32",
"score": "0.6274762",
"text": "def my_array_sorting_method(source)\n\tputs i_want_pets.partition{|x| x.is_a? Fixnum}.map(&:sort).flatten.inspect\n\tputs i_want_pets.inspect\nend",
"title": ""
},
{
"docid": "965978ad69f9acc31161be061a3a7625",
"score": "0.6148627",
"text": "def my_hash_splitting_method(source, age)\n results = [[],[]]\n source.select do |x,y| y\n if y < age\n results[0] << [x, y]\n else\n results[1] << [x, y]\n end\n end\n return results\nend",
"title": ""
},
{
"docid": "b5238c2f009724f6172673a6b1ad427d",
"score": "0.58819366",
"text": "def my_hash_sorting_method(source)\n source.sort_by { |pet, age| age }\nend",
"title": ""
},
{
"docid": "dc5800150aad5661953c596306734978",
"score": "0.58079267",
"text": "def my_array_sorting_method(i_want_pets)\n i_want_pets.sort_by do |item| \n item.to_s\nend\n\nend",
"title": ""
},
{
"docid": "37443c6a4fbdaa76972b8d57999d4b0d",
"score": "0.5640056",
"text": "def my_array_sorting_method(pets)\n return pets.sort_by {|x| x.to_s}\nend",
"title": ""
},
{
"docid": "0f3c5ebd104c1351e94a4d1a82ad76f2",
"score": "0.5626035",
"text": "def my_array_splitting_method(source)\nend",
"title": ""
},
{
"docid": "7f61570f4e3a7ba1f193aeea72a7da8f",
"score": "0.56189746",
"text": "def pets_by_breed(pet_shop, pet_type)\n found_pets = [] # this creates an empty array.\n # Why can't I move [:breed] from line 31 to line 30????\n for pet in pet_shop[:pets] # this loops through the 6 hashes in the [:pets] array.\n if pet[:breed] == pet_type # if any of those 6 hashes has a |breed:\"British Shorthair\"| pair, it will match the pet_type arguement.\n found_pets.push(pet) # this will push any hashes containing the |breed:\"British Shorthair\"| pair into the found_pets array.\n end\n end\n return found_pets # this returns the array which contains 2 hashes.\nend",
"title": ""
},
{
"docid": "24f04c3566c68e75f83bcecf629b1552",
"score": "0.56081283",
"text": "def my_array_sorting_method(i_want_pets)\n pets_sorted = i_want_pets.sort_by {|x| x.to_s}\nend",
"title": ""
},
{
"docid": "3bd7fbc4b63ad74f21c04851b205a37f",
"score": "0.5607687",
"text": "def my_array_sorting_method(i_want_pets)\n i_want_pets.sort_by {|x| x.to_s}\nend",
"title": ""
},
{
"docid": "4111a9f6712cee82d2e140ae0dc7a2eb",
"score": "0.55947745",
"text": "def my_array_splitting_method(source)\n\nend",
"title": ""
},
{
"docid": "4111a9f6712cee82d2e140ae0dc7a2eb",
"score": "0.55947745",
"text": "def my_array_splitting_method(source)\n\nend",
"title": ""
},
{
"docid": "02a833f8605d9455dc2c02807edc62ff",
"score": "0.55733556",
"text": "def my_array_splitting_method(source)\n \nend",
"title": ""
},
{
"docid": "7e62c11ca1327d773b006f1248ae0569",
"score": "0.5564402",
"text": "def my_array_sorting_method(i_want_pets)\n p i_want_pets.sort_by {|item| item.to_s}\nend",
"title": ""
},
{
"docid": "3d1a96cb6f5e4b0d1bdb94ff2cd66128",
"score": "0.55529237",
"text": "def my_array_splitting_method(source)\n int_array = []\n string_array = []\n source.each do |x|\n if x.is_a?(Integer)\n int_array << x\n else\n string_array << x\n end\n end\n sorted_arrays = [int_array] + [string_array]\n return sorted_arrays\nend",
"title": ""
},
{
"docid": "10df7299f38cf6fafbd41d8a21874ba3",
"score": "0.5540123",
"text": "def my_sort_by_fucked_version(&prc)\n\n arr = []\n self.each do |k, v|\n arr << [k, v]\n end\n\n i = 0\n while i < arr.length\n j = i + 1\n while j < arr.length\n #decides whether its\n p \"THIS DOESNT WORK! because it cant get the return value from the proc\"\n p \"For example what if we wanted to compare the lengths of values instead, that would mean key.length \"\n if prc.call('key', 'value') == \"key\"\n if arr[i][0] > arr[j][0]\n arr[i], arr[j] = arr[j], arr[i]\n end\n else\n if arr[i][1] > arr[j][1]\n arr[i], arr[j] = arr[j], arr[i]\n end\n end\n j += 1\n end\n i += 1\n end\n\n arr\n\n end",
"title": ""
},
{
"docid": "759d95733d31bfb0657978192ffe71bf",
"score": "0.55165845",
"text": "def array_sort\n @sortmethod.return_array_sorted\n end",
"title": ""
},
{
"docid": "e18cdb1f38832c2050c840749315ba43",
"score": "0.55117345",
"text": "def my_array_sorting_method(i_want_pets)\n integers = []\n strings = []\n i_want_pets.each do |element|\n if element.is_a? Integer\n integers << element\n else\n strings << element\n end\n end\n integers.sort.concat(strings.sort)\nend",
"title": ""
},
{
"docid": "6429cea99e6efa4ac275aa9f118ec7d6",
"score": "0.5488263",
"text": "def my_array_sorting_method(i_want_pets)\n\ti_want_pets.sort { |a, b| a.to_s <=> b.to_s }\nend",
"title": ""
},
{
"docid": "28cce464690a7f2734fec7c0614f8df9",
"score": "0.5477533",
"text": "def how_to_sort(array)\nputs \"How do you want to sort?\"\nhow_to_sort = gets.chomp\n\nif how_to_sort == \"price\"\n\tsorted_array = array.sort_by { |element| element.price }\n\n\nelsif how_to_sort == \"capacity\"\n\tsorted_array = array.sort_by { |element| element.capacity }\n\tend\n\n\tarray.each do |home|\n\t\tputs home.name\n\tend\n\nend",
"title": ""
},
{
"docid": "f8559860a78e3d5dcf178e8f30200734",
"score": "0.54663473",
"text": "def my_hash_sorting_method(source)\n return source.sort_by {|name, age| age}\nend",
"title": ""
},
{
"docid": "e73d52a88fa18e0181173d5e3ca97464",
"score": "0.5456399",
"text": "def my_array_sorting_method(source)\n i_want_pets.sort_by {|x| x.to_s}\nend",
"title": ""
},
{
"docid": "e73d52a88fa18e0181173d5e3ca97464",
"score": "0.5456399",
"text": "def my_array_sorting_method(source)\n i_want_pets.sort_by {|x| x.to_s}\nend",
"title": ""
},
{
"docid": "3b7594ecfcdb923145cbb1afa1532a32",
"score": "0.54323655",
"text": "def my_array_splitting_method(source)\n integer_sorted_array = source.partition { |obj| obj.is_a? Integer }\nend",
"title": ""
},
{
"docid": "125f4955cd7d496d0656c50591781e89",
"score": "0.5427191",
"text": "def my_array_splitting_method(i_want_pets)\n first_array=[]\n second_array=[]\n \n first_array = i_want_pets.select{ |x| x.is_a? Integer} \n\n second_array = i_want_pets.select{ |x| x.is_a? String}\n\n return Array[first_array, second_array]\n \nend",
"title": ""
},
{
"docid": "c44d832aafb9499e335b3a302ddf6f7e",
"score": "0.53810495",
"text": "def great_births(hashhere)\n\tary=Array.new\n\t#push to ary\n\thashhere.each{|k,v| ary.push(v)}\n\t#sort ary\n\tary.sort_by! {|hash| hash[:year_of_birth]}\n\tary.each {|hash| print \"#{hash[:name].to_s} is a great person born in #{hash[:year_of_birth].to_s}.\\n\" }\n\nend",
"title": ""
},
{
"docid": "159bc4d733fabfb3e2a4030d1a47a913",
"score": "0.5369043",
"text": "def merge_sort array\nend",
"title": ""
},
{
"docid": "4be5121b754d5df698597f29253c31d5",
"score": "0.53409237",
"text": "def sorter(fullArray) # takes an array\nputs \"start of sorter function\"\n\nputs \"creating empty arrays for smaller and bigger\"\nsmaller = []\nbigger = []\n\n \n puts \"checking length of array is >1\"\n if fullArray.count <= 1\n # The puts can all be removed once the sorter is fully debugged\n puts \"array contains 1 or fewer items, returning full array\"\n return fullArray\n end\n \n puts \"generating pivot\"\n pivotIndex, pivotValue = pivotChoose(fullArray) # assume you can combine variables like this\n \n \n puts \"inserting items into smaller/bigger based on pivot value\"\n fullArray.each do |val|\n puts \"comparing val to pivotValue\"\n if val < pivotValue\n #puts \"val is < pivotValue so inserting at beginning of smaller\"\n #smaller.insert(0, val)\n # In retrospect, placing each successive insert at the beginning of smaller doesn't make sense.\n \n puts \"val is < pivotValue so inserting at beginning of smaller\"\n smaller << val\n puts smaller\n end\n if val > pivotValue\n puts \"val is > pivotValue so appending to bigger\"\n bigger << val\n puts bigger\n end\n end\n \n \n if smaller.count > 1\n puts \"running sorter on smaller subset of array\"\n smaller = sorter(smaller)\n end\n \n if bigger.count > 1\n puts \"running sorter on bigger subset of array\"\n bigger = sorter(bigger)\n end\n \n puts \"combining arrays\"\n fullArray = smaller + [pivotValue] + bigger\n \nend",
"title": ""
},
{
"docid": "f1cbbd6aeaee55fd772371e8a90eb35d",
"score": "0.5317453",
"text": "def merge_sort(array)\n # \nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5293777",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5293777",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5293777",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "72aa19f2a646297928936bd2475ed9de",
"score": "0.5278705",
"text": "def my_array_sorting_method(source)\n \nend",
"title": ""
},
{
"docid": "7f16cf45c7d88e51613d6afbcd0e1740",
"score": "0.5276686",
"text": "def my_array_sorting_method(source)\nend",
"title": ""
},
{
"docid": "60a6985802e37d30d94849fec0f43a2c",
"score": "0.5255835",
"text": "def merge_sort(array, &prc)\nend",
"title": ""
},
{
"docid": "b4cfc7e651465c8c64d2dc6c7a9f8663",
"score": "0.52471143",
"text": "def merge_sort(array)\nend",
"title": ""
},
{
"docid": "b4cfc7e651465c8c64d2dc6c7a9f8663",
"score": "0.52471143",
"text": "def merge_sort(array)\nend",
"title": ""
},
{
"docid": "5e871415d1472a041467a0347bfa3f8a",
"score": "0.523967",
"text": "def mergesort(input)\nend",
"title": ""
},
{
"docid": "042fc0e78c4ca73da112c387006e1b6a",
"score": "0.5230762",
"text": "def merge_sort(array)\n\nend",
"title": ""
},
{
"docid": "042fc0e78c4ca73da112c387006e1b6a",
"score": "0.5230762",
"text": "def merge_sort(array)\n\nend",
"title": ""
},
{
"docid": "53a7fc9bad1f433e215e5f671284727b",
"score": "0.5196667",
"text": "def my_array_splitting_method(source)\r\n\r\n split_array = []\r\n array_1 = []\r\n array_2 = []\r\n\r\n source.each do | item |\r\n if item.is_a?(Integer)\r\n array_1.push(item)\r\n else\r\n array_2.push(item)\r\n end\r\n end\r\n\r\n split_array.push(array_1)\r\n split_array.push(array_2)\r\n\r\n return split_array\r\n\r\nend",
"title": ""
},
{
"docid": "74846d69660b97f48471cac2280ec24f",
"score": "0.51589733",
"text": "def group_by_age_hash(array)\n return if array.length < 2\n\n students = Hash.new\n\n array.each do |s|\n if students[s.age]\n students[s.age] << s\n else\n students[s.age] = [s]\n end\n end\n\n write_index = 0\n\n students.each do |students_by_age|\n students_by_age[1].each do |s|\n array[write_index] = s\n write_index += 1\n end\n end\n\nend",
"title": ""
},
{
"docid": "93c334c29615908ba8b28b3e6252a4c2",
"score": "0.51530445",
"text": "def well_written_ruby(*arrays)\n combined_array = []\n\n arrays.each do |array|\n combined_array += array\n end\n\n return bubble_sort(combined_array)\nend",
"title": ""
},
{
"docid": "db163d5c1bca92fc428407674687aa19",
"score": "0.5152172",
"text": "def make_grouping(ary, meth)\n a = []\n k_prev = nil\n ary.each do |f|\n k = f.__send__(meth)\n if k_prev and k_prev == k then\n a.last << f\n else\n a << []\n a.last << f\n end\n k_prev = k\n end\n a\n end",
"title": ""
},
{
"docid": "ac82e0d37617949047314557ad688eb9",
"score": "0.50995535",
"text": "def get_sorted_array\n end",
"title": ""
},
{
"docid": "ac82e0d37617949047314557ad688eb9",
"score": "0.50995535",
"text": "def get_sorted_array\n end",
"title": ""
},
{
"docid": "ac82e0d37617949047314557ad688eb9",
"score": "0.50995535",
"text": "def get_sorted_array\n end",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3aef56e716abe1d4a4adb15fe6b7dacc",
"score": "0.50948584",
"text": "def my_array_sorting_method(source)\n # Your code here!\nend",
"title": ""
},
{
"docid": "3eb073b233b68fdfbfc52d37076d7246",
"score": "0.5093774",
"text": "def make_operations\n #1. for each one of the Names, change them to upper case.\n array_new= @persons_hash.map {|id, value| value.upcase}\n #2. print the position and the Name of each person registered\n puts \"The position and the Name of each person registered\"\n @persons_hash.each_with_index do |(id, value), index|\n puts \"The index #{index} - Name:#{value}\"\n end\n #3. Save the name in upper case into an array, return the array\n return array_new\n end",
"title": ""
},
{
"docid": "6b961668b031cff154312bcb055cf0bc",
"score": "0.50928426",
"text": "def new_sorting_hat(first_names)\n d = SexMachine::Detector.new(case_sensitive: false)\n new_first_names = []\n\n first_names.each_with_index do |name, i|\n name_check = name.scan(/^\\w+/)[0].to_s\n\n if d.get_gender(name_check) == :female\n new_first_names << name\n new_first_names.push(\"female\")\n new_first_names.push(1)\n elsif d.get_gender(name_check) == :male\n new_first_names << name\n new_first_names.push(\"male\")\n new_first_names.push(1)\n elsif d.get_gender(name_check) == :mostly_female\n new_first_names << name\n new_first_names.push(\"mostly_female\")\n new_first_names.push(1)\n elsif d.get_gender(name_check) == :mostly_male\n new_first_names << name\n new_first_names.push(\"mostly_male\")\n new_first_names.push(1)\n else\n new_first_names << name\n new_first_names.push(\"andy\")\n new_first_names.push(1)\n end\n end\n return new_first_names\n end",
"title": ""
},
{
"docid": "196b7527d204c47fdce43b67625beae9",
"score": "0.50887746",
"text": "def my_array_splitting_method(source)\n\n split_array = []\n array_1 = []\n array_2 = []\n\n source.each do | item |\n if item.is_a?(Integer)\n array_1.push(item)\n else\n array_2.push(item)\n end\n end\n\n split_array.push(array_1)\n split_array.push(array_2)\n\n return split_array\n\nend",
"title": ""
},
{
"docid": "196b7527d204c47fdce43b67625beae9",
"score": "0.50887746",
"text": "def my_array_splitting_method(source)\n\n split_array = []\n array_1 = []\n array_2 = []\n\n source.each do | item |\n if item.is_a?(Integer)\n array_1.push(item)\n else\n array_2.push(item)\n end\n end\n\n split_array.push(array_1)\n split_array.push(array_2)\n\n return split_array\n\nend",
"title": ""
},
{
"docid": "36d5bd0563fd3e36ef62201638f3098c",
"score": "0.5087747",
"text": "def my_array_sorting_method(source)\r\n # Your code here!\r\nend",
"title": ""
},
{
"docid": "0d07f83e3c8e65f842ad999fbfca94f1",
"score": "0.50839543",
"text": "def my_array_sorting_method(source)\n source.partition{|x| x.is_a? Integer}.map(&:sort)\nend",
"title": ""
},
{
"docid": "40feafda5785322f3987045ee311ac02",
"score": "0.50819707",
"text": "def my_array_sorting_method(source)\n result = source.sort\nend",
"title": ""
},
{
"docid": "8dc6f9fb5bfbb441c596dc2002718727",
"score": "0.5081376",
"text": "def group_by_age(array)\n return if array.length < 2\n\n write_index = 0\n\n while write_index < array.length - 1\n age = array[write_index].age\n array[write_index], array[-1] = array[-1], array[write_index]\n\n (write_index..array.length - 1).each do |i|\n if array[i].age == age\n array[write_index], array[i] = array[i], array[write_index]\n write_index += 1\n end\n end\n end\nend",
"title": ""
},
{
"docid": "f9f6ac978ea25cb1385bd32dac5b81cf",
"score": "0.5079629",
"text": "def split_for_merge_sort\n [self[0, size/2], self[size/2, size - size/2]]\n end",
"title": ""
},
{
"docid": "02bd140a3be0d627ac5db21e528d4072",
"score": "0.5064653",
"text": "def my_array_splitting_method(source)\n # separate by integer or string and move each into an array\n string_array = Array.new\n integer_array = Array.new\n source.each do |x|\n if x.is_a? Integer\n integer_array << x\n else\n string_array << x\n end\n end\n# create new array with each array as the two array values\np [integer_array, string_array]\nend",
"title": ""
},
{
"docid": "3ee2069de4464a255f52722131090e51",
"score": "0.50615335",
"text": "def my_array_splitting_method(source)\n # Create two empty arrays for integers and strings, and one called my_array\n integers = []\n strings = []\n my_array = []\n # Iterate through the source array, test whether element is an integer, and, if so, add to integers array; otherwise, add to strings array\n source.each do |x|\n if x.is_a? Integer\n integers << x\n else\n strings << x\n end\n end\n # Push both arrays into my_array\n my_array << integers\n my_array << strings\n source = my_array\nend",
"title": ""
},
{
"docid": "08a64502f8fb6ce87ca8598914e1eaad",
"score": "0.50611496",
"text": "def sorted_by_age\n end",
"title": ""
},
{
"docid": "dd399a3650f2f6abf4145a64b6a58b5e",
"score": "0.5059532",
"text": "def merge_sort\n Sorting.split_array(array_list, self)\n end",
"title": ""
},
{
"docid": "a4e987294bc77465391aca374ff3d29f",
"score": "0.50575",
"text": "def my_array_splitting_method(array)\n #Declare new arrays for both strings and numbers, by selecting only the data type we want from the input array\n strings = array.select { |num| num.instance_of? String}\n numbers = array.select { |num| num.instance_of? Fixnum}\n \n \n #Create a final array that is the combination of both \n final = []\n return final.push(numbers,strings) \nend",
"title": ""
},
{
"docid": "556bb57c1cb686d26403353f75a5fe15",
"score": "0.5055796",
"text": "def split; end",
"title": ""
},
{
"docid": "7cf7ee9455e9abb3b0b46e91ea294c0b",
"score": "0.505461",
"text": "def sort_parts!; end",
"title": ""
},
{
"docid": "0574c26fc63d8e3937c493217e326c75",
"score": "0.50506794",
"text": "def sortjob(jobtype)\n # binding.pry\n case jobtype\n # binding.pry\n when 'cook'\n then @@jobs[:cook].push self\n when 'farmhands'\n then @@jobs[:farmhands].push self\n when 'farmer'\n then @@jobs[:farmer].push self\n when 'owner'\n then @@jobs[:owner].push self\n when 'unemployeed'\n then @@jobs[:unemployeed].push self\n end\n end",
"title": ""
},
{
"docid": "c29f55b3bc37bdc6e1e9fdc04b130b10",
"score": "0.5048868",
"text": "def my_group_by(array, &prc) #1 array\n my_hash = Hash.new { |h, k| h[k] = Array.new }\n array.each do |ele|\n my_hash[prc.call(ele)] << ele\n end\n my_hash\nend",
"title": ""
},
{
"docid": "e4540ac60d4eba05fd8650337f4c0cc3",
"score": "0.5046569",
"text": "def sort(array)\n\nend",
"title": ""
},
{
"docid": "729d211db79944affb994ad93cebe722",
"score": "0.504491",
"text": "def book(books)\n sp = [books[0][:price], books[1][:price], books[2][:price], books[3][:price], books[4][:price], books[5][:price]]\n ri = []\n (0..5).each do |i|\n next unless books[i].key?(:tags)\n\n ri << books[i][:name] if books[i][:tags].include?('ruby')\n end\n print sp.sort\n puts ri\nend",
"title": ""
},
{
"docid": "8f26dd2635c1eb29aca80bc1bd5bd467",
"score": "0.50406164",
"text": "def sort_method; end",
"title": ""
},
{
"docid": "81b3d88f90233641845f11a7b2173622",
"score": "0.5038763",
"text": "def sort\n # split entire array\n sort_array(0, @size - 1)\n end",
"title": ""
},
{
"docid": "cdbc11aadad0cbc9b8c316d67bd6ad06",
"score": "0.5037887",
"text": "def sort_array (array) # create a method that gets an array as a parameter\n array.sort! # sort and return the array\nend",
"title": ""
},
{
"docid": "8b398683b0f34f578410ffce5eff3679",
"score": "0.50302607",
"text": "def my_array_sorting_method(source)\n\treturn source.map{|x| x.to_s}.sort \n\t#return source.sort_by{|x| x.to_s} => see comment A below regarding this line\nend",
"title": ""
},
{
"docid": "d1fbc7b2f83e7b0b12629a42d67e8f70",
"score": "0.5030097",
"text": "def sort1(array)\n\nend",
"title": ""
},
{
"docid": "d1fbc7b2f83e7b0b12629a42d67e8f70",
"score": "0.5030097",
"text": "def sort1(array)\n\nend",
"title": ""
},
{
"docid": "98768e5cf28e5cfa1f4b864fac98e708",
"score": "0.50247014",
"text": "def get_hashes_array_sorted_values (array_of_entities, keys_array, method)\n\n array_of_entities.\n map do |evt|\n evt.send(method).\n select do |key|\n keys_array.include? key\n end.\n values.\n sort do |a, b|\n a.to_s <=> b.to_s end.\n sort do |a, b|\n a.to_s.length <=> b.to_s.length end\n end.\n sort_by do |evt|\n [evt.first, evt.second, evt.third, evt.fourth]\n end\nend",
"title": ""
},
{
"docid": "65c3d885fcb4124af98b6d79f5d76ef8",
"score": "0.5021964",
"text": "def merge_sort()\nend",
"title": ""
},
{
"docid": "3279b56f800c63fcbd896bbe33e8e3db",
"score": "0.50177014",
"text": "def my_array_splitting_method(source)\n output_array = [[],[]]\n source.each do | element|\n if element.is_a?(Integer)\n output_array[0] << element\n else\n output_array[1] << element\n end\n end\n output_array\nend",
"title": ""
},
{
"docid": "3279b56f800c63fcbd896bbe33e8e3db",
"score": "0.50177014",
"text": "def my_array_splitting_method(source)\n output_array = [[],[]]\n source.each do | element|\n if element.is_a?(Integer)\n output_array[0] << element\n else\n output_array[1] << element\n end\n end\n output_array\nend",
"title": ""
},
{
"docid": "b253cd24256853089ade78bf92ce8c60",
"score": "0.50086874",
"text": "def split\n end",
"title": ""
},
{
"docid": "a7622520b9e1c0e46d01ce1b1af560a2",
"score": "0.5001731",
"text": "def poorly_written_ruby(*arrays)\n combined_array = []\n arrays.each do |array|\n combined_array += array\n end\n return bubble_sort(combined_array)\nend",
"title": ""
},
{
"docid": "b32de61fbc2732cc10802b7a86ce14a0",
"score": "0.5000733",
"text": "def sorter(array)\n array.sort\nend",
"title": ""
},
{
"docid": "efd81c1690059d4cca92b0c2b1310060",
"score": "0.49845082",
"text": "def sort(array)\n # if array or subarray is less than 2, it doesn't need to be sorted.\n # if this is the first iteration the algorithm is done.\n # if this a subarray, the algorithm has reached the base case and this is the last iteration.\n if array.length < 2\n return array\n # if the array or subarray is longer than 1 it must be sorted.\n else\n # the array or subarray will be split into a pivot element,\n # a subarray of elements less than the pivot,\n # and a subarray of elements greater than the pivot.\n pivot = array[0]\n less = []\n greater = []\n for x in array[1..-1]\n if x <= pivot\n less << x\n else\n greater << x\n end\n end\n #test: puts \"less = #{less}\"\n #test: puts \"pivot = #{pivot}\"\n #test: puts \"greater = #{greater}\"\n # return an array of the subarray of elements less than the pivot, then the pivot, then the subarray of elements greater than the pivot.\n return sort(less).push(pivot).concat(sort(greater))\n end\nend",
"title": ""
},
{
"docid": "5ba21d3f18d4e56b79ca9754c75e8a25",
"score": "0.4979653",
"text": "def split_array(array)\n mid = (array.length / 2) - 1\n left_split = array[0..mid]\n right_split = array[mid + 1..-1]\n merge_sort(split_array(left_split), split_array(right_split))\n # merge_sort(left_split,right_split)\nend",
"title": ""
},
{
"docid": "29d61d8920d3484b3d0bbd56af7ccdaa",
"score": "0.4974447",
"text": "def my_array_sorting_method(source)\n return source.push(thing_to_locate).sort_by{|word| word.downcase}\nend",
"title": ""
}
] |
a77ee6edb39f4ea9efdb28945ebb382d
|
requested item must be a VoyagerResponse::RequestedItem
|
[
{
"docid": "7745a340fabb5f4a8f0d7d0b81a30624",
"score": "0.5135493",
"text": "def cancel_request_for(requested_item)\n url = @server.vxws_uri(\"CancelService\")\n request = Net::HTTP::Post.new(url.path)\n request.body = cancel_request_post_data(requested_item)\n response = Net::HTTP.new(url.host, url.port).start {|http| http.request(request) }\n response.body\n end",
"title": ""
}
] |
[
{
"docid": "5da1417f7e8a0eb94f094caaf4e0ac84",
"score": "0.6358465",
"text": "def set_request_item\n @request_item = RequestItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "f4bb7ae846490ceb9735e5d03273332b",
"score": "0.6090238",
"text": "def add_item_request(item)\n if(@item_requests.has_key?(item.id))\n #error\n else\n @item_requests[item.id]=item\n end\n end",
"title": ""
},
{
"docid": "403026049b3145e49125c96992b0a06e",
"score": "0.6065264",
"text": "def set_needed_item\n @needed_item = NeededItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "d5fb3592e38780cda02bc761f8e1bb66",
"score": "0.60028315",
"text": "def show\n render json: @request_item\n end",
"title": ""
},
{
"docid": "78d81856e570647697b1a11db6b46e73",
"score": "0.5998993",
"text": "def buy_requested_item(request, item)\r\n self.overlay.delete_item_request(request.id)\r\n item.price = request.price #The prize given in the request is relevant.\r\n buy(item, true)\r\n end",
"title": ""
},
{
"docid": "4b16e4b9891dda44b4b0fd8465d7ea28",
"score": "0.59956914",
"text": "def request_item\n if is_downloadable?\n if is_viewable?\n respond_to do |format|\n format.html do\n flash[:notice] = 'File retrieval request received.'\n redirect_to(\n recall_bendo_item_path(id: noid),\n status: :found\n )\n end\n format.json { json_api_response }\n end\n else\n respond_to do |format|\n format.html do\n flash[:alert] = \"You are not permitted to view the item with ID: #{noid}\"\n redirect_to recall_bendo_item_path(id: noid)\n end\n format.json { json_unauthorized_response }\n end\n end\n else\n respond_to do |format|\n format.html do\n flash[:alert] = \"No files can be downloaded for ID: #{noid}\"\n redirect_to recall_bendo_item_path(id: noid)\n end\n format.json { json_not_found_response }\n end\n end\n end",
"title": ""
},
{
"docid": "87aa803834e308d48bcb5e279a9df494",
"score": "0.5904234",
"text": "def saw_item(item); end",
"title": ""
},
{
"docid": "0300041664c73c28bd35f791333453d5",
"score": "0.5834843",
"text": "def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end",
"title": ""
},
{
"docid": "37e3c4ff85d142754cc5568294fb3d3f",
"score": "0.57838804",
"text": "def set_apiv1_item\n @apiv1_item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "59960feb915d72350182277179d9cb9e",
"score": "0.5780596",
"text": "def sell_requested_item(request, buyer)\r\n item = get_matching_item(request)\r\n buyer.buy_requested_item(request, item)\r\n end",
"title": ""
},
{
"docid": "119ce5703b099c3064cea318eb767107",
"score": "0.57767457",
"text": "def set_api_v1_item\n @api_v1_item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc5811c80efcf2dfee3d6fac65b6c79a",
"score": "0.5730584",
"text": "def create\n @request_item = RequestItem.new(request_item_params)\n @request_item.item = Item.new(name: params[:request_item][:item][:name])\n\n if @request_item.save\n render json: @request_item \n else\n render json: @request_item.errors, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "afe7af2b99d928d88752c98d5b41d649",
"score": "0.5681461",
"text": "def recall_item\n if is_downloadable?\n if is_viewable?\n respond_to do |format|\n format.html { render 'recall_item', status: :see_other }\n format.json { json_delegate_response }\n end\n else\n respond_to do |format|\n format.html { render unauthorized_template, status: :unauthorized }\n format.json { json_unauthorized_response }\n end\n end\n else\n respond_to do |format|\n format.html { render 'item_not_found', status: :not_found }\n format.json { json_not_found_response }\n end\n end\n end",
"title": ""
},
{
"docid": "8b3797f5672b552a26c6b268b0866f42",
"score": "0.561741",
"text": "def set_wanted_item\n @wanted_item = WantedItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "ba9917b8d6acdc932092103e329e9392",
"score": "0.5602212",
"text": "def set_item\n @item = Item.find(params[:id])\n render json: {error: 'not allowed'}, status: 401 unless @item.user == @current_user\n\n end",
"title": ""
},
{
"docid": "7b7fb31eb93a05815ac4b12b2d38735b",
"score": "0.55241126",
"text": "def update\n respond_to do |format|\n if @needed_item.update(needed_item_params)\n format.html { redirect_to @needed_item, notice: 'Needed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @needed_item }\n else\n format.html { render :edit }\n format.json { render json: @needed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5824b851c847b5fe3550ac11a6d4580a",
"score": "0.5493331",
"text": "def wanted_item_params\n params.require(:wanted_item).permit(:user_id, :wanted_item_id)\n end",
"title": ""
},
{
"docid": "46e50b0f70e2b6b7c636870affe897e8",
"score": "0.548499",
"text": "def new\n @found_item = current_user.found_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @found_item }\n end\n end",
"title": ""
},
{
"docid": "608686eb9b3d6631cb8efce5149fed5d",
"score": "0.5463896",
"text": "def vestItems _args\n \"vestItems _args;\" \n end",
"title": ""
},
{
"docid": "910ce17a50beee81b8bb168b2658b1b0",
"score": "0.5443876",
"text": "def new\n @request = Request.new\n @items = session[:item_ids]\n @request.requestor_id = current_user.id\n if current_user.is_partner?\n @request.status = 'pending'\n else\n @request.status = 'approved'\n end \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"title": ""
},
{
"docid": "36c3f3ffae6dc4a04109c9bbb485f5d8",
"score": "0.54372036",
"text": "def get_item_requests()\n @item_requests.values\n end",
"title": ""
},
{
"docid": "9e059e4239e69f39ab00fc59f7dee61d",
"score": "0.5409273",
"text": "def show\n @request = Request.find(params[:id])\n @items = @request.items\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @request }\n end\n end",
"title": ""
},
{
"docid": "34c03e737cf168057a0b174460981e36",
"score": "0.5400039",
"text": "def create\n @order_item = OrderItem.new(order_item_params)\n @order_item.requested_by = current_user\n\n respond_to do |format|\n if @order_item.save\n format.html { redirect_to @order_item, notice: 'Order item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @order_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @order_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dbd85734763d149186927259a35c0a7",
"score": "0.5389788",
"text": "def examine(item)\r\n \r\n end",
"title": ""
},
{
"docid": "cbc61fe62c04d5e72b36523b0b76cbf7",
"score": "0.5372946",
"text": "def items\n @items ||= items_from_response\n end",
"title": ""
},
{
"docid": "43abee05a3e4d8d46c7539555f362185",
"score": "0.53727984",
"text": "def item; @item; end",
"title": ""
},
{
"docid": "43abee05a3e4d8d46c7539555f362185",
"score": "0.53727984",
"text": "def item; @item; end",
"title": ""
},
{
"docid": "4220e236f0bc850d02485c87e316472a",
"score": "0.5369141",
"text": "def before_item(item)\n item\n end",
"title": ""
},
{
"docid": "f7f6752c4ecdba36468035ac18886e96",
"score": "0.5365897",
"text": "def request_item_params\n #this enforces strong parameters\n params.require(:request_item).permit(:request_id, :max_price, :quantity_description, :item)\n end",
"title": ""
},
{
"docid": "daf929826d5c40b5e4be29356b79abb0",
"score": "0.5357762",
"text": "def update\n respond_to do |format|\n if @wanted_item.update(wanted_item_params)\n format.html { redirect_to @wanted_item, notice: 'Wanted item was successfully updated.' }\n format.json { render :show, status: :ok, location: @wanted_item }\n else\n format.html { render :edit }\n format.json { render json: @wanted_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "863f1439bc3c4672ff392529b836ac05",
"score": "0.5345548",
"text": "def request_item_params\n # Rails 4+ requires you to whitelist attributes in the controller.\n params.fetch(:request_item, {}).permit(:quantity, :item_id, :request_id)\n end",
"title": ""
},
{
"docid": "fc90ede83c4237c40171f7b38b5a06a9",
"score": "0.5328436",
"text": "def got_it\n @fulfillment = Fulfillment.new\n @item = Item.find(params[:id])\n # Select all unseen fulfillments for the item to display to the user \n # (so the user doesn't create a duplicate fulfillment)\n @unseen_fulfillments = @item.fulfillments.where(status: 0)\n end",
"title": ""
},
{
"docid": "74130d6c64fb0bfa4eefd51acd1d6d58",
"score": "0.5321318",
"text": "def validate_item( x )\n fail 'not implemented!'\n end",
"title": ""
},
{
"docid": "c47bad357caf5666a8be3fab7eb955bb",
"score": "0.5314827",
"text": "def request_release(options = {})\n response = JSON.parse(@client.patch(\"items/#{send(:id)}/request_release\", options).body)\n @attributes = response['items']\n true\n end",
"title": ""
},
{
"docid": "c47bad357caf5666a8be3fab7eb955bb",
"score": "0.5314827",
"text": "def request_release(options = {})\n response = JSON.parse(@client.patch(\"items/#{send(:id)}/request_release\", options).body)\n @attributes = response['items']\n true\n end",
"title": ""
},
{
"docid": "64c7329145e9931cb6f1394c5c65c6de",
"score": "0.5308905",
"text": "def refine_item_outlook(item)\n the_item = {id: item.id, title: item.title, description: item.description, category: Category.find(item.category_id).value, \n price: \"%.2f\" % item.price, seller_name: Seller.find(item.seller_id).name, seller_longitude: Seller.find(item.seller_id).longitude,\n seller_latitude: Seller.find(item.seller_id).latitude, status: Status.find(item.status_id).value, published_date: item.published_date}\n end",
"title": ""
},
{
"docid": "f1acdb1c11c94d512dff545c782c7eb8",
"score": "0.52925086",
"text": "def get_item\n @item = Item.find_by_id(params[:id])\n if @item\n return @item\n else \n render json: {\"message\": {\"type\": \"error\", \"content\": \"The item could not be found!\"}}\n end\n end",
"title": ""
},
{
"docid": "e8687d6b7790feb22089108d307dd4b8",
"score": "0.52842313",
"text": "def set_item\n @item = current_owner.items.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b0ad9e19bf19f0bb84f48311c513ffb",
"score": "0.52741104",
"text": "def show\n \n render status: 200, :json => @item\n\n end",
"title": ""
},
{
"docid": "6dd5eb19ded09dd01b5b29e8a2ff1a1f",
"score": "0.52703935",
"text": "def apiv1_item_params\n params.fetch(:apiv1_item, {})\n end",
"title": ""
},
{
"docid": "cb5e914e7144a68507eecbc001b7223b",
"score": "0.52586764",
"text": "def set_considered_item\n @considered_item = ConsideredItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "733aa944a134f0387eb3619e14314b74",
"score": "0.52583927",
"text": "def fox_item\n @item\n end",
"title": ""
},
{
"docid": "48a08cc9ab2dec684a9f4ff2e729da10",
"score": "0.5255084",
"text": "def set_found_item\n @found_item = FoundItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "d33267a7666f186d535ef864ba238eef",
"score": "0.52547026",
"text": "def get_item_from_body(body)\n get_item_from_result(body.fetch('Item', {}))\n end",
"title": ""
},
{
"docid": "48a08cc9ab2dec684a9f4ff2e729da10",
"score": "0.52541906",
"text": "def set_found_item\n @found_item = FoundItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "6e15c7cfc42d9015c5c3c4614953cceb",
"score": "0.5252235",
"text": "def api_v1_item_params\n params.require(:item).permit(:plate, :status, :menu_id)\n end",
"title": ""
},
{
"docid": "052d18857c6d6ac4c8efa6bc6bf43790",
"score": "0.524549",
"text": "def show\n @wanted_item = WantedItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "452942fc9b4f41752d7a55349c199c63",
"score": "0.5244089",
"text": "def construct_resource item\n raise Exception.new(\"You need to implement this in your subclass of Harvester\")\n end",
"title": ""
},
{
"docid": "d99971c3d4089a8ed4b8bd1ca0fc2ef0",
"score": "0.52403677",
"text": "def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end",
"title": ""
},
{
"docid": "8d05489a0da1c75f5800fc9242a83663",
"score": "0.5233216",
"text": "def offer_an_item(item)\r\n item.status = true\r\n end",
"title": ""
},
{
"docid": "2124b735b974700572915316a9bf8853",
"score": "0.52250075",
"text": "def create\n @apiv1_item = Item.new(apiv1_item_params)\n\n respond_to do |format|\n if @apiv1_item.save\n format.html { redirect_to @apiv1_item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @apiv1_item }\n else\n format.html { render :new }\n format.json { render json: @apiv1_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "419a0d986603c4fca766f037ef0c05b4",
"score": "0.52171534",
"text": "def update\n @request = Request.find(params[:id])\n @request.approver_id = current_user.id\n @request.date_processed = Time.now\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n # Have to save any changes to request items\n @prior_items = @request.items.map{|i| i.id}\n @current_items = session[:item_ids]\n removed = @prior_items - @current_items\n added = @current_items - @prior_items\n \n # remove ones that are deleted\n removed.each do |item_id|\n ri = RequestItem.find_by_item_id_and_request_id(item_id, @request.id)\n ri.destroy\n end\n \n # add any new ones\n added.each do |item_id|\n ri = RequestItem.new\n ri.request_id = @request.id\n ri.item_id = item_id\n ri.date_checked_out = Time.now\n ri.save!\n end\n session[:item_ids] = []\n \n \n format.html { redirect_to(@request, :notice => 'Request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "604f204becc31165c12673ef2300f0b1",
"score": "0.521627",
"text": "def item; end",
"title": ""
},
{
"docid": "604f204becc31165c12673ef2300f0b1",
"score": "0.521627",
"text": "def item; end",
"title": ""
},
{
"docid": "604f204becc31165c12673ef2300f0b1",
"score": "0.5216001",
"text": "def item; end",
"title": ""
},
{
"docid": "604f204becc31165c12673ef2300f0b1",
"score": "0.5216001",
"text": "def item; end",
"title": ""
},
{
"docid": "604f204becc31165c12673ef2300f0b1",
"score": "0.5216001",
"text": "def item; end",
"title": ""
},
{
"docid": "0c89cf36f00de30cdeb57c416ce6fe74",
"score": "0.5208683",
"text": "def set_item\n puts params[:id]\n @item = Item.find(params[:id])\n puts 'here is', @item\n rescue ActiveRecord::RecordNotFound\n render json: { message: 'Sorry! Item not found.' }, status: 404\n end",
"title": ""
},
{
"docid": "e4f60b4101e5eb26f3d5aafc562606a2",
"score": "0.5206971",
"text": "def set_requirement_item\n @requirement_item = RequirementItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b1ce0e28261bd11ed09e52fe8caa143",
"score": "0.5199131",
"text": "def initialize(object)\n @item = object[\"item\"]\n end",
"title": ""
},
{
"docid": "d30fb3ba74148c50fda7d98c82ecbb62",
"score": "0.5190371",
"text": "def create\n @api_v1_item = Item.new(api_v1_item_params)\n\n if @api_v1_item.save\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"title": ""
},
{
"docid": "b4bc11df5f575b8fedcaaba2069e221f",
"score": "0.5188042",
"text": "def refine_item_outlook(item)\n the_item = {}\n if Status.find(item.status_id).value.include? \"Banned\"\n the_item = {id: item.id, title: item.title, description: item.description, category: Category.find(item.category_id).value, \n price: \"%.2f\" % item.price, seller_longitude: Seller.find(item.seller_id).longitude,\n seller_latitude: Seller.find(item.seller_id).latitude, status: Status.find(item.status_id).value}\n else \n the_item = {id: item.id, title: item.title, description: item.description, category: Category.find(item.category_id).value, \n price: \"%.2f\" % item.price, seller_name: Seller.find(item.seller_id).name, seller_longitude: Seller.find(item.seller_id).longitude,\n seller_latitude: Seller.find(item.seller_id).latitude, status: Status.find(item.status_id).value, published_date: item.published_date}\n end\n return the_item\n end",
"title": ""
},
{
"docid": "058177f2ccb6e52bb9b76b95a1d49b48",
"score": "0.517891",
"text": "def set_item\n @resource_item = ResourceItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "83ec54dd0bc3d146f5b0da0fc7d3d4aa",
"score": "0.5172918",
"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": "a95777aad2de3120b2e46c9109843f54",
"score": "0.5170094",
"text": "def set_votable_item\n @votable_item = VotableItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "b50006967f623e05e002c095a938dc64",
"score": "0.51596797",
"text": "def create_item_with_http_info(item_request_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ItemsApi.create_item ...'\n end\n # verify the required parameter 'item_request_body' is set\n if @api_client.config.client_side_validation && item_request_body.nil?\n fail ArgumentError, \"Missing the required parameter 'item_request_body' when calling ItemsApi.create_item\"\n end\n # resource path\n local_var_path = '/items'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(item_request_body)\n\n # return_type\n return_type = opts[:debug_return_type] || 'SingleItem'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth', 'oAuth2ClientCredentials']\n\n new_options = opts.merge(\n :operation => :\"ItemsApi.create_item\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ItemsApi#create_item\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1c8a0f6a6cb7587ae90a733672cba294",
"score": "0.51504755",
"text": "def create\n @wanted_item = WantedItem.new(wanted_item_params)\n\n respond_to do |format|\n if @wanted_item.save\n format.html { redirect_to @wanted_item, notice: 'Wanted item was successfully created.' }\n format.json { render :show, status: :created, location: @wanted_item }\n else\n format.html { render :new }\n format.json { render json: @wanted_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08e7a94b85f765fcfb543a953903ccf8",
"score": "0.5150078",
"text": "def set_item\n super\n raise \"403\" unless @item.allowed?(:read, @cur_user, site: @cur_site)\n end",
"title": ""
},
{
"docid": "e6f2f53235c0bf4dd9b94a4bdfb6ebe5",
"score": "0.513172",
"text": "def drive_item()\n return MicrosoftGraph::Shares::Item::List::Items::Item::DriveItem::DriveItemRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "2135978ae99bbea02a9b8c4bd66be59d",
"score": "0.5127955",
"text": "def item;\n @item;\n end",
"title": ""
},
{
"docid": "c7b6f0f3fb2d57a3520ac29d62b2f04b",
"score": "0.5126215",
"text": "def set_my_item\n # binding.pry\n @item = MyItem.find_by_user_id(payload['user_id'])\n end",
"title": ""
},
{
"docid": "82e703cae77098479547516455d68eb7",
"score": "0.5120564",
"text": "def get_item(user, item)\r\n position = user.get_position(item)\r\n x = user.show_item(position)\r\n self.add_item(x)\r\n user.give_away_item(position)\r\n end",
"title": ""
},
{
"docid": "1ddb3bf2aa22677d5ee726bd4f35f638",
"score": "0.5118302",
"text": "def set_item\n @item = @user.items.find_by id: params[:id]\n end",
"title": ""
},
{
"docid": "1d3bec2301d9adde3786c25edee78202",
"score": "0.51150155",
"text": "def request_permitted?(item)\n true\n end",
"title": ""
},
{
"docid": "59d71eb030c3bffa135f686a28764342",
"score": "0.5114928",
"text": "def process_item(item)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b011040552f66e719b9e9745189c06c3",
"score": "0.51093733",
"text": "def update\n @item = @client.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17af04c02a0f66b56989467012ef9af8",
"score": "0.51077855",
"text": "def set_quote_request_item\n @quote_request_item = QuoteRequestItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "b36fb38afd57544f25b9801502ac89be",
"score": "0.5106889",
"text": "def post_response(status, item = nil, **opt)\n opt[:meth] ||= calling_method\n opt[:fallback] ||=\n if manifest_id\n manifest_item_index_path(manifest: manifest_id)\n else\n manifest_index_path\n end\n super\n end",
"title": ""
},
{
"docid": "b52b2f0a33ab9bc6d1377317ea2d98d4",
"score": "0.50919443",
"text": "def set_resume_item\n @resume_item = ResumeItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b413c7da7c3d2385018951a9f35b0d2",
"score": "0.50871605",
"text": "def update\n respond_to do |format|\n if @votable_item.update(votable_item_params)\n format.html { redirect_to @votable_item, notice: 'Votable item was successfully updated.' }\n format.json { render :show, status: :ok, location: @votable_item }\n else\n format.html { render :edit }\n format.json { render json: @votable_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32a0a4c16e94509996fc4b667d474c7c",
"score": "0.5086094",
"text": "def set_item(item_id)\n @kind = 2\n @item_id = item_id\n end",
"title": ""
},
{
"docid": "992511968b0520263e18788a978183e0",
"score": "0.507736",
"text": "def create\n @votable_item = VotableItem.new(votable_item_params)\n\n respond_to do |format|\n if @votable_item.save\n format.html { redirect_to @votable_item, notice: 'Votable item was successfully created.' }\n format.json { render :show, status: :created, location: @votable_item }\n else\n format.html { render :new }\n format.json { render json: @votable_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75d3a80dc963150890ea331829eb9d7e",
"score": "0.50722235",
"text": "def create\n @needed_item = NeededItem.new(needed_item_params)\n\n respond_to do |format|\n if @needed_item.save\n format.html { redirect_to @needed_item.apartment, notice: 'Needed item was successfully created.' }\n format.json { render :show, status: :created, location: @needed_item }\n else\n format.html { render :new }\n format.json { render json: @needed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "039a9b9957ca693c3d3cf1f697e777db",
"score": "0.50716037",
"text": "def found_item_params\n params.require(:found_item).permit(:name, :description, :pic_url)\n end",
"title": ""
},
{
"docid": "89dd04643637c167575a65f4ebc5709d",
"score": "0.50670177",
"text": "def item_params\n params.fetch(:item, {})\n end",
"title": ""
},
{
"docid": "89dd04643637c167575a65f4ebc5709d",
"score": "0.50670177",
"text": "def item_params\n params.fetch(:item, {})\n end",
"title": ""
},
{
"docid": "89dd04643637c167575a65f4ebc5709d",
"score": "0.50670177",
"text": "def item_params\n params.fetch(:item, {})\n end",
"title": ""
},
{
"docid": "89dd04643637c167575a65f4ebc5709d",
"score": "0.50670177",
"text": "def item_params\n params.fetch(:item, {})\n end",
"title": ""
},
{
"docid": "2347cf7d150e24382343d886aa079379",
"score": "0.5066641",
"text": "def build_custom_item_info_request(attrs={})\n\t\t CustomItemInfoRequest.new(attrs.merge({:udi_auth_token=>@udi_auth_token, :http_biz_id=>@http_biz_id}))\t\t \n\t\tend",
"title": ""
},
{
"docid": "75641933dd68ac688c9511c2d7a28c79",
"score": "0.50563645",
"text": "def show\n render json: @item, status: :ok\n end",
"title": ""
},
{
"docid": "6a10803c2f3b33bee9b00e46aa6d54ff",
"score": "0.5055506",
"text": "def create\n @item = @client.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully added.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fa42a9660916e6e445002f3ddbb9e57",
"score": "0.5054286",
"text": "def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "e480c85c708758c5930434d537a578e0",
"score": "0.50492656",
"text": "def confirm_exists_in_distribution_center_and_set_inventory_item\n id = params[:id]\n distribution_center_id = params[:distribution_center_id]\n @inventory_item = Inventory.where({id: id,distribution_center_id: distribution_center_id}).first\n if @inventory_item.nil?\n return render status: 404, json: { message: \"Inventory item with id '#{id}' from distribution center '#{distribution_center_id}' not found.\" }.to_json\n end\n end",
"title": ""
},
{
"docid": "581cdf326b347120934b84b9bf97e22c",
"score": "0.50470155",
"text": "def update\n respond_to do |format|\n if @found_item.update(found_item_params)\n format.html { redirect_to @found_item, notice: 'Found item was successfully updated.' }\n format.json { render :show, status: :ok, location: @found_item }\n else\n format.html { render :edit }\n format.json { render json: @found_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "581cdf326b347120934b84b9bf97e22c",
"score": "0.50459623",
"text": "def update\n respond_to do |format|\n if @found_item.update(found_item_params)\n format.html { redirect_to @found_item, notice: 'Found item was successfully updated.' }\n format.json { render :show, status: :ok, location: @found_item }\n else\n format.html { render :edit }\n format.json { render json: @found_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9976eb788a077dfbb4f272426fe6a2e",
"score": "0.5041641",
"text": "def get_items(response, item_page)\n items = []\n response = response.to_h\n if response.key?('ItemSearchResponse') &&\n response['ItemSearchResponse'].key?('Items') &&\n response['ItemSearchResponse']['Items'].key?('Item')\n response['ItemSearchResponse']['Items']['Item'].each_with_index do |item, pos|\n items << { position: (item_page - 1) * ITEMS_PER_PAGE + pos + 1, data: item }\n end\n end\n items\n end",
"title": ""
},
{
"docid": "13c1f0a3144ed944264e30da436d6095",
"score": "0.5037684",
"text": "def find_and_authorize_requested_item\n name = controller_name.singularize\n privilege = Seek::Permissions::Translator.translate(action_name)\n\n return if privilege.nil?\n\n object = controller_model.find(params[:id])\n\n if is_auth?(object, privilege)\n instance_variable_set(\"@#{name}\", object)\n params.delete :policy_attributes unless object.can_manage?(current_user)\n else\n respond_to do |format|\n format.html do\n case privilege\n when :publish, :manage, :edit, :download, :delete\n if current_user.nil?\n flash[:error] = \"You are not authorized to #{privilege} this #{name.humanize}, you may need to login first.\"\n else\n flash[:error] = \"You are not authorized to #{privilege} this #{name.humanize}.\"\n end\n handle_authorization_failure_redirect(object, privilege)\n else\n render template: 'general/landing_page_for_hidden_item', locals: { item: object }, status: :forbidden\n end\n end\n format.rdf { render plain: \"You may not #{privilege} #{name}:#{params[:id]}\", status: :forbidden }\n format.json { render json: { errors: [{ title: 'Forbidden',\n details: \"You may not #{privilege} #{name}:#{params[:id]}\" }] },\n status: :forbidden }\n end\n return false\n end\n end",
"title": ""
},
{
"docid": "7017ba50eadc0cfbd8cc7a2571977181",
"score": "0.50334626",
"text": "def set_item\n @item = current_user.items.find(params[:id])\n end",
"title": ""
},
{
"docid": "c527b29f218d57d76a763de8778c5717",
"score": "0.5033046",
"text": "def show\n @inventory_item = InventoryItem.find(params[:id])\n \n authorize! :read, @inventory_item\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventory_item }\n end\n end",
"title": ""
},
{
"docid": "70f8da10221cb6191795717ff66fcda7",
"score": "0.5028009",
"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": ""
}
] |
25146a3b4100f6472e7f265838e77729
|
Can be empty, otherwise something like "Android6.3" or just "Android"
|
[
{
"docid": "7187d04327aca7308e056fd393ca4660",
"score": "0.611588",
"text": "def os\n [\n device_detector.os_name,\n device_detector.os_full_version&.split(\".\")&.slice(0,2)&.join(\".\")\n ].compact.join(\"-\")\n end",
"title": ""
}
] |
[
{
"docid": "f195b01f910c7969dab1d880606068e2",
"score": "0.68413305",
"text": "def name\n 'Android'\n end",
"title": ""
},
{
"docid": "0cbf74d77d2a3740dbf8754244ead4c2",
"score": "0.6797195",
"text": "def minos_string; end",
"title": ""
},
{
"docid": "e54abdf32f5ad6c2910d6c80abae6a2d",
"score": "0.6773464",
"text": "def android_device_type\n case request.user_agent\n when /(LogicPD\\sZoom2)/\n t('device.android.nook')\n when /(Nexus\\s7)/\n t('device.android.nexus7')\n else\n t('device.android.android_device')\n end\n end",
"title": ""
},
{
"docid": "54698489449169c55d86026339087ab7",
"score": "0.6475494",
"text": "def os_name\n os_version_number = version.to_f\n\n case os_version_number\n when 1.5 then 'Cupcake'\n when 1.6 then 'Donut'\n when 2.0..2.1 then 'Eclair'\n when 2.2 then 'Froyo'\n when 2.3 then 'Gingerbread'\n when 3.0..3.2 then 'Honeycomb'\n when 4.0 then 'Ice Cream Sandwich'\n when 4.1..4.3 then 'Jelly Bean'\n when 4.4 then 'KitKat'\n when 5.0..5.1 then 'Lollipop'\n when 6.0 then 'Marshmallow'\n when 7.0..7.1 then 'Nougat'\n when 8.0..8.1 then 'Oreo'\n else 'Unknown'\n end\n end",
"title": ""
},
{
"docid": "653e1d644619121d9fa73910fc90070d",
"score": "0.639307",
"text": "def find_os_version(ua_str, os_sym)\n\n if os_sym == :Android\n if index = ua_str.index(/(Android \\d\\.)/)\n index += 8\n length = (ua_str.index(/\\d\\;/, index) - index) +1\n ua_str[index, length] || \"N/A\"\n elsif index = ua_str.index(/(Android)(.+)(Firefox)/)\n \"non rilavata, Firefox per Android\"\n else\n \"non rilevata\"\n end\n elsif os_sym == :iOS\n if index = ua_str.index(/(\\d_)/)\n length = (ua_str.index(/\\_\\d\\s/, index) - index) +2\n ua_str[index, length] || \"N/A\"\n else\n \"non rilevata\"\n end\n else\n \"non gestita\"\n end\n end",
"title": ""
},
{
"docid": "4ce30f49dffbb0cb4f612ba45b81aa94",
"score": "0.63596755",
"text": "def os\n if (application && os_string = application.comment.detect { |c| ANDROID_REGEX.match?(c) || IOS_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n elsif matches = IOS_VERSION_REGEX.match(to_s)\n [IOS, matches[:version]].compact.join(' ') unless matches[:version].nil?\n end\n end",
"title": ""
},
{
"docid": "81362731f78401e12e155187f00b74e6",
"score": "0.63290197",
"text": "def os\n if application && pos = application.comment[0] =~ ANDROID_REGEX\n return OperatingSystems.normalize_os(application.comment[0][pos..-1].split()[0..1].join(' '))\n end\n\n ua = self.to_s\n if pos = ua =~ ANDROID_REGEX\n OperatingSystems.normalize_os(ua[pos..-1].split()[0..1].join(' '))\n end\n end",
"title": ""
},
{
"docid": "b6f469aafe1edd51a97652429659629f",
"score": "0.6277998",
"text": "def application\n [\n device_detector.name,\n device_detector.full_version&.split(\".\")&.first&.presence\n ].compact.join(\"-\")\n end",
"title": ""
},
{
"docid": "db481c96a72138b4b60e666cccb6448d",
"score": "0.6258832",
"text": "def full_os\n if application && application.comment && application.comment.length > 1\n full_os = application.comment[1]\n\n full_os = \"#{full_os})\" if full_os =~ /\\(Build [0-9][0-9][0-9][0-9]\\z/ # The regex chops the ) off :(\n\n full_os\n end\n end",
"title": ""
},
{
"docid": "5475c3ead70464680a71a726f991a606",
"score": "0.6205386",
"text": "def test_ultimate_device_detect_bi_android\n build_info = {\n 'ro.build.PDA' => 'I9500XXUFNE7',\n 'ro.build.changelist' => '699287',\n 'ro.build.characteristics' => 'phone',\n 'ro.build.date.utc' => '1401287026',\n 'ro.build.date' => 'Wed May 28 23:23:46 KST 2014',\n 'ro.build.description' => 'ja3gxx-user 4.4.2 KOT49H I9500XXUFNE7 release-keys',\n 'ro.build.display.id' => 'KOT49H.I9500XXUFNE7',\n 'ro.build.fingerprint' => 'samsung/ja3gxx/ja3g:4.4.2/KOT49H/I9500XXUFNE7:user/release-keys',\n 'ro.build.hidden_ver' => 'I9500XXUFNE7',\n 'ro.build.host' => 'SWDD5723',\n 'ro.build.id' => 'KOT49H',\n 'ro.build.product' => 'ja3g',\n 'ro.build.tags' => 'release-keys',\n 'ro.build.type' => 'user',\n 'ro.build.user' => 'dpi',\n 'ro.build.version.codename' => 'REL',\n 'ro.build.version.incremental' => 'I9500XXUFNE7',\n 'ro.build.version.release' => '4.4.2',\n 'ro.build.version.sdk' => '19',\n 'ro.product.board' => 'universal5410',\n 'ro.product.brand' => 'samsung',\n 'ro.product.cpu.abi2' => 'armeabi',\n 'ro.product.cpu.abi' => 'armeabi-v7a',\n 'ro.product.device' => 'ja3g',\n 'ro.product.locale.language' => 'en',\n 'ro.product.locale.region' => 'GB',\n 'ro.product.manufacturer' => 'samsung',\n 'ro.product.model' => 'GT-I9500',\n 'ro.product.name' => 'ja3gxx',\n 'ro.product_ship' => 'true'\n }\n\n @hd.device_detect(build_info)\n reply = @hd.get_reply\n\n assert_equal 'Samsung', reply['hd_specs']['general_vendor']\n assert_equal 'GT-I9500', reply['hd_specs']['general_model']\n assert_equal 'Android', reply['hd_specs']['general_platform']\n assert_equal '4.4.2', reply['hd_specs']['general_platform_version']\n assert_equal 'Samsung Galaxy S4', reply['hd_specs']['general_aliases'][0]\n assert_equal 'Mobile', reply['hd_specs']['general_type']\n end",
"title": ""
},
{
"docid": "be552e27e362904651de1913336e96ff",
"score": "0.61613125",
"text": "def os\n full_os = self.full_os\n\n if application && application.comment[0] =~ /Windows/\n if full_os =~ /Windows 8\\.1/\n \"Windows 8.1\"\n elsif full_os =~ /Windows 8/\n \"Windows 8\"\n elsif full_os =~ /Windows 7/\n \"Windows 7\"\n elsif full_os =~ /Windows Vista/\n \"Windows Vista\"\n elsif full_os =~ /Windows XP/\n \"Windows XP\"\n else\n \"Windows\"\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "635825cbcd71c803c8f842fa52691f9f",
"score": "0.6125774",
"text": "def platform\n if os.include?('PLAYSTATION 3')\n 'PlayStation 3'\n elsif os.include?('PlayStation 4')\n 'PlayStation 4'\n elsif os.include?('PlayStation Vita')\n 'PlayStation Vita'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "d354fb3496c2b0bb7f05ae95c79c50c7",
"score": "0.6125278",
"text": "def platform?; \"ubuntu\"; end",
"title": ""
},
{
"docid": "8d16aa20183c835803c4a81b37f56450",
"score": "0.61175203",
"text": "def test_ultimate_community_device_detect_bi_android\n build_info = {\n 'ro.build.PDA' => 'I9500XXUFNE7',\n 'ro.build.changelist' => '699287',\n 'ro.build.characteristics' => 'phone',\n 'ro.build.date.utc' => '1401287026',\n 'ro.build.date' => 'Wed May 28 23:23:46 KST 2014',\n 'ro.build.description' => 'ja3gxx-user 4.4.2 KOT49H I9500XXUFNE7 release-keys',\n 'ro.build.display.id' => 'KOT49H.I9500XXUFNE7',\n 'ro.build.fingerprint' => 'samsung/ja3gxx/ja3g:4.4.2/KOT49H/I9500XXUFNE7:user/release-keys',\n 'ro.build.hidden_ver' => 'I9500XXUFNE7',\n 'ro.build.host' => 'SWDD5723',\n 'ro.build.id' => 'KOT49H',\n 'ro.build.product' => 'ja3g',\n 'ro.build.tags' => 'release-keys',\n 'ro.build.type' => 'user',\n 'ro.build.user' => 'dpi',\n 'ro.build.version.codename' => 'REL',\n 'ro.build.version.incremental' => 'I9500XXUFNE7',\n 'ro.build.version.release' => '4.4.2',\n 'ro.build.version.sdk' => '19',\n 'ro.product.board' => 'universal5410',\n 'ro.product.brand' => 'samsung',\n 'ro.product.cpu.abi2' => 'armeabi',\n 'ro.product.cpu.abi' => 'armeabi-v7a',\n 'ro.product.device' => 'ja3g',\n 'ro.product.locale.language' => 'en',\n 'ro.product.locale.region' => 'GB',\n 'ro.product.manufacturer' => 'samsung',\n 'ro.product.model' => 'GT-I9500',\n 'ro.product.name' => 'ja3gxx',\n 'ro.product_ship' => 'true'\n }\n\n @hd.device_detect(build_info)\n reply = @hd.get_reply\n\n assert_equal 'Samsung', reply['hd_specs']['general_vendor']\n assert_equal 'GT-I9500', reply['hd_specs']['general_model']\n assert_equal 'Android', reply['hd_specs']['general_platform']\n assert_equal '', reply['hd_specs']['general_type']\n end",
"title": ""
},
{
"docid": "c39a08dd542de475e958a34d45cbaf8a",
"score": "0.6105473",
"text": "def device_suffix\n browser.device.mobile? ? \"mobile\" : \"desktop\"\n end",
"title": ""
},
{
"docid": "60ae388c047e143c202d25eeb595d06d",
"score": "0.6096277",
"text": "def android_type_of(node = @current_node)\n\t\tstr = node.to_s\n\t\tif str.include? ' ' then\n\t\t\tstr = str.split(' ')[0];\n\t\t\tstr.delete! '<'\n\t\t\tstr.delete! \" \"\n\t\t\t\n\t\t\treturn str;\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c5b93686077a7515ac999c0d6c907e2b",
"score": "0.6088976",
"text": "def full_name\n if platform == Gem::Platform::RUBY || platform.nil?\n \"#{@name}-#{@version}\"\n else\n \"#{@name}-#{@version}-#{platform}\"\n end \n end",
"title": ""
},
{
"docid": "ba935442f0cc658df535a4ea5fd9c849",
"score": "0.60693246",
"text": "def package_name\n case arch\n when 'any', 'all', nil\n \"#{name}-#{version}\"\n else\n \"#{name}-#{version}-#{arch}\"\n end\n end",
"title": ""
},
{
"docid": "acfb801fbe2767555c69f524f264c959",
"score": "0.6040356",
"text": "def with_version_number\n name, version, extra = self.split('-', 3)\n PLATFORM_VERSION_CODES.each_key do |platform|\n if name =~ /#{platform}/\n PLATFORM_VERSION_CODES[platform].each do |version_codename, version_number|\n if version =~ /#{version_codename}/\n version = version_number\n break\n end\n end\n break\n end\n end\n [name, version, extra].join('-')\n end",
"title": ""
},
{
"docid": "95dc9cf97cbfbe0f29870fb7f317901d",
"score": "0.6040266",
"text": "def gsproduct\n version.to_i > 4 ? \"L#{version}\" : \"L#{sensor}#{version}\"\n end",
"title": ""
},
{
"docid": "ead7a2966de2f8f5b203e2b673140c20",
"score": "0.60396016",
"text": "def version_name\n version ? \"=\" + version : \"UNNEEDED\"\n end",
"title": ""
},
{
"docid": "209b8381a915bb5e4739e1bd71c1fac8",
"score": "0.60292053",
"text": "def os\n return unless application\n\n if application.comment[2].nil?\n OperatingSystems.normalize_os(application.comment[1])\n elsif ANDROID_REGEX.match?(application.comment[1])\n OperatingSystems.normalize_os(application.comment[1])\n else\n OperatingSystems.normalize_os(application.comment[2])\n end\n end",
"title": ""
},
{
"docid": "209b8381a915bb5e4739e1bd71c1fac8",
"score": "0.60292053",
"text": "def os\n return unless application\n\n if application.comment[2].nil?\n OperatingSystems.normalize_os(application.comment[1])\n elsif ANDROID_REGEX.match?(application.comment[1])\n OperatingSystems.normalize_os(application.comment[1])\n else\n OperatingSystems.normalize_os(application.comment[2])\n end\n end",
"title": ""
},
{
"docid": "9801833eb6b4255a4e83a251c93350f3",
"score": "0.60281867",
"text": "def name\n if @name =~ /[A-Z]/\n logger.warn(\"apk packages should not have uppercase characters in their names\")\n @name = @name.downcase\n end\n\n if @name.include?(\"_\")\n logger.warn(\"apk packages should not include underscores\")\n @name = @name.gsub(/[_]/, \"-\")\n end\n\n if @name.include?(\" \")\n logger.warn(\"apk packages should not contain spaces\")\n @name = @name.gsub(/[ ]/, \"-\")\n end\n\n return @name\n end",
"title": ""
},
{
"docid": "ca41b1b35baa168212bd65ddb1cf9ba4",
"score": "0.60179484",
"text": "def full_version_string; end",
"title": ""
},
{
"docid": "54b17b97f7ea904bf5d501c1f35d362d",
"score": "0.6000825",
"text": "def platform\n return self.class.name.split(/::/)[-1].downcase\n end",
"title": ""
},
{
"docid": "6831f743f36c8414aed524b35ad35fbb",
"score": "0.59988433",
"text": "def android_app?\n android? && ua =~ /\\bwv\\b/\n end",
"title": ""
},
{
"docid": "df7726b504456717b82a0997ff5a751c",
"score": "0.5979211",
"text": "def platform_type_to_s(platform_type)\n if platform_type == \"1\"\n I18n.t(\"website\", default: \"Website\")\n elsif platform_type == \"2\"\n I18n.t(\"mobile\", default: \"Mobile\")\n elsif platform_type == \"3\"\n I18n.t(\"tv\", default: \"TV\")\n elsif platform_type == \"4\"\n I18n.t(\"prints\", default: \"Prints\")\n else\n I18n.t(\"others\", default: \"Others\")\n end\n end",
"title": ""
},
{
"docid": "d0f53729a0d15cc9bf402bdff934355c",
"score": "0.5974489",
"text": "def test_ultimate_device_detect_bi_android_default_os\n build_info = {\n 'ro.product.brand' => 'samsung',\n 'ro.product.model' => 'GT-I9500',\n }\n\n result = @hd.device_detect build_info\n reply = @hd.get_reply\n\n assert result\n assert_equal 'Samsung', reply['hd_specs']['general_vendor']\n assert_equal 'GT-I9500', reply['hd_specs']['general_model']\n assert_equal 'Android', reply['hd_specs']['general_platform']\n assert_equal '4.2.2', reply['hd_specs']['general_platform_version']\n assert_equal 'Samsung Galaxy S4', reply['hd_specs']['general_aliases'][0]\n assert_equal 'Mobile', reply['hd_specs']['general_type']\n end",
"title": ""
},
{
"docid": "b9a416b0b7678d739eaafed17f3df640",
"score": "0.5963423",
"text": "def with_version_codename\n name, version, extra = self.split('-', 3)\n PLATFORM_VERSION_CODES.each_key do |platform|\n if name =~ /#{platform}/\n PLATFORM_VERSION_CODES[platform].each do |version_codename, version_number|\n #remove '.' from version number\n if version.delete('.') =~ /#{version_number}/\n version = version_codename\n break\n end\n end\n break\n end\n end\n [name, version, extra].join('-')\n end",
"title": ""
},
{
"docid": "bde6754dfef3f241096db79e5b118ad7",
"score": "0.5951931",
"text": "def os\n # WMP 6.4\n if classic?\n case version.to_a[3]\n when 3564, 3925 then \"Windows 98\"\n when 3857 then \"Windows 9x\"\n when 3936 then \"Windows XP\"\n when 3938 then \"Windows 2000\"\n else \"Windows\"\n end\n\n # WMP 7/7.1\n elsif version.to_a[0] == 7\n case version.to_a[3]\n when 3055 then \"Windows 98\"\n else \"Windows\"\n end\n\n # WMP 8 was also known as \"Windows Media Player for Windows XP\"\n elsif version.to_a[0] == 8\n \"Windows XP\"\n\n # WMP 9/10\n elsif version.to_a[0] == 9 || version.to_a[0] == 10\n case version.to_a[3]\n when 2980 then \"Windows 98/2000\"\n when 3268, 3367, 3270 then \"Windows 2000\"\n when 3802, 4503 then \"Windows XP\"\n else \"Windows\"\n end\n\n # WMP 11/12\n elsif version.to_a[0] == 11 || version.to_a[0] == 12\n case version.to_a[2]\n when 9841, 9858, 9860,\n 9879 then \"Windows 10\"\n when 9651 then \"Windows Phone 8.1\"\n when 9600 then \"Windows 8.1\"\n when 9200 then \"Windows 8\"\n when 7600, 7601 then \"Windows 7\"\n when 6000, 6001, 6002 then \"Windows Vista\"\n when 5721 then \"Windows XP\"\n else \"Windows\"\n end\n else\n \"Windows\"\n end\n end",
"title": ""
},
{
"docid": "2f5888c0c1c5625033b4e78a88b7b7d7",
"score": "0.5948027",
"text": "def name\n return \"INVALID_PLATFORM\"\n end",
"title": ""
},
{
"docid": "99a0f7ebd8ff9a5ca363f197a82a8b57",
"score": "0.5936635",
"text": "def determine_platform\n if platform.blank?\n (self.operating_systems.pluck(:name) + self.operating_systems.pluck(:arch)).join(\" \")\n end\n end",
"title": ""
},
{
"docid": "49fb77ac820d45332ff6b611a48bf93e",
"score": "0.5931523",
"text": "def to_s; \"ver #{full}\" end",
"title": ""
},
{
"docid": "4d9dea6e2b849aecc96738591a66de85",
"score": "0.58844966",
"text": "def package_name(options={})\n if platform = options[:platform]\n \"#{name}-#{version}-#{platform}\"\n else\n \"#{name}-#{version}\"\n end\n end",
"title": ""
},
{
"docid": "212e75c0f9440be6c8c0d706cb015f06",
"score": "0.5884424",
"text": "def device_type\n ua = request.user_agent\n o = if ua =~ /GoogleTV|SmartTV|Internet.TV|NetCast|NETTV|AppleTV|boxee|Kylo|Roku|DLNADOC|CE\\-HTML/i\n 'tv'\n # tv-based gaming console\n elsif ua =~/Xbox|PLAYSTATION.3|Wii/i\n 'tv'\n # tablet\n elsif ua =~ /iPad/i || ua =~ /tablet/i && !(ua =~ /RX-34/i) || ua =~ /FOLIO/i \n 'tablet'\n #android tablet\n elsif ua =~ /Linux/i && ua =~ /Android/i && !(ua =~ /Fennec|mobi|HTC.Magic|HTCX06HT|Nexus.One|SC-02B|fone.945/i)\n 'tablet'\n #Kindle or Kindle Fire\n elsif ua =~ /Kindle/i || ua =~ /Mac.OS/i && ua =~ /Silk/i\n 'tablet'\n #pre Android 3.0 Tablet\n elsif ua =~ /GT-P10|SC-01C|SHW-M180S|SGH-T849|SCH-I800|SHW-M180L|SPH-P100|SGH-I987|zt180|HTC(.Flyer|\\_Flyer)|Sprint.ATP51|ViewPad7|pandigital(sprnova|nova)|Ideos.S7|Dell.Streak.7|Advent.Vega|A101IT|A70BHT|MID7015|Next2|nook/i || ua =~ /MB511/i && ua =~ /RUTEM/i\n 'tablet'\n #unique Mobile User Agent\n elsif ua =~ /BOLT|Fennec|Iris|Maemo|Minimo|Mobi|mowser|NetFront|Novarra|Prism|RX-34|Skyfire|Tear|XV6875|XV6975|Google.Wireless.Transcoder/i\n 'mobile'\n #odd Opera User Agent - http://goo.gl/nK90K\n elsif ua =~ /Opera/i && ua =~ /Windows.NT.5/i && ua =~ /HTC|Xda|Mini|Vario|SAMSUNG\\-GT\\-i8000|SAMSUNG\\-SGH\\-i9/i\n 'mobile'\n #Windows Desktop\n elsif ua =~ /Windows.(NT|XP|ME|9)/ && !(ua =~ /Phone/i) || ua =~ /Win(9|.9|NT)/i\n 'desktop'\n #Mac Desktop\n elsif ua =~ /Macintosh|PowerPC/i && !(ua =~ /Silk/i)\n 'desktop'\n #Linux Desktop\n elsif ua =~ /Linux/i && ua =~ /X11/i\n 'desktop'\n #Solaris, SunOS, BSD Desktop\n elsif ua =~ /Solaris|SunOS|BSD/i\n 'desktop'\n #Desktop BOT/Crawler/Spider\n elsif ua =~ /Bot|Crawler|Spider|Yahoo|ia_archiver|Covario-IDS|findlinks|DataparkSearch|larbin|Mediapartners-Google|NG-Search|Snappy|Teoma|Jeeves|TinEye/i && !(ua =~ /Mobile/i)\n 'desktop'\n #assume it is a Mobile Device (mobile-first)\n else\n \"mobile\"\n end\n o\n end",
"title": ""
},
{
"docid": "14923bd8bd4d54414da60d666ca3a469",
"score": "0.5876963",
"text": "def os\n app = app_with_comments\n return if app.nil?\n\n if (os_string = app.comment.detect { |c| ANDROID_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n end\n end",
"title": ""
},
{
"docid": "43f8049cf3b118216013a2037cabd8b3",
"score": "0.58670306",
"text": "def full_version\n _, v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default]))\n v || \"0.0\"\n end",
"title": ""
},
{
"docid": "1bac7653d99520b6ae73a111fb8ecb99",
"score": "0.58565664",
"text": "def package_name(project)\n # If nothing is passed in as platform type, default to building a swix package\n if project.platform.package_type.nil? || project.platform.package_type.empty?\n return swix_package_name(project)\n else\n case project.platform.package_type\n when \"rpm\"\n return super(project)\n when \"swix\"\n return swix_package_name(project)\n else\n fail \"I don't know how to name package type '#{project.platform.package_type}' for EOS. Teach me?\"\n end\n end\n end",
"title": ""
},
{
"docid": "08a65aa1f9314a86d355bbfee8abafa2",
"score": "0.5841324",
"text": "def oldest_supported\n # account for bionic/rhel8 not having build before certain versions\n if is_el9\n '7.13.2'\n elsif is_bullseye\n '7.9.0'\n elsif is_jammy\n '7.13.2'\n else\n '7.3.1'\n end\n end",
"title": ""
},
{
"docid": "d543686539e6aea97e014833ea59a126",
"score": "0.58367205",
"text": "def platform\n \"hardware\"\n end",
"title": ""
},
{
"docid": "ee7220d402dc5b52c243e754ebc88aca",
"score": "0.58045226",
"text": "def test_ultimate_device_detect_bi_android_updated_os\n build_info = {\n 'ro.build.id' => 'KOT49H',\n 'ro.build.version.release' => '5.2',\n 'ro.build.version.sdk' => '19',\n 'ro.product.brand' => 'samsung',\n 'ro.product.model' => 'GT-I9500',\n }\n\n result = @hd.device_detect build_info\n reply = @hd.get_reply\n\n assert result\n assert_equal 'Samsung', reply['hd_specs']['general_vendor']\n assert_equal 'GT-I9500', reply['hd_specs']['general_model']\n assert_equal 'Android', reply['hd_specs']['general_platform']\n assert_equal '5.2', reply['hd_specs']['general_platform_version']\n assert_equal 'Samsung Galaxy S4', reply['hd_specs']['general_aliases'][0]\n assert_equal 'Mobile', reply['hd_specs']['general_type']\n end",
"title": ""
},
{
"docid": "0d2eb5dc516d43ecbba8fb9f6f831b99",
"score": "0.58038443",
"text": "def os\n app = app_with_comments\n if app\n os_string = [app.comment[1], app.comment[2]].compact.detect { |c| c.start_with?(ANDROID) }\n return os_string if os_string\n end\n\n app = detect_product(DARWIN)\n return [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app\n\n case platform\n when ANDROID then ANDROID\n when IOS then IOS\n end\n end",
"title": ""
},
{
"docid": "01401ceec5f4a5a415b87e4139c651c6",
"score": "0.57921755",
"text": "def user_agent_tag\n [client_os.to_s, client_browser.to_s, client_browser_version.to_s].join(' ')\n end",
"title": ""
},
{
"docid": "bd460723a3e4a8eff058997eef139048",
"score": "0.5786515",
"text": "def get_platform_name()\n\treturn \" -DBENTO_PLATFORM_NAME=\" + $platform_name\nend",
"title": ""
},
{
"docid": "4be128c14313eec9161d0f7e12c8c60f",
"score": "0.578238",
"text": "def to_s; \"Android:#{self.serial}\" end",
"title": ""
},
{
"docid": "c062d27139c315f8956c3b8c4abc35d5",
"score": "0.577051",
"text": "def categorize_os( user_agent )\n os = get_smart_device_spec( user_agent )[:os]\n os.nil? ? 'unknown' : os\n end",
"title": ""
},
{
"docid": "3b0e64207e345e5bc8915d196a6deb46",
"score": "0.5767497",
"text": "def mobile_os_minimum_version\n return @mobile_os_minimum_version\n end",
"title": ""
},
{
"docid": "173029b98658ee03876c6c28572c79c1",
"score": "0.576475",
"text": "def os_name\n os_name = system(\"lsb_release -irs\")\n os_name ||= if File.readable?('/etc/system-release')\n File.read('/etc/system-release')\n end\n os_name ||= if File.readable?('/etc/debian_version')\n debian_version = File.read('/etc/debian_version')\n \"Debian #{debian_version}\"\n end\n os_name ||= if File.readable?('/etc/SuSE-release')\n File.read('/etc/SuSE-release')\n end\n os_name ||= if os_x_version = `sw_vers -productVersion`\n \"Mac OS X #{os_x_version}\"\n end\n os_name ||= if File.readable?('/etc/os-release')\n File.read('/etc/os-release').match(/PRETTY_NAME=\\\"(.+)\\\"/)[1]\n end\n os_name.try(:squish!)\nend",
"title": ""
},
{
"docid": "474d46672c4deddde4724a3c7b98d0e0",
"score": "0.5753084",
"text": "def version\n str = if detect_product(\"CriOs\")\n crios.version\n else\n chrome.version\n end\n\n Version.new(str) if str\n end",
"title": ""
},
{
"docid": "5dc127fa7cc6c63693051d6a026764f9",
"score": "0.5747323",
"text": "def full_version\n _, *v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default]))\n v.compact.first || \"0.0\"\n end",
"title": ""
},
{
"docid": "698dd16b680d1638fdbd8752fa9b38c3",
"score": "0.57388014",
"text": "def abbreviate_platform(arch)\n plat = Gem::Platform.new(arch)\n cpu, os, _ = plat.to_a\n o, c = os[0..0], cpu[0..0] rescue \"?\"\n\n c = \"i\" if c == \"x\"\n x = \"6\" if cpu =~ /64/\n\n \"#{o}#{c}#{x}\"\nend",
"title": ""
},
{
"docid": "d89e8e3d882000ddb91b3f2ccbfb5b6c",
"score": "0.5738642",
"text": "def os\n app = app_with_comments\n return if app.nil?\n\n if (os_string = app.comment.detect { |c| ANDROID_REGEX.match?(c) || IOS_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n end\n end",
"title": ""
},
{
"docid": "e1e75d6f842f90d55373528df06052a9",
"score": "0.5733998",
"text": "def version_string; end",
"title": ""
},
{
"docid": "e1e75d6f842f90d55373528df06052a9",
"score": "0.5733998",
"text": "def version_string; end",
"title": ""
},
{
"docid": "c07a0e0c39f9bbf02d0bb1383cfb1cda",
"score": "0.5733476",
"text": "def http_get_os(headers)\n # extract the user-agent\n user_agent = headers[:user_agent]\n\n return 'unknown', '' if user_agent.nil?\n\n trace :debug, \"[#{@request[:peer]}] User Agent: #{user_agent}\"\n \n # return the correct type and extension\n return 'osx', '.app' if user_agent['MacOS'] or user_agent['Macintosh']\n return 'ios', '.ipa' if user_agent['iPhone'] or user_agent['iPad'] or user_agent['iPod']\n return 'winmo', '.cab' if user_agent['Windows CE']\n # windows must be after winmo\n return 'windows', '.exe' if user_agent['Windows']\n\n if user_agent['BlackBerry'] \n major = 4\n minor = 5\n ver_tuple = user_agent.scan(/\\/(\\d+)\\.(\\d+)\\.\\d+/).flatten\n major, minor = ver_tuple unless ver_tuple.empty?\n if major.to_i >= 5\n version = \"5.0\"\n else\n version = \"4.5\"\n end\n \n trace :debug, \"[#{@request[:peer]}] Blackberry version: #{version} -- #{major},#{minor}\"\n return 'blackberry', \"_\" + version + '.jad'\n end\n \n if user_agent['Android']\n major = 4\n minor = 0\n ver_tuple = user_agent.scan(/Android (\\d+)\\.(\\d+)/).flatten\n major, minor = ver_tuple unless ver_tuple.empty?\n if major.to_i == 2\n version = 'v2'\n else\n version = 'default'\n end\n\n trace :debug, \"[#{@request[:peer]}] Android version: #{version} -- #{major},#{minor}\"\n return 'android', \".\" + version + '.apk'\n end\n \n # linux must be after android\n return 'linux', '.bin' if user_agent['Linux'] or user_agent['X11']\n return 'symbian', '.sisx' if user_agent['Symbian']\n\n # special case for cydia requests\n return 'cydia', '.deb' if user_agent['Telesphoreo']\n\n return 'unknown', ''\n end",
"title": ""
},
{
"docid": "177b350fe31e5cc0b0586df3613ac00b",
"score": "0.5728373",
"text": "def version\n if application && application.version\n version = application.version.to_s\n return version.index('/') ? version.split('/')[-1] : application.version\n end\n\n ua = self.to_s\n if pos = ua =~ NEXPLAYER_REGEX\n ua[pos..-1].split()[1]\n elsif pos = ua =~ LG_PLAYER_REGEX\n ua[pos..-1].split()[2]\n end\n end",
"title": ""
},
{
"docid": "e1b3f95b831567d2afd95ef509541742",
"score": "0.5718093",
"text": "def wordy\n \"Found %s (%s), but was for platform%s %s\" %\n [@name,\n @version,\n @platforms.size == 1 ? '' : 's',\n @platforms.join(' ,')]\n end",
"title": ""
},
{
"docid": "65e0fcd5944ec77ec1b82b89af0dba66",
"score": "0.57138723",
"text": "def get_os\n\t\tresult = \"\"\n\t\tos = RbConfig::CONFIG['host_os']\n\t\tif os.downcase.include?('linux')\n \t\t\tresult = 'linux'\n\t\telsif os.downcase.include?('darwin')\n \t\t\tresult = 'darwin'\n \t\tend\n \t\treturn result\n \tend",
"title": ""
},
{
"docid": "12ddc204933da89279c950f7f487c330",
"score": "0.5707389",
"text": "def os\n app = app_with_comments\n return if app.nil? || app.product == POCKETCASTS\n\n if WINDOWS_NT_REGEX.match?(app.comment[0])\n OperatingSystems.normalize_os(app.comment[0])\n elsif app.comment[2].nil?\n OperatingSystems.normalize_os(app.comment[1])\n elsif ANDROID_REGEX.match?(app.comment[1])\n OperatingSystems.normalize_os(app.comment[1])\n elsif (os_string = app.comment.detect { |c| OperatingSystems::IOS_VERSION_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n end\n end",
"title": ""
},
{
"docid": "a0441663e135ef678decc84cd3574fef",
"score": "0.5697961",
"text": "def os\n app = reject { |agent| agent.comment.nil? || agent.comment.empty? }.first\n return if app.nil?\n\n if WINDOWS_NT_REGEX.match?(app.comment[0])\n OperatingSystems.normalize_os(app.comment[0])\n elsif app.comment[2].nil?\n OperatingSystems.normalize_os(app.comment[1])\n elsif ANDROID_REGEX.match?(app.comment[1])\n OperatingSystems.normalize_os(app.comment[1])\n elsif (os_string = app.comment.detect { |c| OperatingSystems::IOS_VERSION_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n end\n end",
"title": ""
},
{
"docid": "f552bddbcf336b3f93e35d01fadc6567",
"score": "0.5697203",
"text": "def _platform_type\n case node[\"platform_family\"]\n when /rhel/, /fedora/, /suse/\n \"redhat\"\n else\n node[\"platform_family\"]\n end.to_s\nend",
"title": ""
},
{
"docid": "5ad4d0c262c633d2a302358f523d38e3",
"score": "0.5687524",
"text": "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\n\t\t\tend",
"title": ""
},
{
"docid": "eb14827a832bd15af557386fade33267",
"score": "0.5685612",
"text": "def http_get_os(headers)\n # extract the user-agent\n user_agent = headers[:user_agent]\n\n return 'unknown', '' if user_agent.nil?\n\n trace :debug, \"[#{@request[:peer]}] UA #{user_agent}\"\n\t\t \n # return the correct type and extension\n return 'osx', '.app' if user_agent['MacOS'] or user_agent['Macintosh']\n return 'ios', '.ipa' if user_agent['iPhone'] or user_agent['iPad'] or user_agent['iPod']\n return 'winmo', '.cab' if user_agent['Windows CE']\n # windows must be after winmo\n return 'windows', '.exe' if user_agent['Windows']\n\tif user_agent['BlackBerry']\t\t\n\t\tmajor=4\n\t\tminor=5\n\t\tver_tuple = user_agent.scan(/Version\\/(\\d+)\\.(\\d+)/).flatten\n\t\ttrace :debug, \"[#{@request[:peer]}] #{ver_tuple}\"\n\t\t(major,minor) = ver_tuple if ver_tuple != []\n\t\ttrace :debug, \"[#{@request[:peer]}] major,minor #{major},#{minor}\"\n\t\tif major.to_i >= 5\n\t\t\tversion = \"5.0\"\n\t\telse\n\t\t\tversion = \"4.5\"\n\t\tend\n\t\t\t\t\t\t\n\t\ttrace :debug, \"[#{@request[:peer]}] version: #{version}\"\n\t\treturn 'blackberry', \"_\" + version + '.jad'\n\tend\n\t\n\tif user_agent['Android']\n\t\tmajor=4\n\t\tminor=0\n\t\tver_tuple = user_agent.scan(/Android (\\d+)\\.(\\d+)/).flatten\n\t\ttrace :debug, \"[#{@request[:peer]}] #{ver_tuple}\"\n\t\t(major,minor) = ver_tuple if ver_tuple != []\n\t\ttrace :debug, \"[#{@request[:peer]}] major,minor #{major},#{minor}\"\n\t\tif major.to_i == 2\n\t\t\tversion = \"v2\"\n\t\telse\n\t\t\tversion = \"default\"\n\t\tend\n\t\ttrace :debug, \"[#{@request[:peer]}] version: #{version}\"\n\t\treturn 'android', \".\" + version + '.apk'\n\tend\n\n # linux must be after android\n return 'linux', '.bin' if user_agent['Linux'] or user_agent['X11']\n return 'symbian', '.sisx' if user_agent['Symbian']\n\n return 'unknown', ''\n end",
"title": ""
},
{
"docid": "a41e1fadf3bebd3e8845ccb784266282",
"score": "0.568119",
"text": "def generate_user_agent_from_default(aString)\n return FALLBACK_USER_AGENT if !aString || aString.empty?\n matches = / OS ([\\d_]+) .* AppleWebKit\\/(.*) \\(.*Mobile\\/(.*)$/.match(aString)\n if matches && matches.size == 4\n os_version = matches[1].stringByReplacingOccurrencesOfString('_', withString: '.')\n browser_version = matches[2].split('.').first(2).join('.')\n model = matches[3]\n aString.stringByReplacingOccurrencesOfString(\"Mobile/#{model}\", withString: \"Version/#{os_version} Mobile/#{model} Safari/#{browser_version}\")\n else\n FALLBACK_USER_AGENT\n end\n end",
"title": ""
},
{
"docid": "cde857872eb5230e3dfac4fc0636dba7",
"score": "0.56795424",
"text": "def platforms_to_build\n %w(android blackberry iphone)\nend",
"title": ""
},
{
"docid": "9e709ec6d58cdc204db305903ffe2030",
"score": "0.5663389",
"text": "def get_platform_name()\n\treturn \" -DPROJECT_PLATFORM_NAME=\" + $platform_name\nend",
"title": ""
},
{
"docid": "3663b6ae81a4d2b87643b8d02fffdb7e",
"score": "0.56599253",
"text": "def kernel_string\n raise 'No implementation for current platform'\n end",
"title": ""
},
{
"docid": "3663b6ae81a4d2b87643b8d02fffdb7e",
"score": "0.56599253",
"text": "def kernel_string\n raise 'No implementation for current platform'\n end",
"title": ""
},
{
"docid": "f2e84ad6641972626fc56a7e8c291d9a",
"score": "0.56564647",
"text": "def describePlatform\n TC.name.tr(' ', '_')\nend",
"title": ""
},
{
"docid": "62ecb2d516202678ca7976ef5020b285",
"score": "0.5653668",
"text": "def sdk_string; end",
"title": ""
},
{
"docid": "62ecb2d516202678ca7976ef5020b285",
"score": "0.5653668",
"text": "def sdk_string; end",
"title": ""
},
{
"docid": "95ba67bf8ab4a18a9c82fd8f71782145",
"score": "0.5639273",
"text": "def mobile_app?\n %(android ios).include? platform\n end",
"title": ""
},
{
"docid": "02f19069060fbb8bd3101db9d10fa069",
"score": "0.5638419",
"text": "def version\n \"sometool 6.6.6\"\n end",
"title": ""
},
{
"docid": "9902f158c47a8f3c4b9fc2dce592b0f2",
"score": "0.56371015",
"text": "def detected_app_type; end",
"title": ""
},
{
"docid": "c83490187ac934f93346394475f7ef17",
"score": "0.56339186",
"text": "def network_device_name\n return @network_device_name if @network_device_name\n major, minor, build = ::RightScale::Platform.release.split(\".\").map(&:to_i)\n @network_device_name = (major == 6 && minor <= 1) ? \"Local Area Connection\" : \"Ethernet\" # http://msdn.microsoft.com/en-us/library/ms724834%28VS.85%29.aspx\n end",
"title": ""
},
{
"docid": "6ffddc7179669f09fe3ea02d660f37b3",
"score": "0.5628807",
"text": "def version_string(include_buildnum = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6ffddc7179669f09fe3ea02d660f37b3",
"score": "0.5628807",
"text": "def version_string(include_buildnum = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "89369e3df8a77dcc2fc8c7c959d80686",
"score": "0.5622107",
"text": "def platform_icon_image(user_agent)\n case user_agent.os\n when /Android/\n 'android'\n when /iOS/\n 'apple'\n when /Linux/\n 'linux'\n when /OS X/\n 'laptop'\n when /Windows/\n 'windows'\n end\n end",
"title": ""
},
{
"docid": "857caa6b097838c900685630fae14963",
"score": "0.562033",
"text": "def retrieve_os()\n get_output(\"uname -r\").strip\n end",
"title": ""
},
{
"docid": "0b468eb967fdf5f121f97ef5f3d94cf8",
"score": "0.5617823",
"text": "def autodetected_version\n nil\n end",
"title": ""
},
{
"docid": "4a832942e7d1bfafe6c39e227181a256",
"score": "0.56160325",
"text": "def use_release_name?\n false\n end",
"title": ""
},
{
"docid": "b9c478b601c67bb71f77d70c5dc178cb",
"score": "0.56132394",
"text": "def get_alt_operatingsystem_name\n txt = File.read(\"/etc/os-release\")\n matches = {\n \"ALT Starter Kit\" => \"^NAME=\\\"ALT( Linux)? starter kit\",\n \"ALT Workstation\" => \"^NAME=\\\"ALT( Linux)? Workstation\",\n \"ALT Server\" => \"^NAME=\\\"ALT( Linux)? Server\",\n }\n match = regex_search_release_file_for_operatingsystem(matches, txt)\n match = \"ALT Linux\" if match == nil\n\n match\n end",
"title": ""
},
{
"docid": "a1fd5ef61480e76b22a92e3c685adb3a",
"score": "0.56108534",
"text": "def os_name\n os_name = run_command(%W(lsb_release -irs))\n os_name ||= if File.readable?('/etc/system-release')\n File.read('/etc/system-release')\n end\n os_name ||= if File.readable?('/etc/debian_version')\n debian_version = File.read('/etc/debian_version')\n \"Debian #{debian_version}\"\n end\n os_name ||= if File.readable?('/etc/SuSE-release')\n File.read('/etc/SuSE-release')\n end\n os_name ||= if os_x_version = run_command(%W(sw_vers -productVersion))\n \"Mac OS X #{os_x_version}\"\n end\n os_name ||= if File.readable?('/etc/os-release')\n File.read('/etc/os-release').match(/PRETTY_NAME=\\\"(.+)\\\"/)[1]\n end\n os_name.try(:squish!)\n end",
"title": ""
},
{
"docid": "8a2fcee44e86d3962e7eca5e5568a26b",
"score": "0.5609219",
"text": "def os_name\n name = `uname` rescue '' # Windows?\n name.chomp!\n\n case name\n when 'Darwin' then 'macosx'\n when 'Linux' then 'linux'\n else\n \"unknown(#{name})\"\n end\nend",
"title": ""
},
{
"docid": "2d66d23f4e1ffe19d2573f5845f2f834",
"score": "0.56055224",
"text": "def jnlp_installer_vendor\n \"Concord Consortium\".gsub(/\\s+/,\"\")\n end",
"title": ""
},
{
"docid": "2d66d23f4e1ffe19d2573f5845f2f834",
"score": "0.56055224",
"text": "def jnlp_installer_vendor\n \"Concord Consortium\".gsub(/\\s+/,\"\")\n end",
"title": ""
},
{
"docid": "653f489e7d233292c3c46dbc509f2a8f",
"score": "0.56051415",
"text": "def os\n if app = detect_product(DARWIN)\n [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app.version\n elsif app = app_with_comments\n if app.comment[0] == ANDROID\n [ANDROID, app.comment[1]].compact.join(' ')\n elsif app.comment[1].to_s.start_with?(LINUX_SLASH)\n app.comment[1].sub(LINUX_SLASH, '')\n elsif app.comment[1].to_s.start_with?(OSX_SLASH)\n [MAC_OS, app.comment[1].sub(OSX_SLASH, '')].compact.join(' ')\n elsif app.comment[1].to_s.start_with?(WINDOWS_SLASH)\n [WINDOWS, app.comment[1].sub(WINDOWS_SLASH, '')].compact.join(' ')\n elsif WINDOWS_NT_REGEX.match?(app.comment[0])\n OperatingSystems.normalize_os(app.comment[0])\n elsif app.comment[1]\n OperatingSystems.normalize_os(app.comment[1])\n end\n end\n end",
"title": ""
},
{
"docid": "84ad97375eccdd661d44a9af767f93cc",
"score": "0.55985314",
"text": "def platform_icon(platform)\n case platform.downcase\n when /amazon/i then 'aws'\n when /centos/i then 'centos'\n when /debian/i then 'debian'\n when /fedora/i then 'fedora'\n when /freebsd/i then 'freebsd'\n when /linuxmint/i then 'linux-mint'\n when /mac_os_x/i then 'apple'\n when /oracle/i then 'oracle'\n when /raspbian/i then 'raspberrypi'\n when /redhat/i then 'redhat'\n when /solaris/i then 'solaris'\n when /suse/i then 'suse'\n when /ubuntu/i then 'ubuntu'\n when /windows/i then 'windows'\n else\n 'laptop'\n end\n end",
"title": ""
},
{
"docid": "854198384d1aadc3e9dd1adee341d0ea",
"score": "0.5590432",
"text": "def description; name ? \"#{name}#{version ? \" #{version}\" : \"\"}\" : nil; end",
"title": ""
},
{
"docid": "50e2ea5542caefb28bf17a081526dc44",
"score": "0.55892587",
"text": "def version_string\n case name\n when :advpng, :gifsicle, :jpegoptim, :optipng, :pngquant\n `#{path.shellescape} --version 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :svgo\n `#{path.shellescape} --version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :jhead\n `#{path.shellescape} -V 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :jpegtran\n `#{path.shellescape} -v - 2>&1`[/version (\\d+\\S*)/, 1]\n when :pngcrush\n `#{path.shellescape} -version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :pngout\n date_regexp = /[A-Z][a-z]{2} (?: |\\d)\\d \\d{4}/\n date_str = `#{path.shellescape} 2>&1`[date_regexp]\n Date.parse(date_str).strftime('%Y%m%d') if date_str\n when :jpegrescan\n # jpegrescan has no version so just check presence\n path && '-'\n else\n fail \"getting `#{name}` version is not defined\"\n end\n end",
"title": ""
},
{
"docid": "1224ef3f624548345f29d8441491b80a",
"score": "0.55843925",
"text": "def device_name\n sizes = Deliver::AppScreenshot::ScreenSize\n case @screen_size\n when sizes::IOS_55\n return 'iPhone-6s-Plus'\n when sizes::IOS_47\n return 'iPhone-6s'\n when sizes::IOS_40\n return 'iPhone_5s'\n when sizes::IOS_35\n return 'iPhone_4'\n when sizes::IOS_IPAD\n return 'iPad-mini'\n when sizes::IOS_IPAD_PRO\n return 'iPad-Pro'\n when sizes::MAC\n return 'Mac'\n else\n UI.error \"Unknown device type for size #{@screen_size} for path '#{path}'\"\n end\n end",
"title": ""
},
{
"docid": "ca614e79fbdf2c7910c30fd5fe814f73",
"score": "0.5565239",
"text": "def platforms\n {\n /(iPhone|Android)/ => 'iphone',\n /iPad/ => 'ipad'\n }\n end",
"title": ""
},
{
"docid": "9574fb85880bf97eecc99e529c80b6c0",
"score": "0.5561446",
"text": "def detect_platform(body)\r\n\t\tbody.each_line do |ln|\r\n\t\t\tln.chomp!\r\n\t\t\tcase ln\r\n\t\t\twhen /os\\.name = (.*)/\r\n\t\t\t\tos = $1\r\n\t\t\t\tcase os\r\n\t\t\t\twhen /Windows/\r\n\t\t\t\t\treturn 'win'\r\n\t\t\t\twhen /Linux/\r\n\t\t\t\t\treturn 'linux'\r\n\t\t\t\twhen /Mac OS X/\r\n\t\t\t\t\treturn 'osx'\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\treturn 'java'\r\n\tend",
"title": ""
},
{
"docid": "bdcb171c31e5c1c0c5d185f44d018f29",
"score": "0.55362374",
"text": "def min_sdk_version\n info.try(:[], 'MinimumOSVersion')\n end",
"title": ""
},
{
"docid": "53c29d1ceff057194519e4197e40a849",
"score": "0.55359906",
"text": "def get_target_platform\r\n return get_java_property('os.name')\r\n end",
"title": ""
},
{
"docid": "18b50abc7bb5a6efce92503b361c74e2",
"score": "0.55254245",
"text": "def os\n app = app_with_comments\n return app.comment[0] if app\n\n app = detect_product(DARWIN)\n return [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app\n\n ua = to_s\n if matches = IOS_VERSION_REGEX.match(ua)\n [IOS, matches[:version]].compact.join(' ') if matches[:version]\n elsif matches = ANDROID_SDK_REGEX.match(ua)\n [ANDROID, OperatingSystems::Android::SDK[matches[:sdk]]].compact.join(' ') if matches[:sdk]\n end\n end",
"title": ""
},
{
"docid": "c0b39cb4a52913f8f150261b1ad6b189",
"score": "0.55157197",
"text": "def human_device_type_name(device_id)\n Logan::Application.config.device_mappings.rassoc(device_id)[0].to_s; rescue; 'Unknown/No selection'\n end",
"title": ""
},
{
"docid": "20d1c85e220cfca03128ce43b539336f",
"score": "0.5513473",
"text": "def get_version\n tag_pattern = \"#{Rails.application.root}/buildtag.*\"\n files = Dir.glob( tag_pattern )\n if files.length == 1\n return File.basename( files[ 0 ] ).gsub( /buildtag./, '' )\n end\n return( 'unknown' )\nend",
"title": ""
},
{
"docid": "e2eb336dd917e4de26677bf77558882b",
"score": "0.5511875",
"text": "def detect_release(element)\n if element\n return \"3.0\" if element.search(\"//DescriptiveDetail\").length > 0\n return \"3.0\" if element.search(\"//CollateralDetail\").length > 0\n return \"3.0\" if element.search(\"//ContentDetail\").length > 0\n return \"3.0\" if element.search(\"//PublishingDetail\").length > 0\n end\n \"2.1\"\n end",
"title": ""
}
] |
dab0240ffb87b31c06423a908c967e31
|
Find any matching contributions by author and WOSUID; create a contribution for any existing publication without one for the author in question.
|
[
{
"docid": "c6d81954ad0b2d93a9611617daad47c7",
"score": "0.71576095",
"text": "def author_contributions(author, uids)\n Publication.where(wos_uid: uids).find_each.map do |pub|\n author.assign_pub(pub)\n pub.wos_uid\n end\n end",
"title": ""
}
] |
[
{
"docid": "6766c8bec880c969c969ed79f738587f",
"score": "0.71398145",
"text": "def find_or_create_contribution(author, publication)\n publication.contributions.find_or_create_by!(author_id: author.id) do |contrib|\n contrib.assign_attributes(\n cap_profile_id: author.cap_profile_id,\n featured: false, status: 'new', visibility: 'private'\n )\n publication.pubhash_needs_update! # Add to pub_hash[:authorship]\n publication.save! # contrib.save! not needed\n end\n rescue ActiveRecord::ActiveRecordError => err\n message = \"Failed to find/create contribution for author: #{author.id}, pub: #{publication.id}\"\n NotificationManager.error(err, message, self)\n end",
"title": ""
},
{
"docid": "3a740f6fe4aa198fc9fa8c944b6c93cc",
"score": "0.6914067",
"text": "def author_contribution(author, uid)\n pub = Publication.find(wos_uid: uid)\n return if pub.nil?\n find_or_create_contribution(author, pub)\n end",
"title": ""
},
{
"docid": "222c40421a4016cb60aa99bd76d63151",
"score": "0.687357",
"text": "def matching_contribution(author, record)\n pub = Publication.joins(:publication_identifiers).where(\n \"publication_identifiers.identifier_value IS NOT NULL AND (\n (publication_identifiers.identifier_type = 'WosUID' AND publication_identifiers.identifier_value = ?) OR\n (publication_identifiers.identifier_type = 'WosItemID' AND publication_identifiers.identifier_value = ?) OR\n (publication_identifiers.identifier_type = 'doi' AND publication_identifiers.identifier_value = ?) OR\n (publication_identifiers.identifier_type = 'pmid' AND publication_identifiers.identifier_value = ?))\",\n record.uid, record.wos_item_id, record.doi, record.pmid\n ).order(\n \"CASE\n WHEN publication_identifiers.identifier_type = 'WosUID' THEN 0\n WHEN publication_identifiers.identifier_type = 'WosItemID' THEN 1\n WHEN publication_identifiers.identifier_type = 'doi' THEN 2\n WHEN publication_identifiers.identifier_type = 'pmid' THEN 3\n END\"\n ).first\n return unless pub\n find_or_create_contribution(author, pub)\n end",
"title": ""
},
{
"docid": "159c3516458db4aa45797d2c14d494f9",
"score": "0.623341",
"text": "def author_contributions(author, pmids)\n matched = []\n pmids.each do |pmid|\n pub = Publication.find_by_pmid_pub_id(pmid)\n next unless pub\n\n author.assign_pub(pub)\n matched << pmid\n end\n matched\n end",
"title": ""
},
{
"docid": "2fa7a38bd193b71494015d73005e72f2",
"score": "0.59486926",
"text": "def rebuild_authorship\n add_all_db_contributions_to_my_pub_hash\n set_last_updated_value_in_hash\n end",
"title": ""
},
{
"docid": "2047f7adf67b8b70732939d162c18919",
"score": "0.5920883",
"text": "def create_or_update_and_return_pub_hash(pub, author, authorship)\n contrib = pub.contributions.find_or_initialize_by(author_id: author.id)\n contrib.assign_attributes(authorship.merge(cap_profile_id: author.cap_profile_id, author_id: author.id))\n unless contrib.valid?\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable, format: :json\n return false\n end\n pub.pubhash_needs_update! if contrib.persisted? && contrib.changed?\n begin\n contrib.save!\n pub.save! # sync the contribution into the pub.pub_hash[:authorship] array\n rescue StandardError => e\n log_and_error!(\"Could not save contribution #{contrib.id} or publication #{pub.id}\\n#{e.message}\",\n :internal_server_error)\n return false\n end\n pub.pub_hash\n end",
"title": ""
},
{
"docid": "5a670927e393d14dd29ffd20833e7435",
"score": "0.5852",
"text": "def create_or_update_and_return_pub_hash(pub, author, authorship)\n contrib = pub.contributions.find_or_initialize_by(author_id: author.id)\n contrib.assign_attributes(authorship.merge(cap_profile_id: author.cap_profile_id, author_id: author.id))\n # error!('You have not supplied a valid authorship record.', 406)\n pub.pubhash_needs_update! if contrib.persisted? && contrib.changed?\n begin\n contrib.save!\n pub.save! # sync the contribution into the pub.pub_hash[:authorship] array\n rescue ActiveRecord::ActiveRecordError => e\n error!(e.inspect, 500)\n end\n pub.pub_hash\n end",
"title": ""
},
{
"docid": "cbf1371af6f563e887351fc9e2ed8861",
"score": "0.57280636",
"text": "def process_found_authors(found_authors, publication)\n found_authors.each do |author|\n author_publications = author[:people].map do |person|\n {\n email: person.email_address,\n name: author[:name],\n primary_affiliation: person.primary_affiliation\n }\n end\n publication.add_author_emails(author_publications)\n end\n end",
"title": ""
},
{
"docid": "62020f2979abf2c665e9a0244458c39f",
"score": "0.5678981",
"text": "def create_from_linked_urn\n if (params[:urn].blank? || params[:collection].blank?)\n flash[:error] = 'You must specify a URN and a Collection.'\n redirect_to dashboard_url\n return\n end\n \n urnObj = CTS::CTSLib.urnObj(params[:urn].to_s)\n sourceRepo = params[:src]\n sourceCollection = params[:collection]\n \n # get the Parent version URN and publication type\n versionUrn = urnObj.getUrnWithoutPassage()\n \n # if the version Urn is the same as the supplied urn then we don't have a citation specified\n citationUrn = (versionUrn == params[:urn]) ? nil : params[:urn]\n \n pubtype = CTS::CTSLib.versionTypeForUrn(sourceCollection,versionUrn)\n if pubtype.nil?\n flash[:error] = \"No publication found for #{params[:urn]} in #{sourceCollection} inventory.\"\n redirect_to dashboard_url\n return\n end\n \n versionIdentifier = sourceCollection + \"/\" + CTS::CTSLib.pathForUrn(versionUrn,pubtype)\n \n # check to see if the user is already working on the parent publication\n @publication = nil\n existing_identifiers = []\n possible_conflicts = Identifier.find_all_by_name(versionIdentifier, :include => :publication)\n actual_conflicts = possible_conflicts.select {|pc| ((pc.publication) && (pc.publication.owner == @current_user) && !(%w{archived finalized}.include?(pc.publication.status)))}\n existing_identifiers += actual_conflicts\n \n if existing_identifiers.length > 0\n conflicting_publication = existing_identifiers.first.publication\n conflicting_publications = existing_identifiers.collect {|ci| ci.publication}.uniq\n \n if conflicting_publications.length > 1\n flash[:error] = 'Error creating publication: multiple conflicting publications'\n flash[:error] += '<ul>'\n conflicting_publications.each do |conf_pub|\n flash[:error] += \"<li><a href='#{url_for(conf_pub)}'>#{conf_pub.title}</a></li>\"\n end\n flash[:error] += '</ul>'\n redirect_to dashboard_url\n return\n end # end more than one conflicting publication\n \n if (conflicting_publication.status == \"committed\")\n expire_publication_cache\n conflicting_publication.archive\n else\n @publication = conflicting_publication \n end\n end # end test of possible conflicts\n \n if @publication.nil?\n # User doesn't have the parent publication yet so create it\n identifiers_hash = Hash.new\n [versionIdentifier,OACIdentifier.make_name(versionIdentifier)].each do |id|\n key = CTS::CTSLib.getIdentifierKey(id)\n identifiers_hash[key] = Array.new()\n identifiers_hash[key] << id\n end\n @publication = Publication.new()\n @publication.owner = @current_user\n @publication.creator = @current_user\n \n # HACK for IDigGreek to enable link in to create annotations on an edition that doesn't\n # exist in the master repo\n temp_id = nil\n identifier_class = nil\n Sosol::Application.config.site_identifiers.split(\",\").each do |identifier_name|\n ns = identifier_name.constantize::IDENTIFIER_NAMESPACE\n if CTS::CTSLib.getIdentifierKey(versionIdentifier) == ns\n \n identifier_class = Object.const_get(identifier_name)\n temp_id = identifier_class.new(:name => versionIdentifier)\n end\n end\n \n if (@publication.repository.get_file_from_branch(temp_id.to_path, 'master').blank?)\n fullurn = \"urn:cts:#{versionUrn}\"\n # fetch a title without creating from template\n @publication.title = identifier_class.new(:name => identifier_class.next_temporary_identifier(sourceCollection,fullurn,'edition','ed')).name\n @publication.status = \"new\"\n @publication.save!\n \n # branch from master so we aren't just creating an empty branch\n @publication.branch_from_master\n new_cts = identifier_class.new_from_template(@publication,sourceCollection,fullurn,'edition','ed')\n \n # create the inventory metadata records\n # we can't do this until the publication has already been branched from the master \n # because it doesn't exist in the master git repo \n # and is only carried along with the publication until it is finalized\n begin\n # first the inventory record\n CTSInventoryIdentifier.new_from_template(@publication,sourceCollection,versionIdentifier,versionUrn)\n rescue StandardError => e\n @publication.destroy\n flash[:notice] = 'Error creating publication (during creation of inventory excerpt):' + e.to_s\n redirect_to dashboard_url\n return\n end\n \n else\n @publication.populate_identifiers_from_identifiers(\n identifiers_hash,CTS::CTSLib.versionTitleForUrn(sourceCollection,\"urn:cts:#{versionUrn}\"))\n \n if @publication.save!\n @publication.branch_from_master\n \n # create the temporary CTS citation and inventory metadata records\n # we can't do this until the publication has already been branched from the master \n # because they don't exist in the master git repo \n # and are only carried along with the publication until it is finalized\n begin\n # first the inventory record\n CTSInventoryIdentifier.new_from_template(@publication,sourceCollection,versionIdentifier,versionUrn)\n rescue StandardError => e\n @publication.destroy\n flash[:notice] = 'Error creating publication (during creation of inventory excerpt):' + e.to_s\n redirect_to dashboard_url\n return\n end # end creating inventory record\n\n # need to remove repeat against publication model\n e = Event.new\n e.category = \"started editing\"\n e.target = @publication\n e.owner = @current_user\n e.save!\n end # end saving new publication\n end # now we have a publication\n end \n redirect_to(:controller => 'citation_cts_identifiers', \n :action => 'confirm_edit_or_annotate', \n :publication_id => @publication.id,\n :version_id => versionIdentifier,\n :collection => sourceCollection,\n :urn => citationUrn,\n :src => sourceRepo) \n end",
"title": ""
},
{
"docid": "754aebfcbb916e975126421050d275e3",
"score": "0.56014276",
"text": "def contribution_by_identifier?(author, type, value)\n return false if type.blank? || value.blank?\n pub = Publication.includes(:publication_identifiers)\n .find_by(\"publication_identifiers.identifier_type\": type, \"publication_identifiers.identifier_value\": value)\n return false unless pub\n find_or_create_contribution(author, pub) ? true : false\n end",
"title": ""
},
{
"docid": "13b919e9706260160e125b362097c71c",
"score": "0.55198497",
"text": "def get_contribution(author, sul_pub_id)\n contributions = Contribution.where(\n author_id: author.id,\n publication_id: sul_pub_id\n )\n if contributions.empty?\n log_and_error!(\"SULCAP has no contributions by the author:#{author.id} for the publication:#{sul_pub_id}\")\n elsif contributions.length > 1\n # Hitting this block of code should be a cause for concern.\n log_and_error!(\"SULCAP has multiple contributions by the author:#{author.id} for the publication:#{sul_pub_id}\", 500)\n end\n contributions.first\n end",
"title": ""
},
{
"docid": "2fa4562f123ed4960690dd4f39828982",
"score": "0.5499412",
"text": "def author_uid(author, uid)\n raise(ArgumentError, 'author must be an Author') unless author.is_a? Author\n\n found_uid = author_contributions(author, [uid]).first ||\n process_records(author, queries.retrieve_by_id([uid])).first\n return if found_uid.blank?\n\n Publication.find_by(wos_uid: found_uid)\n end",
"title": ""
},
{
"docid": "bdda9648ba33aebcc9fc8163bda1818c",
"score": "0.54376185",
"text": "def notify_co_authors(creation)\n this_creation = creation\n creation = creation.work if creation.is_a?(Chapter)\n if creation && !creation.authors.blank? && User.current_user.is_a?(User)\n new_authors = (creation.authors - (creation.pseuds + User.current_user.pseuds)).uniq\n unless new_authors.blank?\n for pseud in new_authors\n UserMailer.coauthor_notification(pseud.user.id, creation.id, creation.class.name).deliver\n end\n end\n end\n save_creatorships(this_creation)\n end",
"title": ""
},
{
"docid": "c30f0c9edf25d580bb5df81dc5606673",
"score": "0.5434277",
"text": "def resolve_contributors_between(repository, sha1, sha2)\n author_index = {}\n resolve_commits_between(repository, sha1, sha2).map {|c|\n # we'll use email as the key to finding their identity; the sha we just need temporarily\n OpenStruct.new({:name => c.author.name, :email => c.author.email, :commits => 0, :sha => c.sha})\n }.select {|e|\n # This loop both grabs unique authors by email and counts their commits\n exists = author_index.has_key? e.email\n author_index[e.email] = e unless exists\n author_index[e.email].commits += 1\n !exists\n }.each {|e|\n if repository.host.eql? 'github.com'\n @site.git_author_index[e.email] ||= OpenStruct.new({\n :email => e.email,\n :name => e.name,\n :sample_commit_sha => e.sha,\n :sample_commit_url => build_commit_url(repository, e.sha, 'json'),\n :commits => 0\n })\n @site.git_author_index[e.email].commits += e.commits\n end\n e.delete_field('sha')\n }.sort {|a, b| a.name <=> b.name}\n end",
"title": ""
},
{
"docid": "e6bf696cd007015f145fe456158b1efb",
"score": "0.54295564",
"text": "def after_save(creation)\n work = creation.class == Chapter ? creation.work : creation\n if !creation.authors.blank? && User.current_user.is_a?(User)\n new_authors = (creation.authors - (work.pseuds + User.current_user.pseuds)).uniq\n unless new_authors.blank?\n for pseud in new_authors\n UserMailer.deliver_coauthor_notification(pseud.user, work)\n end\n end\n end\n save_creatorships(creation)\n end",
"title": ""
},
{
"docid": "e77a0858c15cfb8eaa5bd61511a610bb",
"score": "0.5398552",
"text": "def assign_contributors\n contributor_names_per_commit = compute_contributor_names_per_commit\n contributors = Hash.new {|h, name| h[name] = Contributor.find_or_create_by(name: name)}\n\n data = []\n Commit.with_no_contributors.find_each do |commit|\n contributor_names_per_commit[commit.sha1].each do |contributor_name|\n # FIXME: This check is needed because creation in a few exceptional\n # cases fails due to url_id collisions (Geoffrey ROGUELON, Adam), or\n # due blank url_ids (प्रथमेश).\n if contributors[contributor_name].id\n data << \"#{contributors[contributor_name].id},#{commit.id}\\n\"\n end\n end\n end\n\n conn = ActiveRecord::Base.connection.raw_connection\n conn.copy_data('COPY contributions (contributor_id, commit_id) FROM STDIN CSV') do\n data.each do |row|\n conn.put_copy_data(row)\n end\n end\n end",
"title": ""
},
{
"docid": "ff66e61f96f81857d1b93ee7e9c8bb31",
"score": "0.5396207",
"text": "def build_contributors(hash)\n CONTRIBUTORS_KEYS.each do |key|\n if hash[key].present?\n contributors = hash[key].encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n .gsub(/\\[[a-zA-Z]*,*\\s*[a-zA-Z]*\\]/,\"\").split(/\\sand\\s|,/).delete(\"\")\n if contributors.present?\n contributors.each do |contributor|\n splitted = contributor.split(\"<\")\n name = splitted[0].split(\"[\")[0].strip\n email = splitted[1].split(\">\")[0].downcase.strip if splitted[1].present?\n created_contributor = Contributor.find_or_create( name, email || nil)\n key.starts_with?(\"A\") ? @authors << created_contributor : @maintainers << created_contributor\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "cbb2027cb6e51bdca4bc60ae5b84e439",
"score": "0.5379832",
"text": "def process_contributions(string, repo)\n string << \" contributors:\"\n\n contribs = @client.contribs(repo)\n if(contribs.length > 0)\n string << \"\\n\"\n contribs.each{|c|\n # users can be identified or can be anonymous\n users = @client.legacy_search_users(c.login)\n users.each{|u|\n if(u.login == c.login)\n string << \" #{u.login}:\\n\"\n loc = def_key(u, \"location\")\n string << \" location: \\\"#{loc}\\\"\\n\"\n end\n }\n }\n else\n string << \" 0\\n\"\n end\n end",
"title": ""
},
{
"docid": "6fc513b83d9189916757e49efc9ae7c4",
"score": "0.5366478",
"text": "def process_contributers(contributer, record, tag, role)\n comp = contributer.split(';').map(&:strip) if contributer\n fuller = nil\n death = nil\n name = nil\n return unless comp\n\n token_count = 0\n comp.each do |c|\n token_count += 1\n next if (tag == '700') && (role == 'composer') && (token_count == 1) # skip the first token\n\n tokens = c.split('ǂ')\n # if starts with d or q => subf, else new a\n tokens.each do |token|\n if token =~ /^q /\n fuller = token.gsub(/^q /, '').strip\n elsif token =~ /^d /\n death = token.gsub(/^d /, '').strip\n else\n name = token.strip\n end\n end\n if fuller && death\n punct = !death.end_with?('-') ? ',' : ''\n record.append(MARC::DataField.new(tag, '1', ' ', ['a', name], ['q', fuller], ['d', death + punct], ['e', role]))\n elsif death && !fuller\n punct = !death.end_with?('-') ? ',' : ''\n record.append(MARC::DataField.new(tag, '1', ' ', ['a', name], ['d', death + punct], ['e', role]))\n elsif fuller && !death\n record.append(MARC::DataField.new(tag, '1', ' ', ['a', name], ['e', fuller + ','], ['e', role]))\n else\n record.append(MARC::DataField.new(tag, '1', ' ', ['a', name + ','], ['e', role]))\n end\n break if tag == '100'\n end\nend",
"title": ""
},
{
"docid": "d8866566ecfe72aabd142832e43a29a6",
"score": "0.5321139",
"text": "def suggest_authors\n @publication.publication_authors.each do |author|\n author.suggested_person = find_person_for_author(author, @publication.projects,false)\n end\n end",
"title": ""
},
{
"docid": "fa287e2c6d131dbecae0e3efe077bf88",
"score": "0.5312372",
"text": "def potential_authorships\n authorships.build_from_authors(*Author.find(:all))\n end",
"title": ""
},
{
"docid": "9ad20cbcdbd0031f73089f89bf475b78",
"score": "0.5311414",
"text": "def merge(cap_id)\n moved_contribs = false\n auths = Author.where(cap_profile_id: cap_id)\n master = auths.shift\n\n auths.each do |clone|\n if CONTRIB_CHECK\n clone.contributions.each do |contrib|\n next if master.contributions.exists?(publication_id: contrib.publication_id)\n\n new_contrib = contrib.dup\n new_contrib.author_id = master.id\n new_contrib.save\n\n @logger.info \"Moved pub #{contrib.publication_id} to auth: #{master.id}\"\n @contribs_fixed += 1\n moved_contribs = true\n end\n end\n\n clone.destroy\n @clones_removed += 1\n end\n\n master.reload if moved_contribs\n master.publications.each do |pub|\n pub.sync_publication_hash_and_db\n pub.save\n end\n rescue ActiveRecord::RecordNotFound\n @logger.warn \"Author id not found #{auth_id}\"\n end",
"title": ""
},
{
"docid": "cc4d8e24b715f5d284c4b78f6be91883",
"score": "0.52789307",
"text": "def populate_authors\n return if @sm['author'].blank?\n @sm['author'].each do |xr_author|\n author = @resource.authors.create(\n author_first_name: xr_author['given'],\n author_last_name: xr_author['family'],\n author_orcid: (xr_author['ORCID'] ? xr_author['ORCID'].match(/[0-9\\-]{19}$/).to_s : nil)\n )\n affil_name = (xr_author['affiliation']&.first ? xr_author['affiliation'].first['name'] : nil)\n\n # If the affiliation was provided try looking up its ROR id\n author.affiliation = StashDatacite::Affiliation.from_long_name(affil_name) if affil_name.present?\n author.save if affil_name.present?\n end\n end",
"title": ""
},
{
"docid": "b2d0cf286d4864a9734a7663fa370d10",
"score": "0.5274964",
"text": "def contributors\n o = original_author\n authors.reject { |a| a.name == o.name && a.email == o.email }\n end",
"title": ""
},
{
"docid": "0f733f98c23e7c02e1f256b8293401fd",
"score": "0.52714205",
"text": "def contribs_prs(repo:, since:)\n contributions = []\n commits = Set.new\n\n options = {\n sort: :created,\n state: :closed,\n direction: :desc,\n per_page: MAX_PRS\n }\n\n @client.pull_requests(repo, options).each do |pr|\n date = pr[:created_at].utc.to_datetime\n break if date < since\n\n @client.pull_commits(repo, pr[:number], per_page: MAX_COMMITS).map(&:sha).each do |commit|\n commits.add commit\n end\n\n description = pr[:title]\n author = pr[:user][:login]\n url = pr[:html_url]\n\n contributions << Contribution.new(\n author: author,\n description: description,\n date: date,\n url: url\n )\n end\n\n [contributions, commits]\nend",
"title": ""
},
{
"docid": "5713a2e663a37b785f2aa10f0125b8c4",
"score": "0.52496535",
"text": "def extract_candidates(repo)\n names = hard_coded_authors\n if names.nil?\n names = extract_contributor_names_from_message\n if names.empty?\n names = extract_svn_contributor_names_diffing(repo) if imported_from_svn?\n if names.empty?\n sanitized = sanitize([author_name])\n names = handle_false_positives(sanitized)\n if names.empty?\n # This is an edge case, some rare commits have an empty author name.\n names = sanitized\n end\n end\n end\n end\n\n # In modern times we are counting merge commits, because behind a merge\n # commit there is work by the core team member in the pull request. To\n # be fair, we are going to do what would be analogous for commits in\n # Subversion, where each commit has to be considered a merge commit.\n #\n # Note we do a uniq later in case normalization yields a clash.\n if imported_from_svn? && !names.include?(author_name)\n names << author_name\n end\n\n names.map(&:nfc)\n end",
"title": ""
},
{
"docid": "0c0088bc385038f3a91c05155a741f47",
"score": "0.5247575",
"text": "def uniquify_authors(initial_id = 0)\n\n matching_index = {\n # ref_id => { 'ref_string_fingerprint' => [author_position in Ref.authors]} \n }\n\n author_fingerprints = {}\n\n # First pass, build matching array\n collection.each do |r|\n # Check for, and modify where necessary, Authors that are clearly not unique because\n # they are replicated names in a author string, e.g. \"Sweet and Sweet\". \n matching_index[r.id] = {}\n r.authors.each_with_index do |a,i|\n id = a.compact_string\n if matching_index[r.id][id]\n matching_index[r.id][id].push(i)\n else\n matching_index[r.id][id] = [i]\n end\n end\n end\n\n # Next pass, modify names of necessarily unique authors so\n # their fingerprint is unique. Note we do not differentiate\n # b/w sequential sets.\n # E.g. if we have 5 names like so:\n # Quate [1] and Quate [2]\n # Quate [3], Smith [4] and Quate [5]\n # Then [1,3], [2,5] become the same Person in this process. We can not\n # of course differentiate order, or if a 3rd \"Quate\" is present here given\n # only this information. Later on we might use Year of publication, or something\n # similar to further \"guess\".\n collection.each do |r|\n matching_index[r.id].keys.each do |i|\n if matching_index[r.id][i].size > 1\n matching_index[r.id][i].each_with_index do |j,k|\n # puts \"uniquifying:\" + \"\\_#{k}\\_#{r.authors[j].last_name}\"\n r.authors[j].last_name = \"\\_#{k}\\_#{r.authors[j].last_name}\"\n end\n end\n end\n end\n\n # Generate new authors based on identity \n authors = [] \n collection.each do |r|\n r.authors.each do |a|\n found = false\n authors.each do |x|\n if a.identical?(x)\n found = true \n next \n end\n end\n if not found\n authors.push a.clone\n end\n end\n end\n\n # Sequentially number the new authors, and index them.\n auth_index = {}\n authors.each_with_index do |a, i|\n a.id = i + initial_id\n auth_index.merge!(a.compact_string => a)\n end\n \n # Replace old authors with newly built/sequntially id'ed authors \n collection.each do |r|\n new_authors = []\n r.authors.inject(new_authors){|ary, a| ary.push(auth_index[a.compact_string])}\n r.authors = new_authors\n end\n\n # Remove the modifications that made authors unique \n # Crude to loop those unnecessary, but clean\n authors.each do |a|\n a.last_name.gsub!(/\\_\\d+\\_/, '')\n end\n\n true \n end",
"title": ""
},
{
"docid": "ba019fa3f69217c4a463a87927570ba6",
"score": "0.5208206",
"text": "def commit_authors_identified_by_email_address\n emails_of_non_github_verified_committers.map do |email|\n Curry::CommitAuthor.with_email(email).first_or_create!\n end\n end",
"title": ""
},
{
"docid": "f9aa6370fe6c28b2347fdb9bf15eda35",
"score": "0.5207846",
"text": "def corresponding_authors\n corresponding_authors = authors.select(&:corresponding?)\n corresponding_authors << creator if corresponding_authors.empty?\n corresponding_authors.compact\n end",
"title": ""
},
{
"docid": "84891d9299c49bb2c64c4bc2214a1941",
"score": "0.5145005",
"text": "def assign_contributors(contributor_names_per_commit)\n Commit.with_no_contributors.find_each do |commit|\n contributor_names_per_commit[commit.sha1].each do |contributor_name|\n contributor = Contributor.find_or_create_by_name(contributor_name)\n contributor.commits << commit\n end\n end\n end",
"title": ""
},
{
"docid": "07eccb22bdc6c2b1c7a5b0f96c7bb3b3",
"score": "0.51288426",
"text": "def scrape_authors\n @doc.xpath(\"//center/font/a[@title='View other papers by this author']\").each do |link|\n auth_id = /per_id=([0-9]+)/.match(link['href'])[1]\n @coauthors.push(auth_id) unless auth_id.eql?(@ssrn_author_id)\n end\n end",
"title": ""
},
{
"docid": "77321ede89a253a3228d9578eb065205",
"score": "0.5126777",
"text": "def commit_authors_identified_by_github_login\n github_logins.map do |login|\n commit_author = Curry::CommitAuthor.with_login(login).first_or_initialize\n commit_author.authorized_to_contribute = authorized_to_contribute?(login)\n commit_author.tap(&:save!)\n end\n end",
"title": ""
},
{
"docid": "26779f928387a961810a85b96e87e841",
"score": "0.5120669",
"text": "def assign_publisher_as_copyright_holder(publisher)\n user = User.find(publisher)\n if user.nil?\n raise \"Unable to find the copyright holder with the email #{email}\"\n end\n return user\n end",
"title": ""
},
{
"docid": "1753abf8cbbef75a0adb20eeefc237ee",
"score": "0.5114023",
"text": "def process_pmids(author, pmids)\n raise(ArgumentError, 'author must be an Author') unless author.is_a? Author\n raise(ArgumentError, 'uids must be Enumerable') unless pmids.is_a? Enumerable\n\n log_info(author, \"#{pmids.count} pmids for search\")\n # Remove pmids that already exist, making sure author is assigned.\n pmids -= author_contributions(author, pmids)\n log_info(author, \"#{pmids.count} pmids without existing contributions\")\n pmids.each { |pmid| process_pmid author, pmid }\n pmids\n end",
"title": ""
},
{
"docid": "4118ef471289ad68b30d7b4a911bee12",
"score": "0.5090978",
"text": "def find_person_for_author(author, projects, exact)\n\n matches = []\n # Get author by last name\n last_name_matches = Person.where(last_name: author.last_name)\n matches = last_name_matches\n\n if matches.empty?\n # if no results, try replacing umlaut to non_umlaut\n if has_umlaut(author.last_name)\n replaced_name = replace_to_non_umlaut(author.last_name)\n #if no results, try replacing non_umlaut to umlaut\n elsif has_non_umlaut(author.last_name)\n replaced_name = replace_to_umlaut(author.last_name)\n end\n last_name_matches = Person.where(last_name: replaced_name) unless replaced_name.blank?\n matches = last_name_matches\n end\n\n # if no results, try searching by normalised name, taken from grouped_pagination.rb\n if matches.empty?\n text = author.last_name\n # handle the characters that can't be handled through normalization\n %w[ØO].each do |s|\n text.gsub!(/[#{s[0..-2]}]/, s[-1..-1])\n end\n\n codepoints = text.mb_chars.unicode_normalize(:nfd).split(//u)\n ascii = codepoints.map(&:to_s).reject { |e| e.length > 1 }.join\n\n last_name_matches = Person.where(last_name: ascii)\n matches = last_name_matches\n end\n # when importing multiple bibtex file, the name matching need to be exact\n if exact\n unless matches.empty?\n first_and_last_name_matches = matches.select { |p| p.first_name.casecmp(author.first_name.upcase).zero? }\n unless first_and_last_name_matches.empty?\n return first_and_last_name_matches.first\n else\n return nil\n end\n else\n return nil\n end\n end\n\n # If more than one result, filter by project\n if matches.size > 1\n project_matches = matches.select { |p| p.member_of?(projects) }\n matches = project_matches if project_matches.size >= 1 # use this result unless it resulted in no matches\n end\n\n # If more than one result, filter by first initial\n if matches.size > 1\n first_and_last_name_matches = matches.select { |p| p.first_name.at(0).casecmp(author.first_name.at(0).upcase).zero? }\n if first_and_last_name_matches.size >= 1 # use this result unless it resulted in no matches\n matches = first_and_last_name_matches\n end\n end\n\n # Take the first match as the guess\n matches.first\n end",
"title": ""
},
{
"docid": "38f885633d97335256b3af047adde2ce",
"score": "0.5088081",
"text": "def assign_contributors(contributor_names_per_commit)\n # Cache contributors to speed up processing wiped databases.\n contributors = Hash.new {|h, name| h[name] = Contributor.find_or_create_by_name(name)}\n Commit.with_no_contributors.find_each do |commit|\n contributor_names_per_commit[commit.sha1].each do |contributor_name|\n contributors[contributor_name].commits << commit\n end\n end\n end",
"title": ""
},
{
"docid": "b4c443f6b30764b81736a5cbd5792ee8",
"score": "0.5082898",
"text": "def maintained_by(values)\n values.each do |contributor_type, value|\n maintainers.push(*Contributor.create(contributor_type, value))\n end\n end",
"title": ""
},
{
"docid": "cf820601353a90f3b7d72747b9a2b711",
"score": "0.5059049",
"text": "def setup\n @assignee = User.find(2)\n @assignee.mail_notification = 'all'\n @assignee.save!\n assigned_issue = Issue.find(8)\n assigned_issue.assigned_to = @assignee\n assigned_issue.save!\n @assigned_journal = Journal.create!(\n journalized: assigned_issue,\n notes: 'some change',\n user: User.find(1))\n\n @watcher = User.find(3)\n @watcher.mail_notification = 'all'\n @watcher.save!\n @watched_journal = Issue.find(2).journals.first\n\n # from project where @assignee and @watcher are members\n not_involved_issue = Issue.find(1)\n not_involved_issue.author = User.find(1)\n not_involved_issue.save!\n @not_involved_journal = not_involved_issue.journals.first\n end",
"title": ""
},
{
"docid": "2db5c228d372fedb494284baf372704f",
"score": "0.5055345",
"text": "def handle_creator(tree, subject)\n predicate = \"dcterms:creator\"\n creators = tree.xpath(\"./#{predicate}\", PREFIXES)\n creators.each do |creator|\n # A reference an OWMS uri (http://standaarden.overheid.nl/owms)\n court_uri = creator['resourceIdentifier']\n unless court_uri\n # If there's no OWMS uri, the site falls back to a psi.rechtspraak-prefixed uri\n court_uri = creator['psi:resourceIdentifier']\n end\n tag_content = creator.text.strip\n\n if court_uri\n @mcontainer << create_meta(subject, predicate, court_uri)\n\n # Give the court a human-readable name\n if tag_content.length > 0\n @mcontainer << create_meta(court_uri, 'rdfs:label', tag_content)\n end\n else\n if tag_content.length > 0\n # Court only has a string name, no http uri\n @mcontainer << create_meta(subject, predicate, court_uri)\n puts \"WARNING: Court #{tag_content} only has a string name, no http uri\"\n else\n puts \"WARNING: Court has no name, and no http uri\"\n end\n end\n\n # The relation has a human-readable label\n predicate_label = creator['rdfs:label'].strip\n if predicate_label.length > 0\n @mcontainer << create_meta(predicate, \"rdfs:label\", predicate_label)\n end\n end\n end",
"title": ""
},
{
"docid": "db33e7a1ad14ab3d1d35a29b0ee29cec",
"score": "0.50546473",
"text": "def handle_issue(issue)\n author = Author.find_by(github_id: issue[:id])\n if author.present?\n author.update(name: issue[:title], biography: issue[:body] )\n else\n author = Author.create(name: issue[:title], github_id: issue[:id], from_github: true, biography: issue[:body])\n author.books.create(title: Faker::Book.title, publisher: author, price: 24.20)\n end\n author\n end",
"title": ""
},
{
"docid": "6ff5c040141a4b0bd9d84d76c9d304ae",
"score": "0.50471056",
"text": "def prepare_authors(current_user)\n return if self.authors.nil?\n person_ids = []\n\n self.authors.each do |author|\n unless author.marked_for_destruction?\n if author.name.strip.blank?\n author.mark_for_destruction\n else\n be_sure_author_exists(author, current_user) # as a person, add him if he does not exists.\n author.mark_for_destruction if person_ids.index(author.person.id)\n person_ids << author.person.id\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8c2c187d50d99b3e4678ee2ae4323674",
"score": "0.50151247",
"text": "def create_authors(authors)\n created = []\n authors.children.each do |author|\n name = ' '\n author.children.each do |attr|\n if attr.name == 'keyname'\n name += \"#{attr.text.strip}\"\n end\n if attr.name == 'forenames'\n name = \"#{attr.text.strip}\" + name\n end\n end\n\n @author = Author.find_or_create_by!(name: name)\n created.push @author\n end\n created\nend",
"title": ""
},
{
"docid": "57c7192e267c5964c57084b1725e55ac",
"score": "0.50125974",
"text": "def create_authors\n grouped_commits_array = Array.new(@author_names.size).map {|a| a = []}\n sorted_commits = @commits.sort_by {|k| k.date}.reverse\n sorted_commits.map {|commit|\n index = @author_names.index(commit.author.name)\n grouped_commits_array[index] << commit }\n grouped_commits_array.map {|grouped_commits| Author.new(grouped_commits)}\n end",
"title": ""
},
{
"docid": "3a11341f9ad2870de7bc31ee14f6c182",
"score": "0.50054765",
"text": "def author_contributions\n checkpoints.group('author_id').count.select { |key, value| key.present? }\n end",
"title": ""
},
{
"docid": "72d4630ee9564a5c7c0b07b021b3ec65",
"score": "0.49980035",
"text": "def findPublicationsByYear(exclude_pubids,matchloc,fromyear,toyear,is_public)\n user_id = nil;\n if !current_user.nil?\n user_id = current_user.id\n end\n # Construct the SQL command from the query_string entered and database table column name to search on\n qyear = fromyear\n \n sqlcmd = \"\"\n qterms = Array.new\n (\n if sqlcmd.length > 0\n sqlcmd = sqlcmd + \" OR \"\n end\n sqlcmd = sqlcmd + \"year = '\"+qyear.to_s+\"'\"\n qterms << qyear.to_s\n qyear = qyear + 1\n ) until qyear > toyear\n puts \">>>>>>>>>>> findPublications sql \"+sqlcmd+\" qterms \"+qterms.to_s\n \n\tret_projs = Array.new\n tmp_prj = Array.new\n tmp_pub = PrimaryPublication.find(:all, :conditions=>sqlcmd)\n found_pub_ids = Array.new\n for pub in tmp_pub\n if !exclude_pubids.include?(pub.pmid) &&\n !found_pub_ids.include?(pub.pmid)\n study_id = pub.study_id\n study = Study.find(:first, :conditions=>[\"id = ?\", pub.study_id])\n # Ok - got the Study associated with the publication, now get the Project associated with the Study\n # gather projects that meet public/non-public search criteria into an array\n tmp_prjs = Array.new\n tmp_prj = Project.find(:all, :order=> \"created_at\", :conditions=>[\"id = ?\", study.project_id])\n for prj in tmp_prj\n if (!is_public && !user_id.nil? && (user_id == prj.creator_id)) ||\n prj.is_public\n # If a public search - only allow Project.is_public = boolean [f | t]\n # Pickup project information - creator, create date, etc\n userinfo = User.find(:first, :conditions=>[\"id = ?\", prj.creator_id])\n tmp_prjs << [prj,userinfo]\n end\n end\n # Tag the publication with the first project and carry along the entire list of associated projects\n if tmp_prjs.size() > 0\n # construct the search hit context text\n qtext = pub.year\n \n ret_projs << [100,tmp_prjs[0][0],qtext,study,[pub],matchloc,tmp_prjs[0][1],tmp_prjs]\n found_pub_ids << pub.pmid\n end\n end\n end\n return ret_projs\n end",
"title": ""
},
{
"docid": "4cda55e885198a4ac9ff725df2639a12",
"score": "0.49952987",
"text": "def month_contributions\r\n # Query contributions only if not already done\r\n @contribs ||= @leaderboard.member_contributions(@username)\r\n end",
"title": ""
},
{
"docid": "2c79c1d0813d39bd9611f159da461b2a",
"score": "0.49951163",
"text": "def contributors\n return @contributors if @contributors\n\n contributors = {}\n\n walker.push(revision)\n walker.each do |commit|\n author = commit.author\n email = author[:email]\n if contributors[email]\n contributors[email] = {\n :author => author[:name],\n :count => contributors[email][:count] + 1\n }\n else\n contributors[email] = {\n :author => author[:name],\n :count => 1\n }\n end\n end\n\n @contributors = contributors\n end",
"title": ""
},
{
"docid": "0c6fa8f6194682c8fbe4d7091849f4a9",
"score": "0.49941924",
"text": "def publishers_worked_as_writer\n publishers.merge(Author.writer.only(:wheres))\n end",
"title": ""
},
{
"docid": "11b737ae1de0c947de38470c2d76f869",
"score": "0.49909532",
"text": "def all_authors(work, &block)\n authors = work.creator.uniq.compact\n block_given? ? authors.map(&block) : authors\n end",
"title": ""
},
{
"docid": "11b737ae1de0c947de38470c2d76f869",
"score": "0.49909532",
"text": "def all_authors(work, &block)\n authors = work.creator.uniq.compact\n block_given? ? authors.map(&block) : authors\n end",
"title": ""
},
{
"docid": "05ae930b115baa2173e0b8fc245e6989",
"score": "0.49817225",
"text": "def InsertPublication(publication, update_if_pmc_exists=false)\n puts \"InsertPublication: this shouldn't happen - publication was nil\" if publication.nil?\n raise \"InsertPublication: this shouldn't happen - publication was nil\" if publication.nil?\n thePub = nil\n medline = Bio::MEDLINE.new(publication) # convert retrieved format into the medline format\n reference = medline.reference\n pubmed_central_id = medline.pubmed_central\n pubmed_central_id = nil if pubmed_central_id.blank?\n if reference.pubmed.blank?\n puts \"pubmed_id was blank for reference #{medline.inspect}\"\n return nil\n end\n publication_date = check_date(medline.publication_date, medline.electronic_publication_date, medline.deposited_date, reference.pubmed)\n thePub = Abstract.find_by_pubmed_include_deleted(reference.pubmed)\n begin \n if thePub.nil? || thePub.id < 1 then\n thePub = Abstract.create!(\n :endnote_citation => reference.endnote, \n :abstract => reference.abstract,\n :authors => reference.authors.join(\"\\n\"),\n :full_authors => medline.full_authors,\n :publication_date => publication_date,\n :electronic_publication_date => medline.electronic_publication_date,\n :deposited_date => medline.deposited_date,\n :status => medline.status,\n :publication_status => medline.publication_status,\n :title => reference.title,\n :publication_type => medline.publication_type[0],\n :journal => medline.full_journal[0..253],\n :journal_abbreviation => medline.ta, #journal Title Abbreviation\n :issn => medline.issn,\n :volume => reference.volume,\n :issue => reference.issue,\n :pages => reference.pages,\n :year => reference.year,\n :pubmed => reference.pubmed,\n :pubmedcentral => pubmed_central_id,\n :url => reference.url,\n :mesh => reference.mesh.is_a?(String) ? reference.mesh : reference.mesh.join(\";\\n\")\n )\n else\n if thePub.publication_date != publication_date || thePub.status != medline.status || thePub.publication_status != medline.publication_status || (thePub.pubmedcentral != pubmed_central_id) || thePub.issn != medline.issn then\n thePub.endnote_citation = reference.endnote\n thePub.publication_date = publication_date if ! publication_date.blank?\n thePub.electronic_publication_date = medline.electronic_publication_date if ! medline.electronic_publication_date.blank?\n thePub.deposited_date = medline.deposited_date\n thePub.publication_status = medline.publication_status\n thePub.status = medline.status\n thePub.issn = medline.issn if ! medline.issn.blank?\n thePub.volume = reference.volume\n thePub.issue = reference.issue\n thePub.pages = reference.pages\n thePub.year = reference.year\n thePub.pubmed = reference.pubmed\n thePub.pubmedcentral = pubmed_central_id\n thePub.url = reference.url\n thePub.mesh = reference.mesh.is_a?(String) ? reference.mesh : reference.mesh.join(\";\\n\")\n thePub.save!\n end\n # HandleMeshTerms(thePub.mesh, thePub.id)\n end\n rescue ActiveRecord::RecordInvalid => exc\n if thePub.nil? then # something bad happened\n puts \"InsertPublication: unable to find or insert reference with the pubmed id of '#{reference.pubmed}. error message: #{exc.message}\"\n raise \"InsertPublication: unable to find or insert reference with the pubmed id of '#{reference.pubmed}. error message: #{exc.message}\"\n end\n end \n thePub\nend",
"title": ""
},
{
"docid": "caea8dc9242e7840a8cc812771592b89",
"score": "0.498118",
"text": "def join\n user = User.find_by(uuid: params[:user_uuid])\n project = Project.find_by(uuid: params[:uuid])\n if !user.nil? && !project.nil?\n Contributor.new(:uuid => UUIDTools::UUID.random_create.to_s, :project_id => project.id, :user_id => user.id).save!\n project.update_attributes(:contributors_count => (project.contributors_count + 1))\n render :json => { :message => 'Successfully added contributor' }\n else\n render :json => {:status => 500, :message => 'Could not add user as contributor'}\n end\n end",
"title": ""
},
{
"docid": "4cf66808c54729c17e37231d5044d3ce",
"score": "0.49778578",
"text": "def given_an_author_exists( args = {} )\n args[:name] = \"Susan Palmer\" unless args.has_key?( :name )\n Author.create!( args )\n end",
"title": ""
},
{
"docid": "73dcaadb63506bce257645fd66f58ff7",
"score": "0.49665612",
"text": "def contributions\n @user = User.find_by_id(params[:id])\n\n # See if we are only looking for specific contributions\n @filter = params[:filters].to_s.downcase\n\n if params[:page_size].nil?\n page_size = 10\n else\n page_size = params[:page_size].to_i\n end\n\n show_hidden = (!current_user.nil? && (current_user.id == @user.id)) || can_admin?(@user)\n\n @contributions = []\n @objtype = ''\n\n case @filter\n when 'my projects'\n @contributions = @user.projects.search(params[:search], show_hidden)\n @objtype = 'projects'\n when 'data sets'\n @contributions = @user.data_sets.search(params[:search])\n @objtype = 'data_sets'\n when 'visualizations'\n @contributions = @user.visualizations.search(params[:search], show_hidden)\n @objtype = 'visualizations'\n when 'liked projects'\n @contributions = []\n @user.likes.each do |like|\n y = Project.where('(lower(title) LIKE lower(?)) AND (id = ?)', \"%#{params[:search]}%\",\n like.project_id).first || next\n next if y.hidden == true && !can_edit?(y)\n @contributions << y\n end\n @objtype = 'likes'\n end\n\n @sort = if params[:sort].nil?\n 'create dsc'\n else\n params[:sort].to_s.downcase\n end\n\n if @contributions.is_a? Array\n case @sort\n when 'create asc'\n @contributions.sort! { |l, r| l.created_at.to_s.downcase <=> r.created_at.to_s.downcase }\n when 'create dsc'\n @contributions.sort! { |l, r| r.created_at.to_s.downcase <=> l.created_at.to_s.downcase }\n when 'title asc'\n @contributions.sort! { |l, r| l.title.downcase <=> r.title.downcase }\n when 'title dsc'\n @contributions.sort! { |l, r| r.title.downcase <=> l.title.downcase }\n else\n @contributions.sort! { |l, r| r.created_at.downcase <=> l.created_at.downcase }\n end\n else\n sort_type = case @sort\n when 'create asc' then \"#{@objtype}.created_at ASC\"\n when 'create dsc' then \"#{@objtype}.created_at DESC\"\n when 'title asc' then 'lower(title) ASC'\n when 'title dsc' then 'lower(title) DESC'\n end\n @contributions = @contributions.order(sort_type).all\n end\n\n page = params[:page].to_i\n\n if @contributions.length == 0\n @total_pages = 0\n else\n @total_pages = (@contributions.length / page_size).ceil + 1\n end\n\n @last_page = false\n if page + 1 == @total_pages.to_i\n @last_page = true\n end\n\n @contributions = @contributions[page * page_size..(page * page_size) + (page_size - 1)]\n\n respond_to do |format|\n format.html { render partial: 'display_contributions' }\n end\n end",
"title": ""
},
{
"docid": "5aa552772503e7d94d1ae4769f876a26",
"score": "0.49625757",
"text": "def link_authors_and_submissions_creating_authorships\n Submission.transaction do\n umin_rows_each do |ur|\n\n # Find depending objects\n submission_obj = Submission.find_by_submission_number_and_conference_tag(ur.submission_number, @conference.database_tag)\n\n raise \"No submission in DB for submission_number: #{ur.submission_number}\" unless submission_obj\n ur.authors.each.with_index do |author, index|\n # Find depending objects\n author_obj = Author.nayose_find({:en_name => author[:en_name], \n :jp_name => author[:jp_name]},\n @conference)\n raise \"No author in DB for en_name: #{author[:en_name].inspect}, jp_name: #{author[:jp_name].inspect}\" unless author_obj\n # Create new objects\n as = Authorship.in_conference(@conference).find_or_create_by_author_id_and_submission_id(author_obj.id, submission_obj.id)\n as.batch_import = true\n as.update_attributes!(:position => index + 1, # acts_as_list starts with position 1\n :is_presenting_author => author[:is_presenting_author],\n :en_name => author[:en_name],\n :jp_name => author[:jp_name],\n :affiliations => author[:affiliations])\n output_error_unless_persisted(as)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ea43f4c4af1b48fce0e7219bf3f7c84b",
"score": "0.49606413",
"text": "def member_contributions(username)\r\n query = \"created:#{@event_date} author:#{username} -label:invalid\"\r\n contribs = @github.search.issues(query)\r\n contribs.body.items.reject { |i| i.pull_request.nil? }\r\n end",
"title": ""
},
{
"docid": "b5080192554787f34829c41c29612940",
"score": "0.49488068",
"text": "def compute_contributions_and_distributions\n\n #\n # This follows the instructions in Pub. 590-B, \"Contribution and\n # distribution in the same year\".\n #\n @pub590b_w1_1 = compute_form(\"Pub. 590-B Worksheet 1-1\")\n\n # Step 8 of the instructions: copies 590-B W1-1 line 9 or 11, coded as\n # :taxable_distrib, to Form 8606 line 15a. (Also computes 15b and 15c\n # incidentally.)\n line['8606_15a'] = @pub590b_w1_1.line[:taxable_distrib]\n line['8606_15b'] = BlankZero # Qualified disaster distributions\n line['8606_15c'] = line['8606_15a'] - line['8606_15b']\n\n # This will compute lines 18 and 25c\n compute_8606_parts_ii_iii_for_contrib_distrib\n\n line[:taxable_distrib] = sum_lines(*%w(8606_15c 8606_18 8606_25c))\n\n @contrib_continuation = proc {\n compute_contributions_and_distributions_continuation\n }\n end",
"title": ""
},
{
"docid": "eee9a88b75800f33b118c6c7b535a0cb",
"score": "0.49474832",
"text": "def add_person(creator)\n # is this an orcid?\n trimmed_value = trim_orcid_url(creator)\n if valid_orcid?(trimmed_value)\n find_or_create_orcid(creator)\n else\n find_or_create_person(creator)\n end\n end",
"title": ""
},
{
"docid": "9a7f91e3a03cd8cc3546b0ff0fe6a97b",
"score": "0.49471894",
"text": "def contributions\n \n @user = User.find_by_username(params[:id])\n \n #See if we are only looking for specific contributions\n @filters = params[:filters].to_s.downcase\n @filters.tr!(' ', '_')\n \n if @filters == \"all\"\n @filters = [ \"projects\", \"data_sets\", \"visualizations\", \"media\", \"tutorials\" ]\n end\n \n if params[:page_size].nil?\n page_size = 10\n else\n page_size = params[:page_size].to_i\n end\n \n show_hidden = @cur_user.id == @user.id\n \n #Only grab the contributions we are currently interested in\n if [email protected]?\n if @filters.include? \"projects\"\n @projects = @user.projects.search(params[:search], show_hidden)\n end\n \n if @filters.include? \"data_sets\"\n @dataSets = @user.data_sets.search(params[:search], show_hidden)\n end\n \n if @filters.include? \"media\"\n @mediaObjects = @user.media_objects.search(params[:search], show_hidden)\n end\n\n if @filters.include? \"visualizations\"\n @visualizations = @user.visualizations.search(params[:search], show_hidden)\n end\n \n if @filters.include? \"tutorials\"\n @tutorials = @user.tutorials.search(params[:search], show_hidden)\n end\n else\n if [email protected](:projects).nil?\n @projects = @user.projects.search(params[:search], show_hidden)\n end\n if [email protected](:data_sets).nil?\n @dataSets = @user.data_sets.search(params[:search], show_hidden)\n end\n if [email protected](:media_objects).nil?\n @mediaObjects = @user.media_objects.search(params[:search], show_hidden)\n end\n if [email protected](:visualizations).nil?\n @visualizations = @user.visualizations.search(params[:search], show_hidden)\n end\n if [email protected](:tutorials).nil?\n @tutorials = @user.tutorials.search(params[:search], show_hidden)\n end\n end\n\n @contributions = @projects.to_a + @dataSets.to_a + @mediaObjects.to_a + @visualizations.to_a + @tutorials.to_a\n \n #Set up the sort order\n if !params[:sort].nil?\n sort = params[:sort]\n else\n sort = \"DESC\"\n end\n \n if sort==\"ASC\"\n @contributions.sort! {|a,b| a.created_at <=> b.created_at} \n else\n @contributions.sort! {|a,b| b.created_at <=> a.created_at}\n end\n \n page = params[:page].to_i\n \n if @contributions.length == 0\n @totalPages = 0\n else\n @totalPages = (@contributions.length/page_size).ceil + 1\n end \n\n @lastPage = false\n if page+1 == @totalPages.to_i\n @lastPage = true\n end\n \n @contributions = @contributions[page*page_size..(page*page_size)+(page_size - 1)]\n \n if params[:template].nil?\n \n respond_to do |format|\n format.html { render partial: \"display_contributions\" }\n end\n\n else\n\n respond_to do |format|\n format.html { render partial: params[:template] }\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "d0038115a15810ee58904cc3a9e7a791",
"score": "0.49470046",
"text": "def process_author(author, options = {})\n raise(ArgumentError, 'author must be an Author') unless author.is_a? Author\n log_info(author, \"processing author #{author.id}\")\n uids = process_uids(author, WebOfScience::QueryAuthor.new(author, options).uids)\n log_info(author, \"processed author #{author.id}: #{uids.count} new publications\")\n uids\n rescue StandardError => err\n NotificationManager.error(err, \"#{self.class} - harvest failed for author #{author.id}\", self)\n end",
"title": ""
},
{
"docid": "d2df4ea4be3844996ea2cc31b60b0040",
"score": "0.49439228",
"text": "def scanPub(unit, item)\n ark = item['id']\n pubID = item['localIDs'].select{ |pair| pair['scheme'] == 'OA_PUB_ID' }.dig(0, 'id')\n pubID or raise(\"can't find OA_PUB_ID in pub whose source is 'oa_harvester'\")\n dateAdded = item['added']\n begin\n\n # Retrieve grant info from Elements\n resp = HTTParty.get(\"#{$apiInfo[:host]}/publications/#{pubID}/grants?detail=full\",\n :basic_auth => { :username => $apiInfo[:username], :password => $apiInfo[:password] })\n if resp.code == 200\n data = Nokogiri::XML(resp.body).remove_namespaces!\n\n # On QA some of the pubs are radically different due to subsequent crawling. As a workaround,\n # if less than half the title words are the same, skip the pub.\n if $apiInfo[:host] =~ /qa/\n feedTitle = data.at(\"title\").text.sub(/.*related to the publication: /, '')\n words1 = extractWords(feedTitle)\n words2 = extractWords(item['title'])\n if (words1 & words2).size <= ((words1.size + words2.size)/4)\n puts \" #{ark} (pub #{pubID}): skipping much-changed title: #{item['title'].inspect} vs #{feedTitle.inspect}\"\n return\n end\n end\n\n # Parse it out and see if the grants are the same (if so we can skip)\n feedGrants = parseFeedGrants(data)\n itemGrants = parseItemGrants(item)\n feedSum = feedGrants.map{ |grant| grant[:name] }.sort.uniq.join(\"||\")\n itemSum = itemGrants.map{ |grant| grant[:name] }.sort.uniq.join(\"||\")\n if feedSum == itemSum\n #puts \"#{ark}: funding matches.\"\n return\n end\n\n # We have new grant info. Update it in the item and add a spreadsheet line.\n $resultsSpreadsheet.print(\"#{unit}\\t#{ark}\\t#{dateAdded}\\t#{pubID}\\t\")\n if itemSum.empty?\n puts \"#{ark} (pub #{pubID}): funding added: #{feedSum.inspect}\"\n $resultsSpreadsheet.puts(\"added\\t#{feedSum.sub('\"', \"'\").inspect}\")\n elsif feedSum.empty?\n puts \"#{ark} (pub #{pubID}): funding removed: #{itemSum.inspect}\"\n $resultsSpreadsheet.puts(\"removed\\t#{itemSum.sub('\"', \"'\").inspect}\")\n else\n puts \"#{ark} (pub #{pubID}): funding changed from #{itemSum.inspect} to #{feedSum.inspect}.\"\n $resultsSpreadsheet.puts(\"changed\\tfrom #{itemSum.sub('\"', \"'\").inspect} to #{feedSum.sub('\"', \"'\").inspect}\")\n end\n $resultsSpreadsheet.flush\n if $testMode\n puts \" (not changing due to --test mode)\"\n elsif $goMode\n updateGrants(ark, feedGrants)\n puts \" Updated.\"\n else\n puts \"Error: either --test or --go must be specified.\"\n exit 1\n end\n end\n rescue\n puts \"Error context: ark=#{ark} pubID=#{pubID}\"\n raise\n end\nend",
"title": ""
},
{
"docid": "82b690fa89e611aedf01ecfac00ac837",
"score": "0.4940986",
"text": "def accept\n transaction do\n organization.contributors.create!(user: user)\n\n ContributorRequestResponse.accept!(self)\n end\n rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique => e\n Rails.logger.error(e.message)\n else\n yield if block_given?\n end",
"title": ""
},
{
"docid": "f2326cd765fc82e19081e8286d8f8742",
"score": "0.4937929",
"text": "def contribs_direct_commits(repo:, since:, commits_to_exclude: nil)\n contributions = []\n\n @client.commits_since(repo, since, per_page: MAX_COMMITS).each do |commit|\n next if commits_to_exclude && commits_to_exclude.include?(commit[:sha])\n\n description = commit[:commit][:message]\n next if description =~ /Merge pull request \\#(\\d+)/\n next if description =~ /Merge branch '(.*)'/\n\n author = commit[:author][:login]\n date = commit[:commit][:author][:date]\n url = commit[:html_url]\n\n contributions << Contribution.new(\n author: author,\n description: description,\n date: date,\n url: url\n )\n end\n\n contributions\nend",
"title": ""
},
{
"docid": "3e18a9078580dfb2ec0916356bf3291d",
"score": "0.4923117",
"text": "def get_authors(material)\n if material.key?('contributors')\n material['contributors']\n elsif material.key?('contributions')\n material['contributions']['authorship']\n else\n []\n end\nend",
"title": ""
},
{
"docid": "88b0ea1278562aa5bf9d6d4485e9cb0e",
"score": "0.49225068",
"text": "def test_authors_and_editors\n for model in [LocationDescription, NameDescription]\n case model.name\n when 'LocationDescription'\n obj = model.new(:location_id => 1, :license_id => 1)\n a, e = 50, 5\n set_nontrivial = 'notes='\n when 'NameDescription'\n obj = model.new(:name_id => 1, :license_id => 1)\n a, e = 100, 10\n set_nontrivial = 'gen_desc='\n end\n\n msg = \"#{model}: Initial conditions.\"\n assert_authors_and_editors(obj, [], [], msg)\n assert_contributions(0, 0, 0, 0, msg)\n\n # Have Rolf create minimal object.\n User.current = @rolf\n assert_save(obj)\n msg = \"#{model}: Rolf should not be made author after minimal create.\"\n assert_authors_and_editors(obj, [], ['rolf'], msg)\n assert_contributions(e, 0, 0, 0, msg)\n\n # Have Rolf make a trivial change.\n User.current = @rolf\n obj.license_id = 2\n obj.save\n msg = \"#{model}: Rolf should still be editor after trivial change.\"\n assert_authors_and_editors(obj, [], ['rolf'], msg)\n assert_contributions(e, 0, 0, 0, msg)\n\n # Delete editors and author so we can test changes to old object that\n # is grandfathered in without any editors or authors.\n User.current = nil # (prevents AbstractModel from screwing up contributions)\n obj.before_destroy\n obj.authors.clear\n obj.editors.clear\n msg = \"#{model}: Just deleted authors and editors.\"\n assert_authors_and_editors(obj, [], [], msg)\n assert_contributions(0, 0, 0, 0, msg)\n\n # Now have Mary make a trivial change. Should have same result as when\n # creating above.\n User.current = @mary\n obj.license_id = 1\n obj.save\n msg = \"#{model}: Mary should not be made author after trivial change to authorless object.\"\n assert_authors_and_editors(obj, [], ['mary'], msg)\n assert_contributions(0, e, 0, 0, msg)\n\n # Now have Dick make a non-trivial change.\n obj.send(set_nontrivial, 'This is weighty stuff...')\n User.current = @dick\n obj.save\n msg = \"#{model}: No authors, so Dick should become author.\"\n assert_authors_and_editors(obj, ['dick'], ['mary'], msg)\n assert_contributions(0, e, a, 0, msg)\n\n # Now have Katrina make another non-trivial change.\n obj.send(set_nontrivial, 'This is even weightier stuff...')\n User.current = @katrina\n obj.save\n msg = \"#{model}: Already authors, so Katrina should become editor.\"\n assert_authors_and_editors(obj, ['dick'], ['mary', 'katrina'], msg)\n assert_contributions(0, e, a, e, msg)\n\n # Now force Dick and Mary both to be both authors and editors.\n # Should equalize the two cases at last.\n obj.add_author(@dick)\n obj.add_author(@mary)\n obj.add_editor(@dick)\n obj.add_editor(@mary)\n msg = \"#{model}: Both Dick and Mary were just made authors supposedly.\"\n assert_authors_and_editors(obj, ['dick', 'mary'], ['katrina'], msg)\n assert_contributions(0, a, a, e, msg)\n\n # And demote an author to test last feature.\n obj.remove_author(@dick)\n msg = \"#{model}: Dick was just demoted supposedly.\"\n assert_authors_and_editors(obj, ['mary'], ['dick', 'katrina'], msg)\n assert_contributions(0, a, e, e, msg)\n\n # Delete it to restore all contributions.\n obj.destroy\n msg = \"#{model}: Just deleted the object.\"\n assert_contributions(0, 0, 0, 0, msg)\n end\n end",
"title": ""
},
{
"docid": "4a4ba36d75cc76da744d9ffd5e147467",
"score": "0.4919189",
"text": "def BuildCoauthors(investigator)\n coauthor_ids = investigator.abstracts.collect{|x| x.investigator_abstracts.collect(&:investigator_id)}.flatten.uniq\n coauthor_ids.delete(investigator.id)\n coauthor_ids.each do |coauthor_id|\n colleague=Investigator.include_deleted(coauthor_id)\n next if !colleague.deleted_at.nil?\n citation_overlap = investigator.abstracts.collect{|x| x.id}.flatten & colleague.abstracts.collect{|x| x.id}.flatten\n citation_overlap = citation_overlap.uniq.compact\n InsertUpdateInvestigatorColleague(investigator.id,coauthor_id,citation_overlap)\n InsertUpdateInvestigatorColleague(coauthor_id,investigator.id,citation_overlap)\n end\nend",
"title": ""
},
{
"docid": "578b7f71c6f51b07c97f75cc43f919fa",
"score": "0.490813",
"text": "def handle_creator(tree)\n predicate = 'dcterms:creator'\n predicate_term = RDF::DC.creator\n creators = tree.xpath(\"./#{predicate}\", PREFIXES)\n creators.each do |creator|\n # A reference an OWMS uri (http://standaarden.overheid.nl/owms)\n court_uri = creator['resourceIdentifier']\n unless court_uri\n # If there's no OWMS uri, the site falls back to a psi.rechtspraak-prefixed uri\n court_uri = creator['psi:resourceIdentifier']\n unless court_uri\n puts \"WARNING: Could not find a resourceIdentifier\"\n end\n end\n tag_content = creator.text.strip\n\n if court_uri\n court_uri=create_typed_value(court_uri)\n add_statement(@work_uri, predicate_term, court_uri)\n\n # Give the court a human-readable name\n if tag_content.length > 0\n add_statement(court_uri, RDF::RDFS.label, tag_content)\n end\n else\n if tag_content.length > 0\n # Court only has a string name, no http uri\n add_statement(@work_uri, predicate_term, tag_content)\n puts \"WARNING: Court #{tag_content} only has a string name, no http uri\"\n else\n puts 'WARNING: Court has no name, and no http uri'\n end\n end\n\n # The relation has a human-readable label\n if creator['rdfs:label'] and creator['rdfs:label'].strip.length > 0\n add_statement(predicate_term, RDF::RDFS.label, creator['rdfs:label'].strip)\n end\n end\n end",
"title": ""
},
{
"docid": "eead1888a34e88da42943a82f5525028",
"score": "0.49033305",
"text": "def set_pub_citation(record)\n pub_citation = []\n Traject::MarcExtractor.cached('260:264').collect_matching_lines(record) do |field, spec, extractor|\n a_pub_info = nil\n b_pub_info = nil\n pub_info = \"\"\n field.subfields.each do |s_field|\n a_pub_info = Traject::Macros::Marc21.trim_punctuation(s_field.value).strip if s_field.code == 'a'\n b_pub_info = Traject::Macros::Marc21.trim_punctuation(s_field.value).strip if s_field.code == 'b'\n end\n\n # Build publication info string and add to citation array.\n pub_info += a_pub_info unless a_pub_info.nil?\n pub_info += \": \" if !a_pub_info.nil? and !b_pub_info.nil?\n pub_info += b_pub_info unless b_pub_info.nil?\n pub_citation << pub_info if !pub_info.empty?\n end\n pub_citation\n end",
"title": ""
},
{
"docid": "3af63eedfbbab8d367ca63491c8ba804",
"score": "0.49007723",
"text": "def attach_contributor(hash:, line:)\n return hash unless hash.present? && line.present? && line['contributor_name'].present?\n\n role = process_role(line: line)\n orcid = process_orcid(line: line)\n\n hash[:contributor] = [] unless hash[:contributor].present?\n # Select the contributor\n contributors = hash[:contributor].select do |c|\n (c.fetch(:contributor_id, {})[:identifier] == orcid && orcid.present?) ||\n (c[:name] == line['contributor_name'])\n end\n found = contributors.any?\n\n contributor = contributors.first || { role: [] }\n contributor[:name] = line['contributor_name'] if line['contributor_name'].present? && !contributor[:name].present?\n contributor[:contributor_id] = { type: 'ORCID', identifier: orcid } unless contributor[:contributor_id].present?\n contributor[:role] << role unless contributor[:role].include?(role)\n contributor[:affiliation] = { name: process_affiliation(line: line) } if line['affiliation'].present? && !contributor[:affiliation].present?\n\n # Add the contributor if it is new\n hash[:contributor] << contributor unless found\n hash\n end",
"title": ""
},
{
"docid": "07a33d35d208b0acd595bd031fc434b4",
"score": "0.48982877",
"text": "def sync_publication_hash_and_db\n rebuild_authorship\n sync_identifiers_in_pub_hash\n set_sul_pub_id_in_hash if persisted?\n update_formatted_citations\n @pubhash_needs_update = false\n self\n end",
"title": ""
},
{
"docid": "85907a8f1cd48ab8ebe226f307d0ec1b",
"score": "0.48796648",
"text": "def process_uids(author, uids)\n raise(ArgumentError, 'author must be an Author') unless author.is_a? Author\n raise(ArgumentError, 'uids must be Enumerable') unless uids.is_a? Enumerable\n\n log_info(author, \"#{uids.count} UIDs for search\")\n # TODO: get all the links for the UIDs and modify contribution checks to use all identifiers\n uids -= author_contributions(author, uids)\n log_info(author, \"#{uids.count} UIDs without contributions\")\n return [] if uids.empty?\n\n process_records author, queries.retrieve_by_id(uids)\n end",
"title": ""
},
{
"docid": "63c47de8524ad3ad0f1353453b624bea",
"score": "0.4876636",
"text": "def process_uids(author, uids)\n raise(ArgumentError, 'author must be an Author') unless author.is_a? Author\n raise(ArgumentError, 'uids must be Enumerable') unless uids.is_a? Enumerable\n log_info(author, \"#{uids.count} UIDs for search\")\n # TODO: get all the links for the UIDs and modify contribution checks to use all identifiers\n uids -= author_contributions(author, uids)\n log_info(author, \"#{uids.count} UIDs without contributions\")\n return [] if uids.empty?\n process_records author, queries.retrieve_by_id(uids)\n end",
"title": ""
},
{
"docid": "f78a243c51be7527a33b3d66652e6705",
"score": "0.4872139",
"text": "def resolve(author:)\n Author.create(author.to_h)\n end",
"title": ""
},
{
"docid": "d6de8536bc060a391b6f4520eb539341",
"score": "0.48713887",
"text": "def create_or_update_publication_emails(emails, publication)\n authors = emails.map { |e| { email: e } }\n publication.add_author_emails(authors)\n end",
"title": ""
},
{
"docid": "19bd528a555f43be5ad0f68d9bac7825",
"score": "0.48660225",
"text": "def save_creatorships(creation)\n if !creation.authors.blank?\n new_authors = (creation.authors - creation.pseuds).uniq\n new_authors.each do |pseud|\n creation.pseuds << pseud\n if creation.is_a?(Chapter) && creation.work\n creation.work.pseuds << pseud unless creation.work.pseuds.include?(pseud)\n elsif creation.is_a?(Work)\n if creation.chapters.first\n creation.chapters.first.pseuds << pseud unless creation.chapters.first.pseuds.include?(pseud)\n end\n creation.series.each { |series| series.pseuds << pseud unless series.pseuds.include?(pseud) } \n end\n end\n end\n if creation.toremove\n creation.pseuds.delete(creation.toremove)\n if creation.is_a?(Work)\n creation.chapters.first.pseuds.delete(creation.toremove)\n end\n end\n end",
"title": ""
},
{
"docid": "f5b0b4394029cfb99ccaa606a6d6b6c4",
"score": "0.48634127",
"text": "def InsertPublication(publication, update_if_pmc_exists=false)\n puts \"InsertPublication: this shouldn't happen - publication was nil\" if publication.nil?\n raise \"InsertPublication: this shouldn't happen - publication was nil\" if publication.nil?\n thePub = nil\n medline = Bio::MEDLINE.new(publication) # convert retrieved format into the medline format\n reference = medline.reference\n pubmed_central_id = medline.pubmed_central\n pubmed_central_id = nil if pubmed_central_id.blank?\n thePub = Abstract.find_by_pubmed(reference.pubmed)\n begin \n if thePub.nil? || thePub.id < 1 then\n thePub = Abstract.create!(\n :endnote_citation => reference.endnote, \n :abstract => reference.abstract,\n :authors => reference.authors.join(\"\\n\"),\n :full_authors => medline.full_authors,\n :publication_date => medline.publication_date,\n :electronic_publication_date => medline.electronic_publication_date,\n :deposited_date => medline.deposited_date,\n :status => medline.status,\n :publication_status => medline.publication_status,\n :title => reference.title,\n :publication_type => medline.publication_type[0],\n :journal => medline.full_journal[0..253],\n :journal_abbreviation => medline.ta, #journal Title Abbreviation\n :volume => reference.volume,\n :issue => reference.issue,\n :pages => reference.pages,\n :year => reference.year,\n :pubmed => reference.pubmed,\n :pubmedcentral => pubmed_central_id,\n :url => reference.url,\n :mesh => reference.mesh.join(\";\\n\")\n )\n else\n if thePub.publication_date != medline.publication_date || thePub.status != medline.status || thePub.publication_status != medline.publication_status || (update_if_pmc_exists and ! pubmed_central_id.blank?) then\n thePub.endnote_citation = reference.endnote\n thePub.publication_date = medline.publication_date\n thePub.electronic_publication_date = medline.electronic_publication_date\n thePub.deposited_date = medline.deposited_date\n thePub.publication_status = medline.publication_status\n thePub.status = medline.status\n thePub.volume = reference.volume\n thePub.issue = reference.issue\n thePub.pages = reference.pages\n thePub.year = reference.year\n thePub.pubmed = reference.pubmed\n thePub.pubmedcentral = pubmed_central_id\n thePub.url = reference.url\n thePub.mesh = reference.mesh.join(\";\\n\")\n thePub.save!\n end\n # HandleMeshTerms(thePub.mesh, thePub.id)\n end\n rescue ActiveRecord::RecordInvalid\n if thePub.nil? then # something bad happened\n puts \"InsertPublication: unable to find or insert reference with the pubmed id of '#{reference.pubmed}\"\n raise \"InsertPublication: unable to find or insert reference with the pubmed id of '#{reference.pubmed}\"\n end\n end \n thePub\nend",
"title": ""
},
{
"docid": "5324963adec1aaf4ee148fbaacf2389c",
"score": "0.48538986",
"text": "def get_drive_by_authors\n git_revlist = `git -C #{@repo} rev-list --all --pretty=\"%ae\"`\n authors = git_revlist.split(/commit .+\\n/).reject {|a| a.empty? }\n authors = authors.map { |a| a.downcase.strip }\n counts = Hash.new(0)\n authors.each { |a| counts[a] += 1 }\n counts.select { |a, count| count == 1 }.keys\n end",
"title": ""
},
{
"docid": "5bd3291ba6c871e9cd919111a3ebb1de",
"score": "0.4846208",
"text": "def authors\n memoize(:authors) do\n # ordered list of maker fields we're willing to use for author, when we\n # find one with elements, we stop and use those.\n first_present_field_values(%w{creator_of_work author artist photographer engraver interviewer}).collect do |str_name|\n parse_name(str_name)\n end\n end\n end",
"title": ""
},
{
"docid": "8048a7aa059a91cfdeb252acb20130d9",
"score": "0.4844393",
"text": "def contribution(project)\n \tcontributions.find_by(participation: participation(project))\n end",
"title": ""
},
{
"docid": "7be1eb54ea547dcec06aa394b15bb0e9",
"score": "0.48431823",
"text": "def add_authors(current_user)\n claims.each do |claim|\n if claim.author.nil?\n claim.author = current_user\n save\n end\n end\n end",
"title": ""
},
{
"docid": "fb9322cf755cd26a7272577c67bd1d7f",
"score": "0.48402354",
"text": "def fetch_publications!(type)\n puts \"\\n\\n============= Fetching #{type.to_s.cyan} =============\\n\\n\"\n page = 1\n publications = []\n duplicated_publications = []\n\n url = SkoobUrls.shelf_url(user_id: user.skoob_user_id, page: page, type: type)\n data = read_url(url)\n\n while true do\n puts \"PAGE #{page}\"\n\n publications += data[:response].map do |item|\n edition = item[:edicao]\n\n publication = Publication.new(\n skoob_user_id: @user.skoob_user_id,\n title: edition[:titulo],\n author: edition[:autor],\n publisher: edition[:editora],\n year: edition[:ano].to_i,\n skoob_publication_id: edition[:id],\n isbn: fetch_isbn(edition[:url]),\n publication_type: Publication.publication_types[type.to_s.singularize],\n date_read: item[:dt_leitura].to_s.split(' ')[0],\n rating: item[:ranking]\n )\n\n if Publication.exists?(skoob_user_id: @user.skoob_user_id, skoob_publication_id: edition[:id])\n duplicated_publications << publication\n puts \"Publication #{edition[:titulo]} already exists...\".red\n else\n publication.save!\n puts \"#{publication.title.yellow}: #{publication.isbn}\"\n end\n end.compact\n\n page += 1\n\n url = SkoobUrls.shelf_url(user_id: user.skoob_user_id, page: page, type: type)\n data = read_url(url)\n\n break if data[:response].empty?\n end\n\n {\n publications: publications,\n duplicated: duplicated_publications\n }\n end",
"title": ""
},
{
"docid": "aec4eb8bb4e814147c489ad737f1040e",
"score": "0.48327824",
"text": "def test_authors_and_editors\n [LocationDescription, NameDescription].each do |model|\n case model.name\n when \"LocationDescription\"\n obj = model.new(location_id: locations(:albion).id,\n license_id: licenses(:ccnc25).id)\n a = 50\n e = 5\n set_nontrivial = \"notes=\"\n when \"NameDescription\"\n obj = model.new(name_id: names(:fungi).id,\n license_id: licenses(:ccnc25).id)\n a = 100\n e = 10\n set_nontrivial = \"gen_desc=\"\n end\n\n msg = \"#{model}: Initial conditions.\"\n assert_authors_and_editors(obj, [], [], msg)\n assert_contributions(0, 0, 0, 0, msg)\n\n # Have Rolf create minimal object.\n User.current = rolf\n assert_save(obj)\n msg = \"#{model}: Rolf should not be made author after minimal create.\"\n assert_authors_and_editors(obj, [], [\"rolf\"], msg)\n assert_contributions(e, 0, 0, 0, msg)\n\n # Have Rolf make a trivial change.\n User.current = rolf\n obj.license_id = 2\n obj.save\n msg = \"#{model}: Rolf should still be editor after trivial change.\"\n assert_authors_and_editors(obj, [], [\"rolf\"], msg)\n assert_contributions(e, 0, 0, 0, msg)\n\n # Delete editors and author so we can test changes to old object that\n # is grandfathered in without any editors or authors.\n User.current = nil # (stops AbstractModel from screwing up contributions)\n obj.update_users_and_parent\n obj.authors.clear\n obj.editors.clear\n msg = \"#{model}: Just deleted authors and editors.\"\n assert_authors_and_editors(obj, [], [], msg)\n assert_contributions(0, 0, 0, 0, msg)\n\n # Now have Mary make a trivial change. Should have same result as when\n # creating above.\n User.current = mary\n obj.license_id = 1\n obj.save\n msg = \"#{model}: Mary should not be made author \" \\\n \"after trivial change to authorless object.\"\n assert_authors_and_editors(obj, [], [\"mary\"], msg)\n assert_contributions(0, e, 0, 0, msg)\n\n # Now have Dick make a non-trivial change.\n obj.send(set_nontrivial, \"This is weighty stuff...\")\n User.current = dick\n obj.save\n msg = \"#{model}: No authors, so Dick should become author.\"\n assert_authors_and_editors(obj, [\"dick\"], [\"mary\"], msg)\n assert_contributions(0, e, a, 0, msg)\n\n # Now have Katrina make another non-trivial change.\n obj.send(set_nontrivial, \"This is even weightier stuff...\")\n User.current = katrina\n obj.save\n msg = \"#{model}: Already authors, so Katrina should become editor.\"\n assert_authors_and_editors(obj, [\"dick\"], %w[mary katrina], msg)\n assert_contributions(0, e, a, e, msg)\n\n # Now force Dick and Mary both to be both authors and editors.\n # Should equalize the two cases at last.\n obj.add_author(dick)\n obj.add_author(mary)\n obj.add_editor(dick)\n obj.add_editor(mary)\n msg = \"#{model}: Both Dick and Mary were just made authors supposedly.\"\n assert_authors_and_editors(obj, %w[dick mary], [\"katrina\"], msg)\n assert_contributions(0, a, a, e, msg)\n\n # And demote an author to test last feature.\n obj.remove_author(dick)\n msg = \"#{model}: Dick was just demoted supposedly.\"\n assert_authors_and_editors(obj, [\"mary\"], %w[dick katrina], msg)\n assert_contributions(0, a, e, e, msg)\n\n # Delete it to restore all contributions.\n obj.destroy\n msg = \"#{model}: Just deleted the object.\"\n assert_contributions(0, 0, 0, 0, msg)\n end\n end",
"title": ""
},
{
"docid": "9117e9efa14b6a36c7d8ee035d3d76a3",
"score": "0.48326",
"text": "def try_author_insertion row, existing_authors\n\t\tperson_id = nil\n\t\tif existing_authors.keys.include? row[2].strip\n\t\t\tputs row[2]\n\t\t\tperson_id = existing_authors[row[2]]\n\t\telse\n\t\t\t# New id is always one higher than the last entered id\n\t\t\tif existing_authors.count > 0 # Handle first entry\n\t\t\t\tperson_id = existing_authors.values.max + 1\n\t\t\telse\n\t\t\t\tperson_id = 0\n\t\t\tend\n\t\t\texisting_authors[row[2].strip] = person_id\n\t\t\tinsert_person(row[2].strip, person_id)\n\t\tend\n\t\tinsert(\"written_by\", {\n\t\t\t:author_id \t=> person_id,\n\t\t\t:book_id\t\t=> row[0]\n\t\t})\n\t\treturn existing_authors\n\tend",
"title": ""
},
{
"docid": "61b6ce5e0ee7f5e7203396173d17e433",
"score": "0.48286435",
"text": "def test_one_to_many_with_container\n expected_authors = [\"David Thomas\",\"Andrew Hunt\",\"Chad Fowler\"]\n book = BookWithContributions.parse(fixture(:book_with_contributions))\n assert_equal(\"Programming Ruby - 2nd Edition\", book.title)\n book.contributions.each do |contributor|\n assert expected_authors.include?(contributor.name)\n end\n end",
"title": ""
},
{
"docid": "2606616ac0240890ca1f3e0abdd172fc",
"score": "0.48225415",
"text": "def findProjectsByAuthor(exclude_prjids,matchloc,query_string,is_public)\n user_id = nil;\n if !current_user.nil?\n user_id = current_user.id\n end\n # Construct the SQL command from the query_string entered and database table column name to search on\n sqlcmd = constructSQL(query_string,\"lname\")\n qterms = getQueryTerms(query_string)\n puts \">>>>>>>>>>> findProjectsByAuthor sql \"+sqlcmd+\" qterms \"+qterms.to_s\n \n\tret_projs = Array.new\n tmp_users = User.find(:all, :conditions=>sqlcmd)\n found_prj_ids = Array.new\n for userinfo in tmp_users\n tmp_prj = Project.find(:all, :conditions=>[\"creator_id = ?\", userinfo.id])\n for prj in tmp_prj\n if !exclude_prjids.include?(prj.id) &&\n !found_prj_ids.include?(prj.id)\n # Pickup project information - creator, create date, etc\n userinfo = User.find(:first, :conditions=>[\"id = ?\", prj.creator_id])\n # If a public search - only allow Project.is_public = boolean [f | t]\n if (!is_public && !user_id.nil? && (user_id == prj.creator_id)) ||\n prj.is_public\n \n # construct the search hit context text\n qtext = qtext = toContextText(userinfo.lname.to_s,qterms);\n \n # Pickup the study_id so we can pull associated primary and secondary publications\n study = Study.find(:first, :conditions=>[\"project_id = ?\", prj.id])\n if !study.nil?\n prim_pub = PrimaryPublication.find(:all, :order=> \"year\", :conditions=>[\"study_id = ?\", study.id])\n ret_projs << [100, prj, qtext, study, prim_pub, matchloc, userinfo]\n else\n ret_projs << [100, prj, qtext, nil, nil, matchloc, userinfo]\n end\n found_prj_ids << prj.id\n end\n end\n end\n end\n return ret_projs\n end",
"title": ""
},
{
"docid": "818244ceb941c2338e969e718d968b3d",
"score": "0.48165238",
"text": "def build_author_report(parsed_list)\n build_report(parsed_list, [:citation, :authors], 'authors')\nend",
"title": ""
},
{
"docid": "2ea554f939c5ec714aa0275f1ad27936",
"score": "0.48107508",
"text": "def contributor(id_or_ids)\n if id_or_ids.kind_of? Array\n multiple_ids = true\n url = Base + 'contributor/' + id_or_ids.join(',')\n props = properties()\n if id_or_ids.size > props['contributor.max.ids'] \n contributors = []\n id_or_ids.each_slice(props['contributor.max.ids']) do |ids_slice|\n contributors = contributors + contributor(ids_slice)\n end\n return contributors\n end\n else\n multiple_ids = false\n id = id_or_ids.to_s\n if id == 'me'\n url = Base + 'contributor'\n else\n url = Base + 'contributor/' + id\n end\n end\n response = @fs_communicator.get(url)\n familytree = parse_response(response)\n if multiple_ids\n return familytree.contributors\n else\n return familytree.contributors.first\n end\n end",
"title": ""
},
{
"docid": "d263b9d0345a2520d293913136117469",
"score": "0.48066708",
"text": "def findContributor (name)\n if @userID == nil \n registerUser\n end\n\n body = \"<TEXT TYPE='NAME'>\" + name + \"</TEXT>\n <MODE>SINGLE_BEST</MODE>\n <OPTION>\n <PARAMETER>SELECT_EXTENDED</PARAMETER>\n <VALUE>IMAGE,MEDIAGRAPHY_IMAGES</VALUE>\n </OPTION>\"\n\n data = constructQueryReq(body, \"CONTRIBUTOR_SEARCH\")\n \n resp = api(data)\n return checkRES(resp)\n end",
"title": ""
},
{
"docid": "8db04fcebb2fe71801649fc2d36160de",
"score": "0.4804629",
"text": "def import\n unknown_emails.each do |email|\n commit_author = Curry::CommitAuthor.with_email(email).first_or_create!\n\n @pull_request.pull_request_commit_authors.where(\n commit_author_id: commit_author.id\n ).first_or_create!\n end\n\n unknown_github_logins.each do |login|\n commit_author = Curry::CommitAuthor.with_login(login).first_or_create!\n\n @pull_request.pull_request_commit_authors.where(\n commit_author_id: commit_author.id\n ).first_or_create!\n end\n end",
"title": ""
},
{
"docid": "22961c2ae9c4be9fe41bfd1271470bc9",
"score": "0.48013824",
"text": "def marshal_contributor(provenance:, is_contact:, json: {})\n return nil unless json.present?\n\n # Search by email if available and not found above\n contributor = find_by_email_or_name(provenance: provenance, is_contact: is_contact, json: json)\n contributor = attach_identifier(provenance: provenance, contributor: contributor, json: json) unless contributor.present?\n\n # Try to find the Org by the identifier\n contributor = find_by_identifier(provenance: provenance, json: json) unless contributor.present?\n # Update the email if we found them by identifier\n contributor.email = json[:mbox] if contributor.present? && json[:mbox].present?\n\n # Attach the Affiliation unless its already defined\n contributor.name = json[:name] if json[:name].present?\n\n contributor.affiliation = deserialize_affiliation(provenance: provenance, json: json)\n contributor\n end",
"title": ""
},
{
"docid": "4ebc415847b53fad2ae21cc0e74f2f4d",
"score": "0.47948256",
"text": "def create_authors(authors)\n author_ids = []\n existing_authors = Book.cached_authors\n authors.each do |author|\n existing_author = existing_authors.find { |a| a['Name'] == author.name }\n existing_author ||= Book.create_author('Name' => author.name)\n author_ids << existing_author.id\n end\n author_ids\n end",
"title": ""
},
{
"docid": "37473e8b5930e5dca512b95e3a2206c8",
"score": "0.47761",
"text": "def create_work(src, composer_id, opus, cat_a, cat_n)\n w = Work.new\n new_marc = MarcWork.new(File.read(ConfigFilePath.get_marc_editor_profile_path(\"#{Rails.root}/config/marc/#{RISM::MARC}/work/default.marc\")))\n new_marc.load_source false # this will need to be fixed\n w.marc = new_marc\n\n w_100 = w.marc.first_occurance(\"100\")\n w_100.destroy_yourself if w_100\n w_100 = src.marc.first_occurance(\"100\").deep_copy\n # remove j\n w_100j = w_100.fetch_first_by_tag(\"j\")\n w_100j.destroy_yourself if w_100j\n w.marc.root.add_at(w_100, w.marc.get_insert_position(\"100\"))\n\n w_130 = w.marc.first_occurance(\"130\")\n w_130.destroy_yourself if w_130\n w_130 = src.marc.first_occurance(\"240\").deep_copy\n w_130.tag = \"130\"\n # we keep only $a $m (scoring) and $m (key) - remove $k and $o\n w_130k = w_130.fetch_first_by_tag(\"k\")\n w_130k.destroy_yourself if w_130k\n w_130o = w_130.fetch_first_by_tag(\"o\")\n w_130o.destroy_yourself if w_130o\n w_130.sort_alphabetically\n w.marc.root.add_at(w_130, w.marc.get_insert_position(\"130\"))\n\n if opus\n w_opus = src.marc.first_occurance(\"383\").deep_copy\n w.marc.root.add_at(w_opus, w.marc.get_insert_position(\"383\"))\n # replace the $b with the cleaned-up version \n w_opus_b = w_opus.fetch_first_by_tag(\"b\")\n w_opus_b.content = opus\n end\n\n if cat_n and cat_a\n w_cat = src.marc.first_occurance(\"690\").deep_copy\n w.marc.root.add_at(w_cat, w.marc.get_insert_position(\"690\"))\n # replace $n with the cleaned-up version\n w_cat_n = w_cat.fetch_first_by_tag(\"n\")\n w_cat_n.content = cat_n\n end \n\n w_667 = MarcNode.new(\"work\", \"667\", \"\", \"##\")\n w_667.add_at(MarcNode.new(\"work\", \"a\", \"Title imported from #{src.id}\", nil), 0)\n w.marc.root.add_at(w_667, w.marc.get_insert_position(\"667\"))\n\n w.person = Person.find(composer_id) rescue nil\n w.suppress_reindex\n w.save!\n w\nend",
"title": ""
},
{
"docid": "3317f37aef008bf1eddef8b061642c7b",
"score": "0.47701758",
"text": "def create_repositories_for_edition org, edition, authors = [], options = {}\n author_editor_team = contributor_team org, auto_create: true\n edition_team = contributor_team org, name: edition.handle, permission: 'push', auto_create: true\n\n article_repos = authors.map{|author|\n if (article_repo = create_article_repository org, edition, author, options)\n seed_article_repository article_repo, edition, options unless article_repo.seeded\n # Add author to authors & editors team (read-only)\n @hub.add_team_membership author_editor_team.id, author\n @hub.add_team_repo author_editor_team.id, article_repo.full_name\n # Add author to team for this edition (read-write)\n @hub.add_team_membership edition_team.id, author\n @hub.add_team_repo edition_team.id, article_repo.full_name\n end\n article_repo\n }\n\n if (spine_repo = create_spine_repository org, edition, options)\n if spine_repo.seeded\n update_spine_repository spine_repo, article_repos, edition, options\n else\n seed_spine_repository spine_repo, article_repos, edition, options\n end\n @hub.add_team_repo author_editor_team.id, spine_repo.full_name\n @hub.add_team_repo edition_team.id, spine_repo.full_name\n end\n ([spine_repo] + article_repos).compact\n end",
"title": ""
},
{
"docid": "ded8f97bd06664fa3aa69fdbf2700bea",
"score": "0.47668302",
"text": "def review_authors # :norobots:\n pass_query_params\n @object = AbstractModel.find_object(params[:type], params[:id].to_s)\n @authors = @object.authors\n parent = @object.parent\n if @authors.member?(@user) or @user.in_group?('reviewers')\n @users = User.all(:order => \"login, name\")\n new_author = params[:add] ? User.find(params[:add]) : nil\n if new_author and not @authors.member?(new_author)\n @object.add_author(new_author)\n flash_notice(\"Added #{new_author.legal_name}\")\n # Should send email as well\n end\n old_author = params[:remove] ? User.find(params[:remove]) : nil\n if old_author and @authors.member?(old_author)\n @object.remove_author(old_author)\n flash_notice(\"Removed #{old_author.legal_name}\")\n # Should send email as well\n end\n else\n flash_error(:review_authors_denied.t)\n redirect_to(:controller => parent.show_controller,\n :action => parent.show_action, :id => parent.id,\n :params => query_params)\n end\n end",
"title": ""
},
{
"docid": "a88b07cb4a73c6c8187303c2c93be57e",
"score": "0.47636265",
"text": "def dc_contributor_author\n @thesis.authors.each do |author|\n @csv_hash[:headers] << 'dc.contributor.author'\n\n @thesis.files.each_with_index do |file, i|\n @csv_hash[\"f#{i}\".to_sym] << thesis_pdf_checker(file, author.user.preferred_name)\n end\n end\n end",
"title": ""
},
{
"docid": "7a7962f60711d511b29eb0f70d4e6a6e",
"score": "0.47604376",
"text": "def findPublications(exclude_pubids,matchloc,colname,query_string,is_public)\n user_id = nil;\n if !current_user.nil?\n user_id = current_user.id\n end\n # Construct the SQL command from the query_string entered and database table column name to search on\n sqlcmd = constructSQL(query_string,colname)\n qterms = getQueryTerms(query_string)\n puts \">>>>>>>>>>> findPublications sql \"+sqlcmd+\" qterms \"+qterms.to_s\n \n\tret_projs = Array.new\n tmp_prj = Array.new\n tmp_pub = PrimaryPublication.find(:all, :conditions=>sqlcmd)\n found_pub_ids = Array.new\n for pub in tmp_pub\n if !exclude_pubids.include?(pub.pmid) &&\n !found_pub_ids.include?(pub.pmid)\n study_id = pub.study_id\n study = Study.find(:first, :conditions=>[\"id = ?\", pub.study_id])\n # Ok - got the Study associated with the publication, now get the Project associated with the Study\n # gather projects that meet public/non-public search criteria into an array\n tmp_prjs = Array.new\n tmp_prj = Project.find(:all, :order=> \"created_at\", :conditions=>[\"id = ?\", study.project_id])\n for prj in tmp_prj\n if (!is_public && !user_id.nil? && (user_id == prj.creator_id)) ||\n prj.is_public\n # If a public search - only allow Project.is_public = boolean [f | t]\n # Pickup project information - creator, create date, etc\n userinfo = User.find(:first, :conditions=>[\"id = ?\", prj.creator_id])\n tmp_prjs << [prj,userinfo]\n end\n end\n # Tag the publication with the first project and carry along the entire list of associated projects\n if tmp_prjs.size() > 0\n # construct the search hit context text\n qtext = \"\"\n if colname == \"pmid\"\n qtext = qtext = toContextText(pub.pmid.to_s,qterms);\n elsif colname == \"title\"\n qtext = qtext = toContextText(pub.title.to_s,qterms);\n elsif colname == \"journal\"\n qtext = qtext = toContextText(pub.journal.to_s,qterms);\n end\n \n ret_projs << [100,tmp_prjs[0][0],qtext,study,[pub],matchloc,tmp_prjs[0][1],tmp_prjs]\n found_pub_ids << pub.pmid\n end\n end\n end\n return ret_projs\n end",
"title": ""
},
{
"docid": "ede2aef3fc3898be8086c5016cfadab6",
"score": "0.47587833",
"text": "def insert_contributors(c, g)\n\tc_f = []\n\tc.each do |contributor|\n\t\tc_f << {\n\t\t\t'contributions' => contributor['contributions'],\n\t\t\t'name' => contributor['name']\n\t\t}\n\tend\n\n\tg.contributors.create(c_f)\nend",
"title": ""
},
{
"docid": "b3a7e10d5413ce46302323b7b9ba71e0",
"score": "0.47527793",
"text": "def github_contributors\n contributors_populator = Solidus::ContributorsPopulator.new(\n organizations: %w[solidusio solidusio-contrib],\n offset: 15,\n )\n contributors_populator.call\n\n contributors_populator.contributors\n end",
"title": ""
},
{
"docid": "457a596888f4ce08344255fa08a8e475",
"score": "0.47523543",
"text": "def orcid_search(profile, pubs=nil)\n # ORCID API search is case insensitive\n legal_ln = profile['names']['legal']['lastName'].downcase\n orcids4name = orcid_search_by_name(legal_ln)\n # TODO: If CAP provides an alternate last name (like a maiden name), issue\n # an additional ORCID API query for it. As of Nov 2015, there is no\n # CAP data for alternative last name (e.g. maiden name).\n #\n # Use one search query to get as many ORCIDS matching last name as possible,\n # then filter them by first name; avoid multiple ORCID API requests on\n # variations in first names (with or without middle names or abbreviations).\n orcid_matches = orcid_filter(profile, orcids4name)\n if orcid_matches.empty? && pubs\n # Try to find an ORCID using publication data\n unless pubs['publications'].empty?\n articles = pubs['publications'].select {|p| p['type'] == 'article' }\n pubIds = articles.map {|a| {pmid: a['pubMedId'], doi: a['doiId']} }\n pubIds.each do |pub|\n if pub[:pmid]\n orcids4pmid = orcid_search_by_pmid(pub[:pmid])\n orcid_matches = orcid_filter(profile, orcids4pmid)\n unless orcid_matches.empty?\n msg = \"Found ORCID using publication PMID: #{pub[:pmid]}\\n\"\n orcid_search_logger.info(msg)\n break\n end\n end\n if pub[:doi]\n orcids4doi = orcid_search_by_doi(pub[:doi])\n orcid_matches = orcid_filter(profile, orcids4doi)\n unless orcid_matches.empty?\n msg = \"Found ORCID using publication DOI: #{pub[:doi]}\\n\"\n orcid_search_logger.info(msg)\n break\n end\n end\n end\n end\n end\n orcid_matches\nend",
"title": ""
},
{
"docid": "d848ede6192fd528cee78202dc5e5133",
"score": "0.4750943",
"text": "def multi_author_project_script\n # add project users\n Project.all.each do |project|\n project.add_project_users\n end\n\n # create edits\n Step.all.each do |step|\n step.add_edits\n end\n\n # add user_ids to images and video\n Image.all.each do |image|\n image.add_user\n end\n\n Video.all.each do |video|\n video.add_user\n end\n\n # add original authors\n Project.where(\"remix_ancestry IS NOT NULL\").each do |project|\n project.steps.each do |step|\n step.set_original_authors\n end\n end\n end",
"title": ""
}
] |
955d86427f144f089bfc609ad19066b7
|
PUT /private/members/johnsmith PUT /private/members/johnsmith.json
|
[
{
"docid": "5a3d2a4dec53e5cdd9634bce00f88fdc",
"score": "0.0",
"text": "def update\n\t\t@member = Member.find(params[:id])\n\t\t\n\t\t# Update the member's section, if sent.\n\t\tif params[:member].has_key?(:section_id) and @member.section_id != params[:member][:section_id]\n\t\t\t# Don't allow unprivileged members to do this!\n\t\t\tunless current_user.privileged?\n\t\t\t\trender 'members/show', :status => :forbidden\n\t\t\t\treturn\n\t\t\tend\n\t\t\t\n\t\t\t# Change the member's section.\n\t\t\tnew_section = Section.find(params[:member][:section_id])\n\t\t\tparams[:member].delete(:section_id)\n\t\t\tparams[:member][:section] = new_section\n\t\tend\n\t\t\n\t\t# Update the position within the section, if sent.\n\t\tif params[:member].has_key?(:position)\n\t\t\tif params[:member][:position] =~ /^\\d+$/\n\t\t\t\treplaced_member = Member.find(params[:member][:position])\n\t\t\t\t@new_position = replaced_member.position\n\t\t\t\tparams[:member].delete(:position)\n\t\t\telse\n\t\t\t\t@new_section = params[:member][:section] || @member.section\n\t\t\t\tif @new_section.members.empty?\n\t\t\t\t\t@new_position = 1\n\t\t\t\telse\n\t\t\t\t\t@new_position = @new_section.members.last.position + 1\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tparams[:member].delete(:position)\n\t\t\tend\n\t\tend\n\t\t\n\t\t# Do not allow permissions changes by unprivileged members.\n\t\tif params[:member].has_key?(:privileged) and not current_user.privileged?\n\t\t\trender 'members/show', :status => :forbidden\n\t\t\treturn\n\t\tend\n\t\t\n\t\trespond_to do |wants|\n\t\t\tif @member.update_attributes(params[:member])\n\t\t\t\[email protected]_at(@new_position) unless @new_position.nil?\n\t\t\t\twants.html do\n\t\t\t\t\tflash[:notice] = 'Member was successfully updated.'\n\t\t\t\t\tredirect_back_or_default(member_path(@member))\n\t\t\t\tend\n\t\t\t\twants.json { head :ok }\n\t\t\telse\n\t\t\t\twants.html { render :action => \"edit\", :status => :bad_request }\n\t\t\t\twants.json { head :bad_request }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "a5af1e826e49676be947199804312c95",
"score": "0.72302413",
"text": "def putMember(memberId, fullName, initials, bio)\n\n\thash = Hash.new\n\thash[:fullName] = fullName\t\n\thash[:initials] = initials\t\n\thash[:bio] = bio\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId, hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "6d9179b65f02d48640f9d1f2066460a5",
"score": "0.6884146",
"text": "def update\n expose Member.update(@oauth_token, params[:membername], params)\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.6653209",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "022c342e9ee81762eca821053b5c352f",
"score": "0.66338784",
"text": "def putMemberFullName(memberId, value)\n\n\thash = Hash.new\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId+\"/fullName\", hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "18ab900b035bae7ae05e4049ad5bed83",
"score": "0.64597565",
"text": "def test_should_update_friendship\n login_as(:jane)\n put :update, :user_id => users(:jane).id, :id => 1, :friendship => { }\n\n assert_response :success\n end",
"title": ""
},
{
"docid": "f5f8f95c726a69e5b87f9385d71fa89f",
"score": "0.64481467",
"text": "def putOrganizationMembers(orgId, idMember, type)\n\n\thash = Hash.new\n\thash[:idMember] = idMember\t\n\thash[:type] = type\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/organizations/\"+orgId+\"/members/\"+idMember, hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.62610096",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "973d0f3c973a223584258b0fc379de9b",
"score": "0.6248469",
"text": "def update\n if @current_user.id != @member.user_id\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n if @member.update(member_params)\n render json: @member, status: :ok\n else\n render json: @member.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7623ef5927878096dbb4fcec258a41cf",
"score": "0.6208784",
"text": "def update\n puts params[:fields]\n expose Participant.update(@oauth_token, params[:membername].strip,\n params[:challenge_id].strip, params[:fields])\n end",
"title": ""
},
{
"docid": "2b9f03522dd6705061cbad0632ac9016",
"score": "0.61440516",
"text": "def update_members\n members = ProjectService.new.update_members(params,current_user)\n render json: {members: members}\n end",
"title": ""
},
{
"docid": "2187ce2c266015362fa9a8b2512b41c8",
"score": "0.6099405",
"text": "def update(data)\n @client.make_request(:post, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{@conference_id}/members/#{id}\"), data)[0]\n end",
"title": ""
},
{
"docid": "bafb788585f26119fb96596e6956655a",
"score": "0.6099263",
"text": "def update\n @person = Person.find(params[:id])\n permit \"tup_member or owner of :person\" do\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = @person.name + ' profile was successfully updated.'\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "1cd40cfacfbc46c6ff6129ca16fc7d1c",
"score": "0.6038579",
"text": "def update\n @member.update_attributes unwrap_params(:member)\n respond_with(:api, @member)\n end",
"title": ""
},
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.6016509",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end",
"title": ""
},
{
"docid": "6a5b8b3cb7d677e463d1e74ac6ef0f92",
"score": "0.59795845",
"text": "def update \n current_user\n\n @member = Member.new(member_params)\n @member.save!\n\n is_admin?(@current_user) ? () : (@member.junior_enterprise_id = current_user.junior_enterprise.id)\n\n result = HTTParty.put(\"http://jeapi.herokuapp.com/members/#{params[:id]}\",\n :body => {:name => @member.name, :phone => @member.phone, :email => @member.email, :photo => @member.photo_url.to_s, :position => @member.position, :junior_enterprise_id => @member.junior_enterprise_id },\n :headers => { 'token' => JEAPI_KEY } )\n \n @member.destroy \n if result.code == 204 \n if is_admin?(@current_user)\n redirect_to \"/admin/members\", notice: \"Editado com sucesso\"\n else \n redirect_to \"/members\", notice: \"Editado com sucesso\"\n end\n else\n @errors = JSON.parse(result.body)\n is_admin?(@current_user) ? (render template: \"admin/member_edit\") : (render :edit) \n end\n end",
"title": ""
},
{
"docid": "c292a30ad82998d0184f5ddf8942cb4f",
"score": "0.59768486",
"text": "def update_group_members(request)\n start.uri('/api/group/member')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "744980241bd423420a35b0bb9d61a210",
"score": "0.5953261",
"text": "def update\n respond_to do |format|\n @member.update_attributes('slug' => member_params[:user_name].downcase.gsub(' ','-').gsub('\\n',''))\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.59532154",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "b669a7cf098d6fee10b940cf572f5fb0",
"score": "0.59339136",
"text": "def update\n username = Username.new(username_params)\n username.update\n render json: username\n end",
"title": ""
},
{
"docid": "811d96e067cc02db076a1c104a96a192",
"score": "0.5921063",
"text": "def update_member(address, member_address, params)\n put(\"lists/#{address}/members/#{member_address}\", params)\n end",
"title": ""
},
{
"docid": "26de0411604ff73655f06fa95b204292",
"score": "0.5909016",
"text": "def update\n @member = Member.find(params[:id])\n\n if @member.update(member_params)\n head :no_content\n else\n render json: @member.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.5908029",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "578c25f1f134144f2ff982b07f36d532",
"score": "0.589969",
"text": "def edit_project_member(project, user_id, options = {})\n put \"#{Project.path(project)}/members/#{user_id}\", options\n end",
"title": ""
},
{
"docid": "abce1dfbfa7adc8a127622108f732a95",
"score": "0.58996385",
"text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.5893293",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "f6da4031957deb31082641dc54d49a24",
"score": "0.5884299",
"text": "def update\n @member = Member.find(params[:id])\n # See parameters from application_controller\n member = params.require(:member).\n permit(\n :email, :password, :password_confirmation,\n :gender, :pseudo, :first_name, :name, :bio, :birth_date,\n :address, :zip, :city, :country, :avatar, :site,\n :category_list, :tag, { tag_ids: [] }, :tag_ids, :title\n\n )\n respond_to do |format|\n if @member.update(member)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n @member.index!\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.58825463",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "bb443a428f2563539f43b17c71594928",
"score": "0.58588415",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.5856965",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "93b3cd382ec1a5fcd6317f9e18cf86a2",
"score": "0.58504075",
"text": "def update\n #not_found() unless current_user\n @member = Member.find(params[:id])\n if @member.user_id != current_user.id\n not_found()\n end\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "147ebf38fd006453b3f9a95cc87f32bd",
"score": "0.58492965",
"text": "def update\r\n @member = Member.find(params[:id])\r\n# @member.society_id = current_user.society_id\r\n\r\n respond_to do |format|\r\n if @member.update_attributes(params[:member])\r\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @member.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "699d9259b5511ca444c672d0fdd17ed2",
"score": "0.58118397",
"text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"title": ""
},
{
"docid": "9575d502bc170b82392d4b2f15c1ec51",
"score": "0.58080965",
"text": "def putMemberBio(memberId, value)\n\n\thash = Hash.new\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId+\"/bio\", hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "cf033f2e51c087854a5e9c8fccfe9bf2",
"score": "0.58032036",
"text": "def update_me(data)\n put(\"/api/me\", { user: data })\n end",
"title": ""
},
{
"docid": "4285a6adaef833f10ddad3cd5a7b6b47",
"score": "0.58031416",
"text": "def update\n service = Fl::Framework::Service::Actor::GroupMember.new(current_user, params, self)\n @group_member = service.update()\n respond_to do |format|\n format.json do\n if @group_member && service.success?\n render :json => { :group_member => hash_one_object(@group_member, service.to_hash_params) }\n else\n error_response(generate_error_info(service, @group_member))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2cc55c2caa6d88b7d00085ebd203df53",
"score": "0.57993156",
"text": "def update\n @member = Member.find(params[:id])\n respond_to do |format|\n if @member.update_attributes(params[:member])\n sign_in @member\n format.html { redirect_to @member, :notice=> 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @member.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59cd7084ac337953ca0a2df157dc0a0f",
"score": "0.578962",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d39deec2a2f0439ba6259c5584e2737",
"score": "0.57859284",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, :notice => 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d39deec2a2f0439ba6259c5584e2737",
"score": "0.57859284",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, :notice => 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ebfa5c43a28c0c6ae3c7116c2834ee3",
"score": "0.5772923",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "3213069f815ca5a0ebab4c6b21398fc8",
"score": "0.57507735",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @member.update(member_params)\n\t\t\t\tformat.html { redirect_to @member, notice: 'Member was successfully updated.' }\n\t\t\t\tformat.json { render json: @member.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3f18f85b8f163bbeeb317ecad1681943",
"score": "0.5749181",
"text": "def putMemberInitials(memberId, value)\n\n\thash = Hash.new\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId+\"/initials\", hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "bdafbb7a383b118e3077a52d3c96a494",
"score": "0.574556",
"text": "def update_info(attrs)\n response = put_with_access_token(\"/people/#{attrs['id']}\", attrs)\n if response[\"message\"] == \"ok\"\n return true\n else\n return response\n end\n end",
"title": ""
},
{
"docid": "d8054e3c41b8df3c2ec3d070c63961f3",
"score": "0.5743164",
"text": "def update\n puts params[:id]\n user = User.find(params[:id])\n user.update(name: params[:name], email: params[:email])\n render json: {success: \"Successful updating\"}\n end",
"title": ""
},
{
"docid": "eb41efb46df447c3dd00e8b70035a152",
"score": "0.5742447",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member]) \n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ab00a9643299646ba24b1e8aefc12c9",
"score": "0.57371527",
"text": "def update\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ab00a9643299646ba24b1e8aefc12c9",
"score": "0.57371527",
"text": "def update\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733604",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5733118",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.5733014",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.5733014",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.5733014",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.5733014",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.5733014",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.5731452",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6551bcf42f1ce20d81c0e56bd3eb3b67",
"score": "0.57310534",
"text": "def org_modify(name, args)\n # Create the organization object\n org = {}\n\n # Add the owner email address if one was supplied\n org['owner_email'] = args[:owner_email] \\\n if args.key? :owner_email and args[:owner_email]\n\n # Add the list of members if it was supplied\n org['users'] = args[:members] \\\n if args.key? :members and args[:members]\n\n @logger.debug org\n\n # Sign & send the request\n uri = server_uri(\"/organizations/#{name}\")\n res_data = api_json_put(uri, org)\n @logger.debug res_data\n\n return res_data\n end",
"title": ""
},
{
"docid": "85507349c50d9da05563cf94f70bae9a",
"score": "0.57303625",
"text": "def update\n \n respond_to do |format|\n if @member.update(member_params) \n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f409af04413db3ba30bfc020762eaff",
"score": "0.5724169",
"text": "def update_members(members)\n self.errors.clear\n self.messages.clear\n body = {\n :members => members.map do |m|\n {\n :id => (m.id if m.respond_to? :id),\n :login => (m.login if m.respond_to? :login),\n :role => m.role,\n :type => m.type\n }\n end\n }\n response = post(:members, nil, body.to_json)\n self.messages = extract_messages(response)\n resource = self.class.format.decode(response.body)\n p = child_prefix_options\n if resource.is_a? Array\n self.attributes[:members] = resource.map{ |r| m = self.class.member_resource.new(r, true, p); m.as = as; m }\n else\n m = self.class.member_resource.new(resource, true, p)\n m.as = as\n self.members.delete_if{ |o| o == m }\n self.members << m\n end\n true\n rescue ActiveResource::ConnectionError => e\n if e.respond_to? :response\n @remote_errors = e.response\n load_remote_errors(e.response, false, true, members, :members)\n errors[:members] = \"The #{self.class.model_name.humanize.downcase} members could not be updated.\" if errors.empty?\n end\n false\n end",
"title": ""
},
{
"docid": "5c75e9913fde18ccacb91c3418829226",
"score": "0.5723733",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n octokit = Octokit::Client.new(:access_token => ENV[\"git_token\"])\n octokit.add_team_membership(2217734, @user.github_username)\n format.html { redirect_to root_path }\n else\n format.html { redirect_to root_path }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.57210505",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.57210505",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.57210505",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.57210505",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "368d1b7fe1201ac8944e6e73b5586343",
"score": "0.57094586",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(person_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b2600b5579a2744e29b5cbbb90d01eed",
"score": "0.5701565",
"text": "def update\n respond_to do |format|\n if @user_member.update(user_member_params)\n format.html { redirect_to @user_member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_member }\n else\n format.html { render :edit }\n format.json { render json: @user_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d65a4bb97f2d557c2aa8e1c8a86f7f9",
"score": "0.5699192",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d65a4bb97f2d557c2aa8e1c8a86f7f9",
"score": "0.5699192",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa7896f7a5a9a97f5e727417a8f8a68",
"score": "0.569379",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to members_url, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6bc47ac03d78443d805d8be0ba24986",
"score": "0.56885654",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: { message: @member.errors, status: :unprocessable_entity }, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47f1b8bbb51dc45ffacf38d5030fd63d",
"score": "0.56880695",
"text": "def update\n user = User.find_by!(id: params[:id])\n if user \n user.name = params[:name]\n user.surname = params[:surname]\n user.role_id = params[:role_id]\n user.phone = params[:phone]\n user.job = params[:job]\n user.email = params[:email]\n user.adress = params[:adress]\n user.confirmed = params[:confirmed]\n user.save\n render json: user, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "dd06a2bfa66c282f716a4310b39868f1",
"score": "0.56874555",
"text": "def update_owner!(owner_key, data)\n put \"/owner/#{owner_key}\", body: data\n end",
"title": ""
},
{
"docid": "a4b65ec23f2f11debed769b85518dae5",
"score": "0.5682373",
"text": "def update\n if name_exists(params[:member][:name])\n if @member.update(member_params)\n render 'update_success'\n return\n end\n end\n render 'update_failure'\n end",
"title": ""
},
{
"docid": "0c6476ef6a283ef342d6514756380eec",
"score": "0.5679769",
"text": "def edit\n user = User.find(params[:id])\n render json: user, only: [:username, :name, :location, :bio, :resource_request, :skills, :seeking, :preferred_contact], status: 200\n end",
"title": ""
},
{
"docid": "9ce75f1bc56fe3b5edde60906d9dea53",
"score": "0.5674901",
"text": "def person_put_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PersonApi.person_put ...\"\n end\n # resource path\n local_var_path = \"/person\".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 = []\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'person'])\n auth_names = ['JwtAuth']\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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PersonApi#person_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.567033",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "c5f919f99d61281588b64b26632c3812",
"score": "0.56645674",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n \n \n end",
"title": ""
},
{
"docid": "ed43503a383cdc67549088627a4616f9",
"score": "0.56571805",
"text": "def update\n if @member.update(member_params)\n render status: :ok, json: @member\n else\n self.send(:edit)\n end\n end",
"title": ""
},
{
"docid": "116c6c1d4a9f74607790a9fe0e0cdd35",
"score": "0.5651793",
"text": "def update\n if @user.update(username: params[:username], \n privacy: params[:privacy])\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "51a0485aad722515d800d668a1f003e2",
"score": "0.56508124",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to non_member_url, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a21658e8869b48b877bfbe57de8fb717",
"score": "0.5650648",
"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.put(\n url,\n { Contact: { email: \"[email protected]\" } } )\n \nend",
"title": ""
},
{
"docid": "f2e8cc530950abd9d7721e26dda95a2d",
"score": "0.5644264",
"text": "def update\n username = params[:username]\n playlists_JSON = params[:playlists]\n \n playlists = Playlists.find_by_username(username);\n playlists.update_attributes(:playlists_JSON => playlists_JSON);\n render :text => 'PUT was successful.'\n end",
"title": ""
},
{
"docid": "58ab03b8bdb076cfa7f882cdee2d8ca6",
"score": "0.5642416",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to edit_member_path, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75b8ea2b25f602159cb2ffc8c47cdb72",
"score": "0.5641663",
"text": "def edit_members\n end",
"title": ""
},
{
"docid": "519161254acf9e40a727396807a601c0",
"score": "0.56294495",
"text": "def update\n @member = Member.with_permissions_to(:update).find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Jäsentiedot päivitetty onnistuneesti.'\n format.html { redirect_to(member_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3551a93e8829fecafd58bf691a860eeb",
"score": "0.5628824",
"text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end",
"title": ""
},
{
"docid": "62219197842e6423faf7b90853748c32",
"score": "0.56223077",
"text": "def update\n person = Person.find_by(id: params[:id])\n return head :not_found if person.nil?\n\n return head :bad_request if params[:name].blank?\n\n person.update(name: params[:name].gsub('@', ''))\n renderrr person\n end",
"title": ""
},
{
"docid": "7efd4c6b2f2e1e71adf9dfcc28413795",
"score": "0.56155854",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_with(@member) do |format|\n if @member.update_attributes(params[:member])\n if @member.avatar\n if @member.avatar_file_name != nil\n @member.update_attribute(:image_url, @member.avatar.url(:medium))\n else\n @member.update_attribute(:image_url, nil)\n end\n end\n if current_user.id == @member.user_id\n format.html { redirect_to root_url, notice: 'Member was successfully updated.' }\n else\n format.html { redirect_to family_lists_path, notice: 'Member was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c77c61632e7a5655fa8215c4d35a24f0",
"score": "0.5614364",
"text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end",
"title": ""
},
{
"docid": "131b90fdae60ed4cc5d5a22a76a18390",
"score": "0.5601272",
"text": "def update\n actor = Actor.find_by(\"id\" => params[\"id\"])\n actor.update(\"name\" => params[\"full_name\"], \"photo_url\" => params[\"url\"])\n redirect_to \"/actors\"\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.5594946",
"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": ""
}
] |
593a3e20d09dcd9c439cc4541eed9584
|
DELETE /codes/1 DELETE /codes/1.json
|
[
{
"docid": "2449382847c5d56e10214ff1dfdc5e6f",
"score": "0.7503115",
"text": "def destroy\n @code.destroy\n respond_to do |format|\n format.html { redirect_to codes_url, notice: 'Code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "5dba3e5f402ac300726e6e6bbb7ea7df",
"score": "0.7780049",
"text": "def destroy\n @code = Code.find(params[:id])\n @code.destroy\n\n respond_to do |format|\n format.html { redirect_to codes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "44f01025cd2e31f57947fe78a35a389d",
"score": "0.7756454",
"text": "def destroy\n @code.destroy\n respond_to do |format|\n format.html { redirect_to codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "725b3b11701e04d87e00cec959662098",
"score": "0.773267",
"text": "def destroy\n @code = Code.find(params[:id])\n @code.destroy\n\n respond_to do |format|\n format.html { redirect_to code_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b4bf9199154bc6262968ba75bdbb3f40",
"score": "0.76045287",
"text": "def destroy\n @code = Code.find(params[:id])\n @code.destroy\n\n respond_to do |format|\n format.html { redirect_to(codes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "17803e1f047a584c8781ea97b9017ca9",
"score": "0.7467131",
"text": "def destroy\n @code.destroy\n respond_to do |format|\n format.html { redirect_to '/get_tiqued', notice: 'Code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33b9714ef455c164c85d0cfcc1cce272",
"score": "0.7466925",
"text": "def destroy\n @client_code.destroy\n respond_to do |format|\n format.html { redirect_to client_codes_url, notice: 'Client code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a39500d0966753c20fb023d54a07a13",
"score": "0.74611586",
"text": "def destroy\n @code = Code.find(params[:id])\n @code.destroy\n\n respond_to do |format|\n format.html { redirect_to(codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1a39500d0966753c20fb023d54a07a13",
"score": "0.74611586",
"text": "def destroy\n @code = Code.find(params[:id])\n @code.destroy\n\n respond_to do |format|\n format.html { redirect_to(codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "66c50019febf9f4fb6c48ee9bb420e37",
"score": "0.7314514",
"text": "def destroy\n @audirt_code = AudirtCode.find(params[:id])\n @audirt_code.destroy\n\n respond_to do |format|\n format.html { redirect_to audirt_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f47e014e7c52b85a5b54f816298dc314",
"score": "0.7249784",
"text": "def destroy\n @response_code = ResponseCode.find(params[:id])\n @response_code.destroy\n\n respond_to do |format|\n format.html { redirect_to response_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e23fbd4a6753765ffffd90b5ee58025a",
"score": "0.7232772",
"text": "def destroy\n @n_code.destroy\n respond_to do |format|\n format.html { redirect_to n_codes_url, notice: 'N code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "64e2e5782603ae2d8be3d00887bd30c8",
"score": "0.72173893",
"text": "def destroy\n @codeset = Codeset.find(params[:id])\n @codeset.destroy\n\n respond_to do |format|\n format.html { redirect_to codesets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "44d2fc96280f1f2fd49ad0bf38350939",
"score": "0.7169335",
"text": "def destroy\n @budget_code = BudgetCode.find(params[:id])\n @budget_code.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d1c94b6e02dae3a6b0eb3b266ced100",
"score": "0.7142889",
"text": "def destroy\n @ext_code = ExtCode.find(params[:id])\n @ext_code.destroy\n\n respond_to do |format|\n format.html { redirect_to ext_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cebae54e045f7c2302c2cacac0cbed71",
"score": "0.7118013",
"text": "def destroy\n @scraped_code.destroy\n respond_to do |format|\n format.html { redirect_to scraped_codes_url, notice: 'Scraped code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0bd416c791c05acf8183bf6ffa95e10",
"score": "0.7105231",
"text": "def destroy\n @seal_code.destroy\n respond_to do |format|\n format.html { redirect_to seal_codes_url, notice: 'Seal code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b1ae638e133ba40720fec54744ac1a0",
"score": "0.7074427",
"text": "def destroy\n @coding = Coding.find(params[:id])\n @coding.destroy\n\n respond_to do |format|\n format.html { redirect_to codings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b23d86004ccf04d7bee686570d6a4b09",
"score": "0.70683265",
"text": "def destroy\n @chosakekka_code.destroy\n respond_to do |format|\n format.html { redirect_to chosakekka_codes_url, notice: 'Chosakekka code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3447df596f12b703e071e44f12d7d5bf",
"score": "0.7058144",
"text": "def destroy\n @alarm_code = AlarmCode.find(params[:id])\n @alarm_code.destroy\n\n respond_to do |format|\n format.html { redirect_to alarm_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1315d5b9fcfed3c87759f57c207b2fa5",
"score": "0.7039129",
"text": "def destroy\n @diff_code.destroy\n respond_to do |format|\n format.html { redirect_to diff_codes_url, notice: 'Diff code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f68ea389447600d34b47e4dcbe71373a",
"score": "0.7039014",
"text": "def destroy\n @handle_code = HandleCode.find(params[:id])\n @handle_code.destroy\n\n respond_to do |format|\n format.html { redirect_to handle_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a1f4f1a72ccad9161b1bb8b9c36af6be",
"score": "0.70309216",
"text": "def destroy\n @code_tambon = CodeTambon.find(params[:id])\n @code_tambon.destroy\n\n respond_to do |format|\n format.html { redirect_to code_tambons_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "896307ac4a0aa66b6ee42b31f02f1774",
"score": "0.7018138",
"text": "def destroy\n @oauth_code.destroy\n respond_to do |format|\n format.html { redirect_to oauth_codes_url, notice: 'Oauth code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.7007289",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "47de0c8ac14703b52ecdbed9fd1d383d",
"score": "0.6983922",
"text": "def destroy\n @status_code.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "ce3b6d04a669a7aa6cd6f13c254da47b",
"score": "0.6969639",
"text": "def destroy\n @secret_code = SecretCode.find(params[:id])\n @secret_code.destroy\n\n respond_to do |format|\n format.html { redirect_to secret_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20d23f80594b8de83691fa6dac0b718c",
"score": "0.69664454",
"text": "def destroy\n @invite_code.destroy\n respond_to do |format|\n format.html { redirect_to invite_codes_url, notice: 'Invite code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f67192dbd7a35e470d15b01050cd4594",
"score": "0.69634163",
"text": "def destroy\n @invitecode.destroy\n respond_to do |format|\n format.html { redirect_to invitecodes_url, notice: 'Invitecode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da8eccac74201431bb357576298f0131",
"score": "0.69595075",
"text": "def destroy\n @code_prename = CodePrename.find(params[:id])\n @code_prename.destroy\n\n respond_to do |format|\n format.html { redirect_to code_prenames_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35870d1301fa714b56eed15145781d93",
"score": "0.6955654",
"text": "def destroy\n @daily_code.destroy\n respond_to do |format|\n format.html { redirect_to daily_codes_url, notice: 'Daily code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7a6712c1a089ef2f01a95c8ec35a4ae",
"score": "0.69504225",
"text": "def destroy\n @discount_code.destroy\n respond_to do |format|\n format.html { redirect_to discount_codes_url, notice: 'Discount code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4d8d435ade890b088823edacbc800514",
"score": "0.6936768",
"text": "def destroy\n @trouble_code.destroy\n respond_to do |format|\n format.html { redirect_to trouble_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cfbb0c87f5b7da668ace665751a0cc1",
"score": "0.6935115",
"text": "def destroy\n @class_code = ClassCode.find(params[:id])\n @class_code.destroy\n\n respond_to do |format|\n format.html { redirect_to class_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f8054bc97b36d62342df4ce89938c83f",
"score": "0.693408",
"text": "def destroy\n @change_company_code = ChangeCompanyCode.find(params[:id])\n @change_company_code.destroy\n\n respond_to do |format|\n format.html { redirect_to change_company_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5a42cb298d022f284fb05f27679462cb",
"score": "0.6921991",
"text": "def destroy\n @secret_code.destroy\n respond_to do |format|\n format.html { redirect_to secret_codes_url, notice: 'Secret code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0abaf4faee86c743e20553b74418fdb9",
"score": "0.69125956",
"text": "def destroy\n @citocode.destroy\n respond_to do |format|\n format.html { redirect_to citocodes_url, notice: 'Citocode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a213ac49224c10908313e358159b7bb6",
"score": "0.69082326",
"text": "def destroy\n @code_tester = CodeTester.find(params[:id])\n @code_tester.destroy\n\n respond_to do |format|\n format.html { redirect_to code_testers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a53de5093a36a7cbf5a0474a9afb4ba3",
"score": "0.6906539",
"text": "def destroy\n @pincode.destroy\n respond_to do |format|\n format.html { redirect_to pincodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f44eed8dcf9bd73c919473d1307baa13",
"score": "0.689479",
"text": "def destroy\n @event_code.destroy\n respond_to do |format|\n format.html { redirect_to event_codes_url, notice: 'Event code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41277a574a388466f3a3890a2adc161d",
"score": "0.6894678",
"text": "def destroy\n @oee_code.destroy\n respond_to do |format|\n format.html { redirect_to oee_codes_url, notice: 'Oee code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b0eb181ccafc1f939dfb1c0abadf7f8",
"score": "0.68921643",
"text": "def destroy\n @taxcode = Taxcode.find(params[:id])\n @taxcode.destroy\n\n respond_to do |format|\n format.html { redirect_to taxcodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "789f629e5b22a772e48bccab23cedad6",
"score": "0.68900514",
"text": "def destroy\n @code.destroy\n redirect_to codes_url, notice: 'Code was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "848cfe3a70d205f0a7cb314c109b1d44",
"score": "0.6888266",
"text": "def destroy\n # authorize\n authorize! :delete, @code_status\n @code_status.destroy\n \n render nothing:true\n flash[:notice] = 'Xóa thẻ bài viết thành công.'\n end",
"title": ""
},
{
"docid": "284b0549dbc51e5ed4c4e00e8242686c",
"score": "0.68827385",
"text": "def destroy\n @promo_code.destroy\n respond_to do |format|\n format.html { redirect_to promo_codes_url, notice: 'Promo code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7e10d8bc6fe1e3b005990829978fd72",
"score": "0.688241",
"text": "def destroy\n @drugcode = Drugcode.find(params[:id])\n @drugcode.destroy\n\n respond_to do |format|\n format.html { redirect_to drugcodes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "07ef5b2373542856a499a992e259f5e6",
"score": "0.6880133",
"text": "def destroy\n @game_code.destroy\n respond_to do |format|\n format.html { head :no_content }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98b6ec9b312c78e96dc88e1ae01aec4e",
"score": "0.68788815",
"text": "def destroy\n @rate_code = RateCode.find(params[:id])\n @rate_code.destroy\n\n respond_to do |format|\n format.html { redirect_to rate_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3f2a9a41b79dc6af6836e69e95167ac2",
"score": "0.68781936",
"text": "def destroy\n @runcode.destroy\n respond_to do |format|\n format.html { redirect_to runcodes_url, notice: 'Runcode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba88411bf10ce588fc4214d90d384abd",
"score": "0.68763334",
"text": "def destroy\n @iata_code.destroy\n respond_to do |format|\n format.html { redirect_to iata_codes_url, notice: 'Iata code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5796cf10a26b2131fea1e3575680ab1d",
"score": "0.68761086",
"text": "def destroy\n @code_change_request.destroy\n respond_to do |format|\n format.html { redirect_to code_change_requests_url, notice: 'Code change request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f76369ba7a82c746d053004411dea9ad",
"score": "0.68728405",
"text": "def destroy\n @stockcode = Stockcode.find(params[:id])\n @stockcode.destroy\n\n respond_to do |format|\n format.html { redirect_to stockcodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "526941166bbc9d1b43a2d0ec9ca406da",
"score": "0.6870274",
"text": "def destroy\n @icdcode.destroy\n respond_to do |format|\n format.html { redirect_to icdcodes_url, notice: 'Icdcode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7cb97f12621bb1c322544a23baed2602",
"score": "0.6861258",
"text": "def destroy\n @featured_code = FeaturedCode.find(params[:id])\n @featured_code.destroy\n\n respond_to do |format|\n format.html { redirect_to featured_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "50913a9534d1ab9a34867e49d8d247cc",
"score": "0.68602216",
"text": "def destroy\n @creation_code = CreationCode.find(params[:id])\n @creation_code.destroy\n \n respond_to do |format|\n format.html { redirect_to(creation_codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "54eba7497dbd224dcf2b01582232f2eb",
"score": "0.6858296",
"text": "def destroy\n @rtocode.destroy\n respond_to do |format|\n format.html { redirect_to rtocodes_url, notice: 'Rtocode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffbef36ce535939d092322aaaae4f8ba",
"score": "0.6853601",
"text": "def destroy\n @code_amphoe = CodeAmphoe.find(params[:id])\n @code_amphoe.destroy\n\n respond_to do |format|\n format.html { redirect_to code_amphoes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9c4eb9230f0948eda91fe2a7fe8b465b",
"score": "0.68527687",
"text": "def destroy\n @code_file.destroy\n respond_to do |format|\n format.html { redirect_to theme_code_files_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0527b830cd062ff2ac3f629932ef76ed",
"score": "0.6850558",
"text": "def destroy\n @access_code = AccessCode.find(params[:id])\n @access_code.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fbe1d23d72ea459f05fc4ed484554a0f",
"score": "0.6844505",
"text": "def destroy\n @system_code.destroy\n respond_to do |format|\n format.html { redirect_to system_codes_url, notice: 'System code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1925f74505d42d49cd704e36eed9719a",
"score": "0.6844298",
"text": "def destroy\n @fincode = Fincode.find(params[:id])\n @fincode.destroy\n\n respond_to do |format|\n format.html { redirect_to Fincodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc0efa7b06e8e00645305ed42ba4c52c",
"score": "0.6842249",
"text": "def destroy\n @connect_code.destroy\n respond_to do |format|\n format.html { redirect_to connect_codes_url, notice: 'Connect code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b23dfab42498eb8f8e532dade2981daf",
"score": "0.68386114",
"text": "def destroy\n @secretcode.destroy\n respond_to do |format|\n format.html { redirect_to secretcodes_url, notice: 'Secretcode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.6837921",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "b4bc15cd7d85c22cb010f645a408bcb8",
"score": "0.68357587",
"text": "def destroy\n @hab_code.destroy\n respond_to do |format|\n format.html { redirect_to hab_codes_url, notice: 'Hab code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e09d3785f1025ffcf72da75a9074c62",
"score": "0.67994064",
"text": "def destroy\n @unlock_code.destroy\n respond_to do |format|\n format.html { redirect_to unlock_codes_url, notice: 'Unlock code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bc142eabc58084c65af1b90a2a3674f0",
"score": "0.6790437",
"text": "def destroy\n @promocode.destroy\n respond_to do |format|\n format.html { redirect_to promocodes_url, notice: 'Promocode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bc142eabc58084c65af1b90a2a3674f0",
"score": "0.6790437",
"text": "def destroy\n @promocode.destroy\n respond_to do |format|\n format.html { redirect_to promocodes_url, notice: 'Promocode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67b2e6b84d9c5637e7b32f01c58e1ab7",
"score": "0.6783932",
"text": "def destroy\n @codes_cpt = CodesCpt.find(params[:id])\n @codes_cpt.destroy\n\n respond_to do |format|\n format.html { redirect_to codes_cpts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9e65353a67a3d9ef984e3203dd6f38f",
"score": "0.6783815",
"text": "def test_delete_backup_codes\n test_identifier = rand(1000..9999).to_s\n\n backup_codes = @twizo.create_backup_codes(nil)\n backup_codes.params.identifier = test_identifier\n\n backup_codes = backup_codes.delete\n\n assert_equal '204', backup_codes.code\n end",
"title": ""
},
{
"docid": "35d1aaa833d70b474155dc77934d1a6f",
"score": "0.6781555",
"text": "def destroy\n @codes_modifier = CodesModifier.find(params[:id])\n @codes_modifier.destroy\n\n respond_to do |format|\n format.html { redirect_to codes_modifiers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba7289c13a89ba15de8d4c7d1e5b6cc9",
"score": "0.6774849",
"text": "def destroy\n @code_download.destroy\n respond_to do |format|\n format.html { redirect_to code_downloads_url, notice: 'Code download was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5e641c99833da2da99804f479d2c23f4",
"score": "0.67747563",
"text": "def destroy\n @code_snippet = CodeSnippet.find(params[:id])\n @code_snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to code_snippets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6752d55c2e32b0a26761ee697d6d4794",
"score": "0.6764394",
"text": "def destroy\n @card_code.destroy\n respond_to do |format|\n format.html { redirect_to card_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f464b6bedfcb3fb517654ced814f0c25",
"score": "0.6764",
"text": "def destroy\n @download_code = DownloadCode.find(params[:id])\n @download_code.destroy\n\n respond_to do |format|\n format.html { redirect_to(download_codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fcddfe3a83b99ba79a49a99a0c337d44",
"score": "0.67602265",
"text": "def destroy\n @ne_code.destroy\n respond_to do |format|\n format.html { redirect_to ne_codes_url, notice: 'ink code period was successfully deleted.' }\n end\n end",
"title": ""
},
{
"docid": "655687789fc40b8e49d9f35cb5d30ccf",
"score": "0.6759264",
"text": "def destroy\n @material_code = MaterialCode.find(params[:id])\n @material_code.destroy\n\n respond_to do |format|\n format.html { redirect_to material_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89f66f050c42b838e392b279c28ca074",
"score": "0.6755669",
"text": "def destroy\n @short_code.destroy\n respond_to do |format|\n format.html { redirect_to short_codes_url, notice: 'Short code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1be43493cc9858a784d8ad612bb27feb",
"score": "0.6748178",
"text": "def destroy\n @pay_code = PayCode.find(params[:id])\n @pay_code.destroy\n\n respond_to do |format|\n format.html { redirect_to(pay_codes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1b3359c43b4766f1e5ea95f79774e99e",
"score": "0.6745683",
"text": "def destroy\n File.delete(Rails.root.join('public', 'test', @tester.code))\n @tester.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ef99c8fb0113c4aaaff2e13b9b5ece4",
"score": "0.6744445",
"text": "def destroy\n set_discount_code\n @discount_code.destroy\n respond_to do |format|\n format.html { redirect_to admin_discount_codes_url, notice: 'Discount code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c929fb4f7473ccc2184a7b40bf3f02ca",
"score": "0.67415595",
"text": "def destroy\n @evaluation_code.destroy\n respond_to do |format|\n format.html { redirect_to evaluation_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4610d64041e2c261accd055458917b8c",
"score": "0.673814",
"text": "def destroy\n @base_rate_code = BaseRateCode.find(params[:id])\n @base_rate_code.destroy\n\n respond_to do |format|\n format.html { redirect_to base_rate_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8d957e1b73084ee4a9187bf0d189dd2",
"score": "0.6735162",
"text": "def destroy\n @postcode = Postcode.find(params[:id])\n @postcode.destroy\n\n respond_to do |format|\n format.html { redirect_to postcodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9df8e82c425865463f631b20a12b4cf6",
"score": "0.67307407",
"text": "def destroy\n @invitation_code.destroy\n respond_to do |format|\n format.html { redirect_to invitation_codes_url, notice: 'Invitation code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b015ee084157512cafeebb9ef74ee34e",
"score": "0.6726858",
"text": "def delete_code(code)\n result = redis.multi do\n redis.del(key_for_code(code))\n redis.srem(key(:codes), code)\n end\n\n result == [1, true]\n end",
"title": ""
},
{
"docid": "5d3a88d232ac02970316905657f92c3a",
"score": "0.6725733",
"text": "def destroy\n @vector_code = VectorCode.find(params[:id])\n @vector_code.destroy\n\n respond_to do |format|\n format.html { redirect_to vector_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef9127e7f96062c4edf65679e2af5c97",
"score": "0.6720927",
"text": "def destroy\n @trackcode.destroy\n respond_to do |format|\n format.html { redirect_to trackcodes_url, notice: 'Trackcode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f368ae324956473e26d2ea87f699cc5c",
"score": "0.672043",
"text": "def destroy\n @ncit_disease_code.destroy\n respond_to do |format|\n format.html { redirect_to ncit_disease_codes_url, notice: 'Ncit disease code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a5f3ac36641e1f40c7e5c717bc5979e",
"score": "0.67189837",
"text": "def destroy\n @pincode.destroy\n respond_to do |format|\n format.html { redirect_to pincodes_url, notice: \"Pincode was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "127ce238416b62cb59e223df3cc6185b",
"score": "0.6709466",
"text": "def destroy\n @gift_code.destroy\n respond_to do |format|\n format.html { redirect_to gift_codes_url, notice: 'Gift code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20d765fd2f58589b057c27f92c72d310",
"score": "0.6703733",
"text": "def destroy\n @cptcode.destroy\n respond_to do |format|\n format.html { redirect_to cptcodes_url, notice: 'Cptcode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7afff1a40de9c0d45c40d33457b11aa",
"score": "0.6700378",
"text": "def destroy\n @prize_code = PrizeCode.find(params[:id])\n @prize_code.destroy\n\n respond_to do |format|\n format.html { redirect_to prize_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f83b672bdce7020a4ada3ad5517550b",
"score": "0.66995424",
"text": "def destroy\n @stage_status_code = StageStatusCode.find(params[:id])\n @stage_status_code.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_status_codes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69116d4da115622bf17dc8a28a66c2bb",
"score": "0.6693516",
"text": "def destroy\n @country_code.destroy\n respond_to do |format|\n format.html { redirect_to country_codes_url, notice: 'Country code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "beee480dcb9fdb49ac0a83a005f8d16e",
"score": "0.66882974",
"text": "def destroy\n @code_scheme = CodeScheme.find(params[:id])\n @code_scheme.destroy\n\n respond_to do |format|\n format.html { redirect_to(code_schemes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
f53420caef3f18000ef3a94735642217
|
one line fibonacci number
|
[
{
"docid": "d8b73cba3459bcccdb8bf8c92a668613",
"score": "0.0",
"text": "def fibs_rec_oneline(x)\n x <= 2 ? 1 : fibs_rec_oneline(x-1) + fibs_rec_oneline(x-2)\nend",
"title": ""
}
] |
[
{
"docid": "2ff7985c69fa00c51dc8862b925ea5cd",
"score": "0.81532747",
"text": "def fibonacci\n fib = [0, 1]\n num = 100\n\n while fib.count < num\n fib << fib[-1] + fib[-2]\n end\n fib\n p \"Total in sequence: #{fib.count}.\"\n end",
"title": ""
},
{
"docid": "a55284d0663e77267d3670ab19243b20",
"score": "0.80813056",
"text": "def fibonacci(n)\n f = [0, 1]\n (n-1).times { |_| f << f[-1] + f[-2]}\n f.last\nend",
"title": ""
},
{
"docid": "a55284d0663e77267d3670ab19243b20",
"score": "0.80813056",
"text": "def fibonacci(n)\n f = [0, 1]\n (n-1).times { |_| f << f[-1] + f[-2]}\n f.last\nend",
"title": ""
},
{
"docid": "8b0f63f001833cbecc3b72eff11c4b76",
"score": "0.8023463",
"text": "def fibonacci(n) \n\n\nend",
"title": ""
},
{
"docid": "d117a2e371eccc48d3d19ca216325dc9",
"score": "0.79855555",
"text": "def fibonacci(int)\n (1..int).inject( [0, 1] ) { | fib | fib << fib.last(2).inject(:+) }\nend",
"title": ""
},
{
"docid": "f903fa478d43f16cb1ee6bf22c8176a3",
"score": "0.79816955",
"text": "def fibonacci(int)\n fib = [1, 1]\n 1.upto(int-2) { fib << fib[-1] + fib[-2] }\n p fib[int-1]\nend",
"title": ""
},
{
"docid": "28ff487a394c86949f7aeae326bd67e2",
"score": "0.7980147",
"text": "def fibonacci\n return nil if self < 1\n current, successor = 0, 1\n \tself.times { |i| current, successor = successor, current + successor}\n \tcurrent\n end",
"title": ""
},
{
"docid": "0df0cf9299d3847efb19419b68f8fca8",
"score": "0.79537594",
"text": "def fibonacci(num)\n fib = [1, 1]\n (num - 2).times do |_|\n fib << fib[-1] + fib[-2]\n end\n fib[-1]\nend",
"title": ""
},
{
"docid": "47c3526bf3dae7cac68be799b2d2e00e",
"score": "0.7948279",
"text": "def fibonacci(n)\n a=0\n b=1\n i=1\n ct=0\n if(n<1)\n print \"Invalid number\"\n return\n end\n if n==1\n print \"0 \"\n return\n end\n print \"0 1 \"\n n-=2\n n.times do\n i=a+b\n print \" #{i} \"\n b=i\n a=b\n end\nend",
"title": ""
},
{
"docid": "c0a7823b71ed77415f5a805e2959bb88",
"score": "0.79151905",
"text": "def fibonacci(int)\r\n start_index = 0\r\n end_index = 1\r\n f_arr = [1, 1]\r\n (int - 2).times do\r\n f_arr << f_arr[start_index] + f_arr[end_index]\r\n start_index += 1\r\n end_index += 1\r\n end\r\n f_arr[-1]\r\nend",
"title": ""
},
{
"docid": "5d0900a876585e1cca68cf34893c211b",
"score": "0.79134953",
"text": "def fibonacci(n)\n a = 0\n b = 1\n\n # Compute Fibonacci number in the desired position.\n n.times do\n temp = a\n a = b\n # Add up previous two numbers in sequence.\n b = temp + b\n end\n\n return a\nend",
"title": ""
},
{
"docid": "9057ccaaa36f2196349cb9a84c45d7e5",
"score": "0.7912683",
"text": "def fibonacci(num)\nend",
"title": ""
},
{
"docid": "0485cea9bf5a0aae89ca8335e0b7ca95",
"score": "0.7909583",
"text": "def fibonacci(number)\n fib_sequence = [1,1]\n iterations = number - 2 # (- 2) because the fist two elements in the feb_sequence are always defined\n iterations.times do\n fib_sequence << fib_sequence[-1] + fib_sequence[-2]\n end\n fib_sequence[-1]\nend",
"title": ""
},
{
"docid": "644d498045f0746ee695a9ce8a3947ca",
"score": "0.78989136",
"text": "def fib n\n \"outputs the fibonacci sequence members out to the specified n of members\"\n acc, x, y = [], 0, 1\n n.times do\n acc << y\n x, y = y, (x+y)\n end\n acc\nend",
"title": ""
},
{
"docid": "ff0ced1e9b274e99e86813fc9aad5209",
"score": "0.7883222",
"text": "def fibonacci(sequence_upto_this_number)\n a,b = 0,1\n sequence_upto_this_number.times do\n (@sequence ||= [])\n puts a.to_s\n @sequence << a if [email protected]?(a)\n a,b = b,a+b\n end\nend",
"title": ""
},
{
"docid": "b68489331fa663368f33a2e7e68ad51d",
"score": "0.7873036",
"text": "def fib(n)\r\n \r\n return n if n <= 1\r\n \r\n (fib(n - 1) + fib(n - 2))\r\n #p fibon\r\nend",
"title": ""
},
{
"docid": "b2ef8b5d3e23c437e983672ef6351df4",
"score": "0.7867001",
"text": "def fibonacci(n)\n \nend",
"title": ""
},
{
"docid": "90bdd0857c74e2303a72dfe8c6cf9461",
"score": "0.78552455",
"text": "def fibonacci num\n (1..(num-2)).inject([0,1]) { |fib| fib << fib.last(2).inject(:+) }\nend",
"title": ""
},
{
"docid": "d7b3ea30baacbdfa6d1ae2613191c12b",
"score": "0.78503114",
"text": "def fibonacci(n)\nend",
"title": ""
},
{
"docid": "9ac75b331cbb2f12b9625f65c6277977",
"score": "0.7850249",
"text": "def fibonacci(n)\n a = 0\n b = 1\n\n # Compute Fibonacci number in the desired position.\n (n + 1).times do\n temp = a\n a = b\n # Adds up previous two numbers in sequence.\n b = temp + b\n end\n\n return a\nend",
"title": ""
},
{
"docid": "94f65d1b6fd584f652a0a32ec894902a",
"score": "0.7843706",
"text": "def fib_sequence\n\ta = 1\n\tb = 0\n\tsum = 0\n\n\twhile a < 4000000 do \n\t\tfib = a + b\n\t\tsum += fib if fib.even?\n\t\tb = a\n\t\ta = fib\n\tend\n\n\tsum\nend",
"title": ""
},
{
"docid": "0fad2e67ee947566ee9093e137c247d2",
"score": "0.7842538",
"text": "def fibonacci(number)\r\np fib_num = []\r\nx = 0\r\n until x == number\r\n if x == 0\r\n fib_num << 0\r\n elsif x == 1\r\n fib_num << 1\r\n else # x >= 2\r\n fib_num << (fib_num[x - 1] + fib_num[x - 2])#number before + number before that\r\n end\r\n x = (x + 1)\r\n end\r\np fib_num\r\nend",
"title": ""
},
{
"docid": "f547611e529f0dd419e46373eab8e7be",
"score": "0.7838202",
"text": "def fibonacci(n)\n seq = [1, 1]\n (n - 2).times do\n seq << seq[-1] + seq[-2]\n end \n seq.last\nend",
"title": ""
},
{
"docid": "a376b1c2a3734d762917e0ea6d7d9db3",
"score": "0.7838002",
"text": "def fibonacci (i_num)\n input = i_num.to_i - 1\n array = []\n\n for n in 0..input\n if n == 0 || n == 1\n array << 1\n else\n array << array[n-1] + array[n-2]\n end\n end\n\n print array\n puts \"\\n\"\nend",
"title": ""
},
{
"docid": "afdf44d70b1546fa608ce4a1ec56102e",
"score": "0.7837793",
"text": "def fibonacci(n)\n (0..n).each {|n| print n, ' ' }\nend",
"title": ""
},
{
"docid": "cdc61b422bbdbb1d6811aea895cdd5eb",
"score": "0.782888",
"text": "def fibonacci_sequence index\n if index == 0 || index == 1\n return index\n else\n a = 0\n b = 1\n\n for i in 2..index\n c = a + b\n a = b\n b = c\n end\n\n return b\n end\nend",
"title": ""
},
{
"docid": "0875c287bc408b01ee00075370177dc6",
"score": "0.7821313",
"text": "def fib(number)\r\n number=number.to_i\r\n sequence=[]\r\n count=2\r\n if number==1\r\n sequence.push(0)\r\n p sequence\r\n elsif number==2\r\n sequence.push(0,1)\r\n p sequence\r\n else\r\n sequence.push(0,1)\r\n while count<number\r\n sequence[count]=sequence[count-1]+sequence[count-2]\r\n count+=1\r\n end\r\n p sequence[-1]\r\n end\r\nend",
"title": ""
},
{
"docid": "b9f2833c5c1b300517d7565dc4ad3fa2",
"score": "0.78202415",
"text": "def fibonacci(n)\n if n == 0\n return 0\n end\n if n == 1\n return 1\n end\n a = 0\n b = 1\n i = 2\n while i <= n\n x = a + b\n a = b\n b = x\n i += 1\n end\n return x\nend",
"title": ""
},
{
"docid": "1d4f126d8d60df2d421e4bc6497eef9c",
"score": "0.7813709",
"text": "def fibonacci(n)\n\tif n < 0\n\t\traise ArgumentError\n\tend\n\n\tif n == 0 || n == 1\n\t\t\treturn n\n\tend\n\n\tfib_0 = 0\n\tfib_1 = 1\n\t\n\tcurrent = 2\n\tfib_current = 1\n\twhile !(current == n)\n\t\t\tfib_current = fib_0 + fib_1\n\n\t\t\tcurrent += 1\n\t\t\tfib_0 = fib_1\n\t\t\tfib_1 = fib_current\n\n\tend\n\t\n\treturn fib_0 + fib_1\n\nend",
"title": ""
},
{
"docid": "990815853776719e8ee60d805a009fc4",
"score": "0.78108877",
"text": "def iFibonacci(n)\n fib = [1, 1]\n \n while fib.length < n\n fib << fib[-1] + fib[-2]\n end\n \n fib\nend",
"title": ""
},
{
"docid": "bccc01e0e692abb3dda006b012ef5eb1",
"score": "0.7807943",
"text": "def next_fibonacci(n1, n2)\n n1 + n2\n end",
"title": ""
},
{
"docid": "940bbcbb1b77fd7460a76066ffcc631a",
"score": "0.7807577",
"text": "def fibonacci(n)\n first=0\n second=1\n nextterm=0\n count=1\n while(count<=n+1)\n\t if(count<=1)\n\t\t nextterm=count\n\t else\n\t\t puts nextterm\n\t\t nextterm=first+second\n\t\t first=second\n\t\t second=nextterm\n\t end\n\t count+=1\n end\nend",
"title": ""
},
{
"docid": "74aba2b505b05d632e7ca3599f61343e",
"score": "0.7807437",
"text": "def fibonacci n\n fib n, [0, 1]\nend",
"title": ""
},
{
"docid": "a4b915caa1ecad6fcaf5aca05582e520",
"score": "0.78014356",
"text": "def fibonacci(num)\n\t\n total = 0\n even_numbers= [1,2]\n\t\n while total <= 4000000\n\t\n total = even_numbers[-2] + even_numbers[-1]\n even_numbers.push(total)\n\t\n end\n \n i = 0\n \n while i < even_numbers.length\n\t\n\tif even_numbers[i] % 2 != 0\n\t even_numbers[i] = 0\n\tend\n\t\n\ti += 1\n end\n\t return even_numbers.inject(:+)\nend",
"title": ""
},
{
"docid": "805b170e156db8746b03713c0bd448eb",
"score": "0.7797813",
"text": "def fibonacci(num)\n\nend",
"title": ""
},
{
"docid": "14b6e2c86c938913dd37df23013d8589",
"score": "0.77845764",
"text": "def fibonacci(n)\n fib = [0, 1]\n 2.upto(n) { |x| fib[x] = fib[x-1] + fib[x-2] }\n fib[n]\n \nend",
"title": ""
},
{
"docid": "f8684c3cfd6a422d201dae86f6169272",
"score": "0.7777631",
"text": "def fibonacci(num)\n sequence = [0,1]\n counter = 2\n while counter < num \n sequence[counter] = sequence[counter - 1] + \n sequence[counter - 2]\n counter += 1\n end\n sequence\n #puts 218922995834555169026 == sequence[num - 1]\nend",
"title": ""
},
{
"docid": "f5001b989cc56bb5ec191620e0cb1e86",
"score": "0.77752966",
"text": "def fibonacci_v1(num)\n sequence = [0, 1]\n\n until sequence.length == num\n result = (sequence[-2] + sequence[-1])\n sequence << result\n end\n sequence\nend",
"title": ""
},
{
"docid": "ae5cae195ea699300c64813b130913e8",
"score": "0.7772945",
"text": "def fibonacci(n)\n return 1 if n <= 2\n p fibonacci(n - 1) + fibonacci(n - 2)\nend",
"title": ""
},
{
"docid": "31d6ff90f25993b8d70d143b8350c492",
"score": "0.7770563",
"text": "def nthFibonacci(n)\r\n if n <= 1\r\n return n\r\n end\r\n sequence = [0, 1]\r\n (n - 1).times do\r\n sequence << sequence[0] + sequence[1]\r\n # puts sequence[-1]\r\n sequence.shift\r\n # puts sequence\r\n end\r\n \r\n return sequence[1]\r\nend",
"title": ""
},
{
"docid": "36dd2d3465265622b0313b542168affb",
"score": "0.77694964",
"text": "def fibonacci(value)\r\nprevVal=0\r\nnextVal=1\r\ncount=0\r\nputs \"First #{value} Fibonacci Numbers Are\"\r\n while count<value do\r\n print \"#{prevVal} \"\r\n temp=prevVal+nextVal\r\n prevVal=nextVal\r\n nextVal=temp\r\n count+=1\r\n end\r\nend",
"title": ""
},
{
"docid": "92dbd873724498d730d0a0e12759781d",
"score": "0.7766867",
"text": "def fib_seq(n)\r\n fibs = [0,1] \r\n until n == fibs.length \r\n i = fibs[-1] + fibs[-2]\r\n fibs = fibs << i\r\n end \r\n p fibs\r\nend",
"title": ""
},
{
"docid": "f110e16e95dd694a071afa32a59020c9",
"score": "0.77644193",
"text": "def fib(n) (n<=2) ? 1 : (fib(n-2)+fib(n-1)) end",
"title": ""
},
{
"docid": "55b90766fe21e07fa83d75ae18088b7a",
"score": "0.7764171",
"text": "def fibonacci(n)\n\n # Write your code here\n \n end",
"title": ""
},
{
"docid": "2a3d6e587545e9b3cb9b2bb7acc841e9",
"score": "0.7754088",
"text": "def fibo (number)\n fibo(number - 1) + fibo(number - 2)\nend",
"title": ""
},
{
"docid": "6a22c41aac4863d06b79d5c420229cb3",
"score": "0.7752501",
"text": "def fibonacci(n)\n return n if n < 2\n values = [0, 1]\n n.times do\n values.push(values[-1]+values[-2])\n end\n values.last\nend",
"title": ""
},
{
"docid": "8753e154bbce6461e2fa896695d40e63",
"score": "0.77506363",
"text": "def fibonacci(num)\n array = [1,1]\n n = 0\n\n num.times do\n array << array[n] + array[n + 1]\n n += 1\n end\n\n array[n - 1]\nend",
"title": ""
},
{
"docid": "c7fe46a8dfbf944e52341ea3ae2e9cee",
"score": "0.7745706",
"text": "def fibonacci(n)\n n = fibonacci( n - 1 ) + fibonacci( n - 2 ) if n > 1\n n\nend",
"title": ""
},
{
"docid": "a9c4ad30cc5477ad0cb31d929b3ab07e",
"score": "0.77453685",
"text": "def fibonacci_sequence(x, y)\n (x..y).inject([0, 1]) {|fib| fib << fib.last(2).inject(:+)}\nend",
"title": ""
},
{
"docid": "84a659c3d5e8e42943fe71d2187c9914",
"score": "0.77444446",
"text": "def fib\n return 0 if 0 == self\n\n bits = self.abs.to_s( 2 ).chars[1..-1]\n v1, v2, v3 = 1, 1, 0\n\n bits.each do |c|\n calc = v2*v2\n v1, v2, v3 = v1*v1 + calc, (v1+v3)*v2, v3*v3 + calc\n v1, v2, v3 = v1 + v2, v1, v2 if '1' == c\n end\n\n # Adjust for negative indices.\n v2 = -v2 if 0 > self && self.even?\n v2\n end",
"title": ""
},
{
"docid": "2b55e79d27c5df8a9acae706542d8ec1",
"score": "0.77441746",
"text": "def fibs(n)\n\nend",
"title": ""
},
{
"docid": "2b55e79d27c5df8a9acae706542d8ec1",
"score": "0.77441746",
"text": "def fibs(n)\n\nend",
"title": ""
},
{
"docid": "2b55e79d27c5df8a9acae706542d8ec1",
"score": "0.77441746",
"text": "def fibs(n)\n\nend",
"title": ""
},
{
"docid": "0c21347b9df4ec22a88bc2b29e1a422e",
"score": "0.7741929",
"text": "def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2] + obj[-1] }\nend",
"title": ""
},
{
"docid": "42236005e16b372ca22b64e3afdc08c9",
"score": "0.77401596",
"text": "def fibonacci(n)\n first, last = [1, 1]\n 3.upto(n) do \n first, last = [last, first + last]\n end\n last.to_s[-1].to_i \nend",
"title": ""
},
{
"docid": "a86addef141759c853aca5f17cbe45f9",
"score": "0.77389324",
"text": "def fibonacci(num)\n if num == 0\n return 0\n elsif num == 1\n return 1\n else\n result = fibonacci(num - 1) + fibonacci(num - 2)\n return result\n end\nend",
"title": ""
},
{
"docid": "4c0b4b5e4f4a66e247a28be46c4568e4",
"score": "0.7729134",
"text": "def fibonacci(n)\n if n.nil? || n < 0\n raise ArgumentError\n # sum the two previous numbers in sequence to the provided number\n elsif n > 1\n x = 1\n fiba = 0\n fibb = 1\n while x < n\n fibb = fiba + fibb\n fiba = fibb - fiba\n x += 1\n end\n elsif\n fibb = n\n end\n\n\n return fibb\nend",
"title": ""
},
{
"docid": "8ccf8cae945a273bc902aea3a62b2f02",
"score": "0.7727573",
"text": "def fibonacci(n)\n\n a = 0\n b = 1\n\n n.times do\n b = a + b\n a = b - a\n end\n\n return a\n\nend",
"title": ""
},
{
"docid": "eca738b624f4c567510e8d10f93d4723",
"score": "0.7724167",
"text": "def fib(int)\n number = [0,1]\n while number.length < int\n number << number[-2] + number[-1]\n end\n return number\nend",
"title": ""
},
{
"docid": "4ab943ac28fd377ba3cc2fcf72289993",
"score": "0.77237135",
"text": "def fibonacci(n)\n sequence = []\n sequence << n\n sequence << (n + n)\n y = 0\n z = 1\n n.times do\n sequence << (sequence[y] + sequence[z])\n y += 1\n z += 1\n end\n puts sequence.last\n end",
"title": ""
},
{
"docid": "5cae3e4baef57d5ef4182384c7033ddc",
"score": "0.7720722",
"text": "def nth_fibonacci num\nstart, first, count = 0,1,0\n until count == num\n fib = start + first\n start, first, count = first, fib, count + 1\n end\n p fib \nend",
"title": ""
},
{
"docid": "3c2000780cdfe15bb2a9d60bade1aa0e",
"score": "0.7719416",
"text": "def fibonacci(n, fib = [1, 1])\n n > 2 ? fibonacci(n - 1, fib << fib[-1] + fib[-2]) : n == 2 ? fib : n == 1 ? [fib.first] : [].first\n end",
"title": ""
},
{
"docid": "8150e1e107ced3a2d9228e0b513d7bdb",
"score": "0.7717452",
"text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fibs = [0,1]\n\n 2.upto(n) do |i|\n fibs << fibs[-2] + fibs[-1]\n end\n\n fibs[-1]\nend",
"title": ""
},
{
"docid": "15a02e3ccd94fb4f95c5d39ef0e815d2",
"score": "0.77168083",
"text": "def fibonacci(n)\r\n n1, n2 = 0, 1\r\n n.times { n1, n2 = n2, n1 + n2 }\r\n n1\r\nend",
"title": ""
},
{
"docid": "44cd86cc0014c09d2e79f90eacddafc9",
"score": "0.771446",
"text": "def fib(num)\n # adds two preceeding numbers to give you fib number (first two numbers are 1, 1)\n # fib sequence is: 1, 1, 2, 3, 5 ,8\n if num == 0\n p 0\n return 0\n elsif num == 1\n p 1\n return 1\n elsif num == 2\n p 1\n return 1\n end\n\n fib_numbers = [1, 1]\n (num - 2).times do |number|\n next_num = fib_numbers.last + fib_numbers[-2]\n fib_numbers << next_num\n end\n p fib_numbers.last\nend",
"title": ""
},
{
"docid": "e6842b80b6e2b3b72aac9e1c81ef4823",
"score": "0.7714327",
"text": "def fibonacci(n)\n a = 0\n b = 1\n\n n.times do\n save_a = a\n a = b\n# Add up previous two numbers\n b = save_a + b\n end\n return a\nend",
"title": ""
},
{
"docid": "2687cba4c84057cb07964ab2852c81ed",
"score": "0.77129954",
"text": "def fib(quantity)\n fib_array = [0, 1]\n fib_number = 0\n (quantity - 2).times {|index| fib_array << fib_array[index] + fib_array[index + 1]}\n p fib_array\nend",
"title": ""
},
{
"docid": "30b71d4f1c20cb8fb7f84c81aa7e0f52",
"score": "0.771267",
"text": "def fibonaci(n)\n return 0 if n == 0\n return 1 if n == 1\n return fibonaci(n - 1) + fibonaci(n - 2) if n > 1\nend",
"title": ""
},
{
"docid": "34d2e96255ad59591146ec71a4e2d5c0",
"score": "0.77107733",
"text": "def fibonacci(n)\r\n\t\treturn $fibonacci[n] if $fibonacci.include?(n)\r\n\r\n\t\tm = n >> 1\r\n\t\tif n.even?\r\n\t\t\tf1 = fibonacci(m - 1)\r\n\t\t\tf2 = fibonacci(m)\r\n\t\t\t$fibonacci[n] = (f1 + f1 + f2) * f2\r\n\t\telse\r\n\t\t\tf1 = fibonacci(m)\r\n\t\t\tf2 = fibonacci(m + 1)\r\n\t\t\t$fibonacci[n] = f1 ** 2 + f2 ** 2\r\n\t\tend\r\n\r\n\t\treturn $fibonacci[n]\r\n\tend",
"title": ""
},
{
"docid": "665a5c07a12693e2655b3b9293fbcad1",
"score": "0.7710512",
"text": "def fibonacci( n )\n fib = [0, 1]\n (2...n).each do |n|\n next_fib = fib[ n - 1 ] + fib[ n - 2 ]\n fib.push(next_fib)\n end\n p fib\nend",
"title": ""
},
{
"docid": "2c6896bbafa1c76f8e1502f59c4f545d",
"score": "0.77088493",
"text": "def fibonacci(n)\n return 1 if n <= 2\n num1, num2 = [1, 1]\n index = 2\n while n > index\n running_total = num1 + num2\n num1, num2 = num2, running_total\n n -= 1\n end\n running_total\nend",
"title": ""
},
{
"docid": "c2b4bdd89b0551d575ab07a18ddd9356",
"score": "0.7707281",
"text": "def fibonacci(n)\n\tx = 0\n\ty = 1\n\n\tn.times do\n\t\tcount = x\n\t\tx = y\n\t\ty = count + y\n\tend\n\n\treturn x\nend",
"title": ""
},
{
"docid": "127b3beef853b6839978eb4a755bba58",
"score": "0.77072054",
"text": "def fibonacci nth\n return 0 if nth == 0\n return 1 if nth == 1\n\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"title": ""
},
{
"docid": "15a4882908bca12c4e2b278aeb02534a",
"score": "0.76980984",
"text": "def fibonacci(n)\n raise \"negative number error = #{n}\" if n < 0\n return [0, 1].take(n) if n < 3\n arr = fibonacci(n - 1)\n arr << arr[-1] + arr[-2]\nend",
"title": ""
},
{
"docid": "85da5bd73a9b9a018a02c7b55c0a2131",
"score": "0.7691125",
"text": "def fibonacci(n)\n fibs = [0, 1]\n if n <= 2\n fibs[0...n]\n else\n fibs = fibonacci(n - 1)\n fibs << fibs[-1] + fibs[-2]\n end\nend",
"title": ""
},
{
"docid": "e63b045581b31da42eda76d365f34a97",
"score": "0.76897514",
"text": "def fibonacci(n)\n\tfibs = []\n\tn1 = 0\n\tn2 = 1 \n\twhile n1 < n\n\t\tfibs << n1 if n1.even?\n\t\tn1,n2 = n2, n1+n2\n\tend\n\tfibs.inject(:+)\nend",
"title": ""
},
{
"docid": "8999e5d3ca3872de9fac4cbfe745b9aa",
"score": "0.76868445",
"text": "def fibs(n)\n seq = [1, 1]\n (n-2).times { seq << seq[-1] + seq[-2] }\n seq\nend",
"title": ""
},
{
"docid": "d66fb88437989fbe83d04a8aa8419a81",
"score": "0.76857346",
"text": "def fib_it(n) \n fib = [0, 1]\n until fib.length == n\n fib << fib[-1] + fib[-2]\n end\n fib\nend",
"title": ""
},
{
"docid": "c01442fb58870ce7f486fb6889d49097",
"score": "0.76851624",
"text": "def fibnacci(n)\n init = [0, 1]\n result = init\n n.times do |i|\n result << result[-1] + result[-2]\n end\n result\nend",
"title": ""
},
{
"docid": "a9b49a30083bd073586141883192d982",
"score": "0.7684755",
"text": "def fibonacci(n)\n # because the first 2 values in fib, are 1's\n return 1 if n == 1 || n == 2\n\n fibonacci(n-1) + fibonacci(n-2)\nend",
"title": ""
},
{
"docid": "4098f7f55f53e834a6cb5a76da08e5bd",
"score": "0.7684739",
"text": "def fibonacci(n)\n a = 0\n b = 1\n raise ArgumentError if n == nil || n < 0\n return 0 if n == 0\n return 1 if n == 1\n\n fib_num = 0\n (n-1).times do\n fib_num = a + b\n a = b\n b = fib_num\n end\n\n return fib_num\n raise NotImplementedError\nend",
"title": ""
},
{
"docid": "3c884ae03329821f43afe79d48876d43",
"score": "0.7683278",
"text": "def fibonacci(n)\n return [0, 1].take(n) if n <= 2\n\n fibs = fibonacci(n - 1)\n fibs << fibs[-1] + fibs[-2]\n\nend",
"title": ""
},
{
"docid": "ac5286bb0ec4a18203de716d7a0075a7",
"score": "0.76823026",
"text": "def nth_fibonacci(nth)\n # Fill In\n end",
"title": ""
},
{
"docid": "3a9b6ff4dbed9097d3ef936b8ac5ec97",
"score": "0.76813215",
"text": "def fibonacci(n)\n raise ArgumentError if n.class != Integer\n raise ArgumentError if n < 0\n return 0 if n == 0\n return 1 if n == 1\n this_num = 1\n previous_num = 0\n index = 0\n\n while index < n - 1\n array = []\n array << previous_num\n array << this_num\n sum = array[0] + array[1]\n previous_num = this_num\n this_num = sum\n index += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "087c8fb063f3312939c8977a9b10614b",
"score": "0.76811403",
"text": "def fib1(i)\r\n#+++solution+++\r\n n = 1\r\n result, previous = 0, 1\r\n while (n <= i)\r\n result, previous = previous, result+previous\r\n n += 1\r\n end\r\n result\r\n#---solution---\r\nend",
"title": ""
},
{
"docid": "9096bdb88dd79073236f40cd288e41de",
"score": "0.76806384",
"text": "def fibonacci(num)\n fib_arr = [1, 1]\n 1.upto(num-2) do |n|\n next_num = fib_arr[n-1] + fib_arr[n]\n fib_arr << next_num\n end \n fib_arr[-1]\nend",
"title": ""
},
{
"docid": "23ca182949acd2b0d081cc315ba32c1f",
"score": "0.76798123",
"text": "def fibonacci(n)\n return [0, 1][0...n] if n <= 2\n sequence = fibonacci(n - 1)\n sequence << (sequence[-2] + sequence[-1])\nend",
"title": ""
},
{
"docid": "8037136ad19f625d1cb388a29473a69c",
"score": "0.7677835",
"text": "def fib(nn)\n #0, 1, 1, 2, 3, 5, 8...\n fib_sequence = [0, 1]\n return 0 if nn == 0\n return 1 if nn == 1\n (nn - 2).times do\n nxt = fib_sequence[0] + fib_sequence[1]\n fib_sequence[0] = fib_sequence[1]\n fib_sequence[1] = nxt\n end\n fib_sequence.reduce(&:+)\nend",
"title": ""
},
{
"docid": "0e048c9729093d819434f98ba29a4428",
"score": "0.7674251",
"text": "def clac_fib(n)\n return 0 if n == 0\n \n sequence = [0,1]\n (1...n).each do |i|\n sequence.push(sequence[i] + sequence[i-1])\n end\n sequence.last\nend",
"title": ""
},
{
"docid": "24626c632553100fa5504531ab81b393",
"score": "0.7671956",
"text": "def fibonacci(int)\n return 1 if int <= 2\n n1, n2, value = 0, 1, 0\n (int-1).times do\n value = n1 + n2\n n1, n2 = n2, value\n end\n value\nend",
"title": ""
},
{
"docid": "24626c632553100fa5504531ab81b393",
"score": "0.7671956",
"text": "def fibonacci(int)\n return 1 if int <= 2\n n1, n2, value = 0, 1, 0\n (int-1).times do\n value = n1 + n2\n n1, n2 = n2, value\n end\n value\nend",
"title": ""
},
{
"docid": "3be2fea2cab1f0a60f87da32af388622",
"score": "0.7666132",
"text": "def fibonacci(n)\n return [0,1].take(n) if n <= 2\n fibs = fibonacci(n -1)\n fibs << fibs[-1] + fibs[-2]\nend",
"title": ""
},
{
"docid": "b4ec2027a4f4904e269c823f593373b1",
"score": "0.76640606",
"text": "def fibonacci(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fibonacci(n - 1) + fibonacci(n - 2)\nend",
"title": ""
},
{
"docid": "5035096e2cc6902eeb340fbea3f533d6",
"score": "0.7662954",
"text": "def fibonnaci(n)\n seq = []\n a = 1\n b = 1\n \n 1.upto(n) do\n seq << a\n c = b\n b = b + a\n a = c\n end\n \n seq\nend",
"title": ""
},
{
"docid": "26e7b592e8d584effb756550c9d02d6b",
"score": "0.76622826",
"text": "def fibonacci(nth) # ONLY useful up to fibonacci(40), take massive quantities of memory\n return 1 if nth <= 2\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"title": ""
},
{
"docid": "91956e4de3a19d74668f9d193a978acb",
"score": "0.7661976",
"text": "def fibonacci(maxNumber)\n ant,sig,sum,actual = 0 ,1 ,0 ,1\n while (sum <= maxNumber) do\n sum += actual if actual.even?\n actual = ant + sig\n ant = sig\n sig = actual\n end\n sum\nend",
"title": ""
},
{
"docid": "adc281f3fad70fdb78134c50765022c9",
"score": "0.76584893",
"text": "def fibonacci(n)\n return 1 if n == 1 || n == 2\n f1 = 1\n f2 = 1\n tmp = 0\n (3..n).each do |i|\n tmp = f1\n f1 = f2\n f2 = tmp + f2\n end\n\n return f2\nend",
"title": ""
},
{
"docid": "4fba9ecc5691f680367800cabf124e3e",
"score": "0.76583284",
"text": "def fibonacci\n seq = [1, 2]\n even = [2]\n while seq.last <= 4000000\n seq << seq[-1] + seq[-2]\n if seq.last % 2 == 0\n even << seq.last\n end\n end\n sum = 0\n even.each do |i|\n sum = sum + i\n end\n puts sum\nend",
"title": ""
},
{
"docid": "71a89a9ba952133db27d1c00cb9e3a4d",
"score": "0.76580477",
"text": "def fibonacci(num)\n return 1 if num <= 2\n fibz = [1,2]\n (num -3).times do \n fibz << fibz.last(2).sum\n end\n fibz.last\nend",
"title": ""
},
{
"docid": "2cf14b44e8ca237a69a0e60f5f747be9",
"score": "0.765791",
"text": "def fib()\n max = 15\n n = 2\n seq = [0, 1]\n while seq.length < max\n seq << ((seq[n - 1]) + (seq[n - 2]))\n n += 1\n end\n seq\nend",
"title": ""
},
{
"docid": "28db413974175e86a9217020ae552c4d",
"score": "0.7654874",
"text": "def fibonacci(n)\n return [1, 1] if n == 2\n return [1] if n <= 1\n prev_step = fibonacci(n - 1)\n prev_step << prev_step[-2..-1].inject(:+)\nend",
"title": ""
}
] |
5a32835bc7566ff52e51599c7b8554c6
|
Called when we're connected. Register with NickServ, if required.
|
[
{
"docid": "83d52789502094c7974e8b3542919134",
"score": "0.83167696",
"text": "def on_connect\n $log.puts \"Connection to '#{@name}' completed.\"\n if (ns = $config[\"servers/#{@name}/services/nickserv\"]) and (pw = ns['password'])\n name = ns['name'] || 'NickServ'\n $log.puts \"Registering with #{name}...\"\n cmd('PRIVMSG', name, 'IDENTIFY', pw)\n cmd('PRIVMSG', name, \"IDENTIFY #{pw}\")\n end\n end",
"title": ""
}
] |
[
{
"docid": "2486c94c0a2941cdefb9908cd2e1f5f5",
"score": "0.6979249",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection. Not connected to a server.\") \n end",
"title": ""
},
{
"docid": "d487c84882dff47824e1baa1d7683dae",
"score": "0.6911046",
"text": "def on_connected; end",
"title": ""
},
{
"docid": "063cf70b593b2cae6002daaf83c56eaf",
"score": "0.68433356",
"text": "def connected!\n transmit :PASS, @options[:password] if @options[:password]\n transmit :NICK, @options[:nickname]\n transmit :USER, @options[:username], :void, :void, @options[:realname]\n end",
"title": ""
},
{
"docid": "aaf002bb015a1b6396e2134f622888dc",
"score": "0.6710973",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection again. Already registered.\") \n end",
"title": ""
},
{
"docid": "d9eefc47c31550ccce60deb3f0a9eb41",
"score": "0.6657301",
"text": "def on_connected\n\t\tend",
"title": ""
},
{
"docid": "d6614c8b656b04bd1a093b1029534690",
"score": "0.6623368",
"text": "def register(context, nick, login, realname)\n\n if context.server.password\n IRC::Commands::PasswordCommand.new(context.server.password).execute(context)\n end \n \n IRC::Commands::NickCommand.new(nick).execute(context)\n IRC::Commands::UserCommand.new(nick, Socket.gethostname, context.server.hostname, realname).execute(context)\n \n context.nick, context.login, context.realname = nick, login, realname\n\n end",
"title": ""
},
{
"docid": "86447eb2997e09c58f56ea8f950fbc56",
"score": "0.6599063",
"text": "def register(context, nick, login, realname)\n end",
"title": ""
},
{
"docid": "e3f2371efe9d979444addf7642e86920",
"score": "0.6577221",
"text": "def post_init\n @username = nil\n @roomid = nil\n @buf = ''\n @lastupdate = Time.now\n\n @@connected_clients.push(self)\n\n puts \"A client has connected...\"\n end",
"title": ""
},
{
"docid": "e197062828dede1658502bdfba1b89e6",
"score": "0.6574193",
"text": "def on_connected\n\tend",
"title": ""
},
{
"docid": "8dbdb9c1e387078251eb28e55812540e",
"score": "0.6558286",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection. Connection registration is only possible in the unregistered state.\")\n end",
"title": ""
},
{
"docid": "6e700e9f6533084708519bc32ff62a34",
"score": "0.6555837",
"text": "def do_connect\n @log.info \"#{@host} #{@port}\"\n \n @socket = TCPSocket.open( @host, @port )\n \n send \"NICK #{@nick}\"\n send \"USER TrunkBot bird trunkbit.com work\"\n \n if @pass\n send \"PASS #{@pass}\"\n send \"PRIVMSG NickServ :identify #{@pass}\"\n end\n \n join @chan\n end",
"title": ""
},
{
"docid": "5d643f8fa64ac03e79bce7edf3192c53",
"score": "0.6537153",
"text": "def on_welcome(text, args)\n @nickmutex.synchronize do\n @nicklist.clear\n @nickthread.each(&:kill)\n @nickthread.clear\n end\n if options[:nickpass] && irc.me != options[:nickname]\n irc.msg \"NickServ\", \"ghost #{options[:nickname]} #{options[:nickpass]}\"\n else\n irc.msg \"NickServ\", \"identify #{options[:nickpass]}\"\n end\n end",
"title": ""
},
{
"docid": "40447cbef1b84bb751a0dd7ee2f4206d",
"score": "0.6520157",
"text": "def process_connect\n self.class.setup\n logger.info \"Initializing the current instance\"\n @channels = []\n connections << self\n logger.info \"Dispatching the default :client_connected event\"\n dispatch :client_connected\n end",
"title": ""
},
{
"docid": "10785e1d508856396949a391e7539b8b",
"score": "0.64968723",
"text": "def registration (thing)\n if thing.class != Incoming\n return\n end\n\n # additional check for nick collisions\n if thing.data[:nick]\n if (thing.server.data[:nicks][thing.data[:nick]] && thing.server.data[:nicks][thing.data[:nick]] != thing) || thing.server.clients[thing.data[:nick]]\n if thing.data[:warned] != thing.data[:nick]\n thing.send :numeric, ERR_NICKNAMEINUSE, thing.data[:nick]\n thing.data[:warned] = thing.data[:nick]\n end\n\n return\n end\n\n thing.server.data[:nicks][thing.data[:nick]] = thing\n end\n\n # if the client isn't registered but has all the needed attributes, register it\n if thing.data[:user] && thing.data[:nick]\n if thing.config.attributes['password'] && thing.config.attributes['password'] != thing.data[:password]\n return false\n end\n\n client = thing.server.connections.things[thing.socket] = Client.new(thing)\n\n client.nick = thing.data[:nick]\n client.user = thing.data[:user]\n client.realName = thing.data[:realName]\n\n # clean the temporary hash value and use the nick as key\n thing.server.connections.clients[:byName][client.nick] = client\n thing.server.connections.clients[:bySocket][client.socket] = client\n\n thing.server.data[:nicks].delete(client.nick)\n\n thing.server.execute(:registered, client)\n\n client.send :numeric, RPL_WELCOME, client\n client.send :numeric, RPL_HOSTEDBY, client\n client.send :numeric, RPL_SERVCREATEDON\n client.send :numeric, RPL_SERVINFO, {\n :client => Base.supportedModes[:client].join(''),\n :channel => Base.supportedModes[:channel].join(''),\n }\n\n supported = String.new\n\n Base.support.each {|key, value|\n if value != true\n supported << \" #{key}=#{value}\"\n else\n supported << \" #{key}\"\n end\n }\n\n supported = supported[1, supported.length]\n\n client.send :numeric, RPL_ISUPPORT, supported\n\n if !client.modes.to_s.empty?\n client.send :raw, \":#{server} MODE #{client.nick} #{client.modes}\"\n end\n\n motd(client)\n\n server.execute :connected, client\n end\n end",
"title": ""
},
{
"docid": "fd8a830d8dcb2a055e681928ee8c9332",
"score": "0.6484959",
"text": "def connect()\n if (!@connected)\n @socket = TCPSocket.new(@server, @port)\n @connected = true\n send \"USER rubybot rubybot rubybot RubyBot\"\n set_nick(@nick)\n if @verbose\n while @connected do\n receive(@socket.gets.to_s.strip)\n end\n end\n else\n raise \"Attempting to connect an already-connected IRC client instance.\"\n end\n end",
"title": ""
},
{
"docid": "ee212bc9da84e530435c350cd21c3918",
"score": "0.6462869",
"text": "def connect()\n @irc = TCPSocket.open(@server, @port)\n send \"USER #{@nick} gangbot pt1 :#{@nick}\"\n send \"NICK #{@nick}\"\n send \"JOIN #{@channel}\"\n end",
"title": ""
},
{
"docid": "9d15300df28caa2cd643bc0ae1f25a73",
"score": "0.64557725",
"text": "def connect()\n @irc = TCPSocket.open(@server, @port)\n send \"USER #{@nick} gangbot pt2 :#{@nick}\"\n send \"NICK #{@nick}\"\n send \"JOIN #{@channel}\"\n end",
"title": ""
},
{
"docid": "f396241c776a188125c6c50eadf0dde1",
"score": "0.6450076",
"text": "def connect_socket\n @irc = Net::YAIL.new(@options)\n setup_reporting(@irc)\n\n # Simple hook for welcome to allow auto-joining of the channel\n @irc.on_welcome self.method(:welcome)\n\n add_custom_handlers\n end",
"title": ""
},
{
"docid": "0b63107b21324098b7df262b27971f66",
"score": "0.6410858",
"text": "def register (thing)\n\t\treturn unless thing.incoming?\n\n\t\t# if the client isn't registered but has all the needed attributes, register it\n\t\tif thing.temporary.user && thing.temporary.nick\n\t\t\treturn false if thing.options[:password] && thing.options[:password] != thing.temporary.password\n\n\t\t\t(client = thing).extend Client\n\n\t\t\tclient.nick = thing.temporary.nick\n\t\t\tclient.user = thing.temporary.user\n\t\t\tclient.real_name = thing.temporary.real_name\n\n\t\t\t@clients[client.nick] = client\n\n\t\t\tserver.fire :registered, client\n\n\t\t\tclient.send_message RPL_WELCOME, client\n\t\t\tclient.send_message RPL_HOSTEDBY, client\n\t\t\tclient.send_message RPL_SERVCREATEDON\n\t\t\tclient.send_message RPL_SERVINFO,\n\t\t\t\tclient: Support::Modes::Client,\n\t\t\t\tchannel: Support::Modes::Channel\n\n\t\t\tclient.send_message RPL_ISUPPORT, Support.to_hash.map {|key, value|\n\t\t\t\tvalue != true ? \"#{key}=#{value}\" : key\n\t\t\t}.join(' ')\n\n\t\t\tunless client.modes.empty?\n\t\t\t\tclient.send_message \":#{server} MODE #{client.nick} #{client.modes}\"\n\t\t\tend\n\n\t\t\tmotd(client)\n\n\t\t\tserver.fire :connected, client\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8975fbad12790c1c1da2d09662ce0278",
"score": "0.63788587",
"text": "def connect\n log \"Connecting\"\n @socket = TCPSocket.new(config[:server], 6667)\n write \"USER #{config[:nick]} #{config[:nick]} #{config[:nick]} :#{config[:nick]}\"\n write \"NICK #{config[:nick]}\"\n write \"JOIN ##{config[:channel]}\"\n end",
"title": ""
},
{
"docid": "18276b4f2f96ac4c66397648f31c1f82",
"score": "0.62194645",
"text": "def process_connect\n self.class.setup\n logger.info \"Initializing the current instance\"\n self.channels = []\n self.connections << self\n logger.info \"Setting the client for each handler\"\n self.handlers.each { |h| h.client = self if h.respond_to?(:client=) }\n logger.info \"Dispatching the default :client_connected event\"\n dispatch :client_connected\n end",
"title": ""
},
{
"docid": "cf97540a998e21814cc59a9dd79b0dcc",
"score": "0.62114215",
"text": "def on_nick(fullactor, actor, nickname)\n if irc.me == nickname\n irc.msg \"NickServ\", \"identify #{options[:nickpass]}\"\n end\n \n actor = actor.downcase\n nickname = nickname.downcase\n @nickmutex.synchronize do\n @nicklist.each do |target, nicklist|\n if nicklist.delete?(actor)\n nicklist.add(nickname)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4fe328b74bf2912ca9d771530db9b651",
"score": "0.6206266",
"text": "def connect()\n # Connect to the IRC server\n @irc = TCPSocket.open(@server, @port)\n @irc2 = TCPSocket.open(\"za.shadowfire.org\", 6667)\n @initialising = true\n send \"USER blah blah blah :blah blah\"\n send \"PASS #{@pass}\" \n send \"NICK #{@nick}\" \n send \"JOIN #{@channel}\"\n send \"MODE #{@nick} +B\"\n @initialising = false \n end",
"title": ""
},
{
"docid": "cc1329da79f28f49a7b115a8cd307e33",
"score": "0.61899656",
"text": "def initialize\n\[email protected]\n\[email protected] \"USER #{NICK} 0 * :#{NICK} #{NICK}\"\n\tsleep 1\n\[email protected] \"NICK #{NICK}\"\n\tsleep 1\n\[email protected] \"JOIN ##{CHAN}\"\n\tsleep 1\nend",
"title": ""
},
{
"docid": "c22df39f5997539743e009dce312d979",
"score": "0.6182705",
"text": "def on_socket_connect\n $logger.info 'Connected to chat!'\n end",
"title": ""
},
{
"docid": "d4cf66f1dcb4bff5c8627464cfdb495c",
"score": "0.61741036",
"text": "def post_init\n puts \"Connected\"\n execute \"USER #@nick botz botz :Botz\"\n execute \"NICK #@nick\"\n execute \"JOIN #@channel\"\n end",
"title": ""
},
{
"docid": "80e13090a9251d9e06de79f0d38da916",
"score": "0.61554885",
"text": "def post_init\n server.log(\"Client #{id} has connected to the server\")\n end",
"title": ""
},
{
"docid": "eb644763b2bd1fee2d6a74b93399219c",
"score": "0.61373085",
"text": "def connect\n @socket = TCPSocket.open(@settings[:server], @settings[:port])\n send :user, \"#{@settings[:nick]} 0 * #{@settings[:real_name]}\"\n send :nick, @settings[:nick]\n identify @settings[:password]\n send :join, @settings[:channel]\n say @settings[:hello]\n\n [email protected]?\n end",
"title": ""
},
{
"docid": "9241ff6ae5257ebacc088a52d6d93907",
"score": "0.61369854",
"text": "def post_init\n puts \"TCP connection attempt completed successfully and a new client has connected.\"\n ask_username\n end",
"title": ""
},
{
"docid": "90b7a26066575c094b64fba800cc28f0",
"score": "0.6131656",
"text": "def identify\n write \"NICKSERV :identify #{config[:nick_pwd]}\"\n write \"MODE #{config[:nick]} +B\"\n write \"JOIN ##{config[:channel]}\"\n end",
"title": ""
},
{
"docid": "511199646de92035387379a0ef5ff426",
"score": "0.6128524",
"text": "def on_connected(&block) @on_connected_callback = block end",
"title": ""
},
{
"docid": "fa59c5743a33dbdbf84deb34aca7a055",
"score": "0.61080205",
"text": "def on_connect(socket)\n end",
"title": ""
},
{
"docid": "646a2ded6787b3405f17086cdd4fa52f",
"score": "0.60978985",
"text": "def register\n @host = Socket.gethostname\n end",
"title": ""
},
{
"docid": "1854b4ceffed99975019070a622c69e8",
"score": "0.60829854",
"text": "def handle(context)\n \n # Notify all connection listeners by calling their on_server_response method.\n super(context)\n \n # Notify all connection listeners by calling their on_nick method.\n notify(context) do |connection_listener| \n connection_listener.on_nick_already_in_use(context, nick_name_in_use)\n end\n\n end",
"title": ""
},
{
"docid": "75b02e5cd96a61dec9a9cd338f14cf5e",
"score": "0.6078438",
"text": "def register(nick = nil, login = nil, realname = nil)\n @context.register(nick, login, realname)\n end",
"title": ""
},
{
"docid": "e5e65329d4169107f18d754c3eee1b9d",
"score": "0.6069181",
"text": "def on_connect(conn) end",
"title": ""
},
{
"docid": "b10cbd939df783bffd7b064a0f2ff39d",
"score": "0.6060262",
"text": "def handle(context)\n \n # Notify all connection listeners by calling their on_server_response method.\n super(context)\n \n # Notify all connection listeners by calling their on_nick method.\n notify(context) do |connection_listener| \n connection_listener.on_nick(context, context.lookup_user(before), context.lookup_user(after))\n end\n\n end",
"title": ""
},
{
"docid": "16626acac9ed9bcf4bcc1da10ae81308",
"score": "0.60579157",
"text": "def post_init\n puts \"TCP connection attempt completed successfully and a new client has connected.\"\n send_line(\"-> Welcome abord bro\")\n end",
"title": ""
},
{
"docid": "3378caa0d3a0192b9c1879dcbebc4ef9",
"score": "0.60570514",
"text": "def on_socket_connect\n post_init\n end",
"title": ""
},
{
"docid": "a91ce38db9c16db136e3cbbc5e6c1947",
"score": "0.60556185",
"text": "def post_init\n super\n\n log(\"Connecting to server sending a logon message with our COMP_ID <#{@comp_id}>\")\n\n @logged_in = false\n\n EM.next_tick { send_logon }\n end",
"title": ""
},
{
"docid": "c9878f5cf7477301c2952bda7ac0f901",
"score": "0.60256",
"text": "def connect\n end",
"title": ""
},
{
"docid": "9900a1201bdf4a4d5f8962fbd20b9ef7",
"score": "0.6024442",
"text": "def handle_client_connected(opts = {})\n logger.info \"About to handle client connected\"\n # If the pass is set\n unless self.pass.blank?\n logger.info \"Sending pass for connection\"\n command :pass, self.pass\n end\n # IRC Connection is establish so we send all the required commands to the server.\n logger.info \"Setting default nickname\"\n default_nickname = self.nicks.shift\n nick default_nickname\n logger.info \"sending user command\"\n command :user, self.configuration.user, \"0\", \"*\", Marvin::Util.last_param(self.configuration.name)\n rescue Exception => e\n Marvin::ExceptionTracker.log(e)\n end",
"title": ""
},
{
"docid": "a8d5c53318723366ea1a73ddfbfde02a",
"score": "0.601965",
"text": "def on_ready\n @connected = true\n on_connect\n end",
"title": ""
},
{
"docid": "0dae5f153895f6eaefc94a2d5ee5e1e7",
"score": "0.60148287",
"text": "def begin_listen!\n url = start['url']\n user_data = auth\n @id = user_data['user_id']\n @name = user_data['user']\n\n connect!(url: url) do |message, channel|\n send_found_documentation(message, channel)\n end\n end",
"title": ""
},
{
"docid": "716c876a989944570d3968e4654fbe3e",
"score": "0.5998",
"text": "def on_connect(_adapter, _connection)\n # If IRC is addressable, send \"Betabot is here!\" to #mychannel on the IRC server group named \"myserver\"\n # @bot.address_str('irc:::myserver:::#mychannel')&.reply('Betabot is here!')\n end",
"title": ""
},
{
"docid": "74560e252b02f89c5bd61a277bbd19fa",
"score": "0.59890413",
"text": "def handle_connected(cmd)\n if cmd =~ /^USER (\\S+) (\\S+) (\\S+) :(.*)$/\n add_output \":#{SERVER} NOTICE AUTH :*** Looking up your hostname...\"\n @connected = true\n return\n end\n\n add_output \":#{SERVER} ERROR :You need to authenticate or something\"\n end",
"title": ""
},
{
"docid": "40e7b3ef2f0756ec8db0becd55d9cba6",
"score": "0.59447515",
"text": "def connect\n end",
"title": ""
},
{
"docid": "40e7b3ef2f0756ec8db0becd55d9cba6",
"score": "0.59447515",
"text": "def connect\n end",
"title": ""
},
{
"docid": "b48b3be07bd3367ad4d12705bc0a974f",
"score": "0.59446",
"text": "def register(nick = nil, login = nil, realname = nil)\n state.register(self, nick || self.nick, login || self.login, realname || self.realname)\n end",
"title": ""
},
{
"docid": "4d9af8f71c9d8f31953e675097dc642c",
"score": "0.59427524",
"text": "def on_connect( username, password, address, expected_host_id )\n\t\tself.log.info \"Connect from %s: (user = %s)\" % [ address, username ]\n\tend",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.5924609",
"text": "def connect!; end",
"title": ""
},
{
"docid": "d75bfd3b4f0b0ecba6cb1c7a64e0c099",
"score": "0.5921942",
"text": "def on_open(env)\n send_data([\n \"system_message\",\n { text: \"Welcome to Ranchat\" }\n ].to_json)\n\n # Add connection\n if @@connections.has_key?(@id)\n # Send user_connected event to all\n @@connections[@id].each do |c|\n c.send_data([\n \"user_connect\",\n { name: \"Anonymous\" }\n ].to_json)\n end\n @@connections[@id] << self\n else\n @@connections[@id] = [ self ]\n end\n\n\n\n p \"<DEBUG> Client connected\"\n end",
"title": ""
},
{
"docid": "79b8a0de302396a4ab93c6c27cba3254",
"score": "0.59044933",
"text": "def connect()\n\t@socket = TCPSocket.open(@host, @port)\n if not @server_password == \"\"\n send \"PASS #{@server_password}\"\n end\n\tsend \"USER #{@nick} 0 * #{@nick}\"\n\tsend \"NICK #{@nick}\"\n if not @nickserv_password == \"\"\n send \":source PRIVMSG userserv :login #{@nick} #{@nickserv_password}\"\n end\n\tsend \"JOIN #{@chan}\"\nend",
"title": ""
},
{
"docid": "c16a565e02355cab58421c0fe6c6dd7b",
"score": "0.5903287",
"text": "def on_welcome(context, user, text)\n context.nick = user.nick\n end",
"title": ""
},
{
"docid": "5a0c0e1a3587b43039c2ecace4a12cc5",
"score": "0.58867025",
"text": "def on_connect( user, pass, address, expected_host_id=WILDCARD_HOSTID )\n\t\tself.log.info \"Connect: %s@%s\" % [ user, address ]\n\t\tunless expected_host_id == WILDCARD_HOSTID || expected_host_id == self.host_id\n\t\t\tself.log.warn \" connection expected a different hostid (%p). Ignoring connection.\" %\n\t\t\t\t[ expected_host_id ]\n\t\t\treturn\n\t\tend\n\n\t\t# Create the session's avatar\n\t\tself.log.debug \" creating %s's avatar\" % [ user ]\n\t\tavatar = Verse::ObjectNode.new\n\t\tself.log.debug \" adding avatar: %p\" % [ avatar ]\n\t\tself.add_node( avatar )\n\n\t\tself.log.debug \" sending connect_accept back to %p\" % [ address ]\n\t\tsession = Verse.connect_accept( avatar, address, self.host_id )\n\t\tavatar.session = session\n\t\tself.observe( session )\n\t\tconnection = Verse::Server::Connection.new( address, user, session, avatar, [] )\n\n\t\tself.log.debug \" adding the connection (total: %d)\" % [ self.connections.length + 1 ]\n\t\tself.connections[ address ] = connection\n\tend",
"title": ""
},
{
"docid": "6e28831757e831ba8bb4f8daa5a777d7",
"score": "0.5876096",
"text": "def start\n log.info \"Connecting to #{@config.server}:#{@config.port}\" unless @config.environment == :test\n @irc = IRC.new(self, @config)\n @irc.connect\n end",
"title": ""
},
{
"docid": "23432284ace014ec03e9b0de6561ad74",
"score": "0.5874163",
"text": "def connect\n @sock = Jabber::Simple.new(@config[:jabber_id], @config[:password])\n# presence(@config[:presence], @config[:status], @config[:priority])\n end",
"title": ""
},
{
"docid": "fee7aeeb190ad6d330de65f74b887ed1",
"score": "0.5868647",
"text": "def connect\n @jabber = Jabber::Client.new( jabber_id )\n if @config[:host]\n @jabber.connect( @config[:host], 5222 )\n else\n @jabber.connect\n end\n @jabber.auth( @config[:password] )\n @jabber.send( Jabber::Presence.new.set_type( :available ) )\n deliver( Command.master, (@config[:startup_message] || \"NAME reporting for duty.\").gsub(\"NAME\", @config[:name]))\n\n start_listener_thread\n Thread.stop\n end",
"title": ""
},
{
"docid": "02560e3cf1890e06db0787ec900c6f27",
"score": "0.5867537",
"text": "def connect!\n connect\n end",
"title": ""
},
{
"docid": "b3bed3595ee151178c9498caa2b9a758",
"score": "0.5865597",
"text": "def connect!\n connect(true)\n end",
"title": ""
},
{
"docid": "1f3e51dab6bae176b0cf9c8f09713faa",
"score": "0.58617127",
"text": "def register\n send registration_packet\n end",
"title": ""
},
{
"docid": "cb3d7cd98a171ff4ca1b7a1a6ed53a26",
"score": "0.5853581",
"text": "def register_server\r\n @server = Server.new\r\n end",
"title": ""
},
{
"docid": "f1bfa59337d657a9b40a2a00fa2ac1e0",
"score": "0.58484286",
"text": "def connect\n @connected = true\n end",
"title": ""
},
{
"docid": "cebf4a35e778eb9a60200bc33f50b182",
"score": "0.58464795",
"text": "def post_init\n logger.debug \"Listening from #{client_name}\"\n end",
"title": ""
},
{
"docid": "66dfa866d4259e16ffda945339b362e7",
"score": "0.58412635",
"text": "def on_ready\n\t\t@@channel = MusicGroup.new if @@channel.nil?\n\t\t\n\t\t@sid = @@channel.subscribe do |msg|\n\t\t\tsend_message msg\n\t\tend\n\t\t\n\t\tlog \"connect\"\n\tend",
"title": ""
},
{
"docid": "ea2bea6198ea742d076a6a6ed2db11d0",
"score": "0.5837773",
"text": "def connect\n quithandler = lambda { send_quit(); IRCConnection.quit }\n trap(\"INT\", quithandler)\n trap(\"TERM\", quithandler)\n\n IRCConnection.handle_connection(@server, @port, @nick, @realname, @@options) do\n # Log in information moved to IRCConnection\n @threads = []\n IRCConnection.main do |event|\n if event.kind_of?(Array)\n event.each {|event|\n thread_event(event)\n }\n else\n thread_event(event)\n end\n # Memory leak patch thanks to Patrick Sinclair\n @threads.delete_if {|thr| thr.stop? }\n end\n @threads.each {|thr| thr.join }\n end\n end",
"title": ""
},
{
"docid": "7e755a7d4fb29fcfcd086d09c006074f",
"score": "0.5834622",
"text": "def connected!\n @waiting_for_cap = true\n @capabilities.clear\n\n transmit :CAP, 'LS'\n transmit :PASS, @options['password'] if @options['password']\n transmit :NICK, @options['nickname']\n transmit :USER, @options['username'], 'void', 'void', @options['realname']\n\n @last_pong_time = Time.now\n end",
"title": ""
},
{
"docid": "2f51e1be632759492cb7f9151fb42cbc",
"score": "0.58339494",
"text": "def connect\n return if connected?\n super\n formatsend(\"Aa1~\"+@progname+\"~\"+@progversion+\"~\"+@freetext)\r\n # subscribe to connections\r\n send(\"Ac1\");\r\n # request client list\r\n send(\"Ab\")\r\n # subscribe to chats\r\n send(\"Db1\");\r\n # subscribe to games msg (to see others games)\r\n send(\"Af1\");\r\n end",
"title": ""
},
{
"docid": "ed81aecf17668e1ade3729c41e4b7deb",
"score": "0.58197606",
"text": "def connect\n cycle_connect\n @irc = BaseIRC::IRC.new(socket)\n irc.nick(nickname)\n irc.user(username, 8, real_name)\n if(password)\n irc.pass(password)\n end\n if(factory)\n callback_supervisor.unlink(factory)\n factory.terminate\n end\n callback_supervisor.supervise_as(\"factory_#{name}\", Carnivore::Irc::Util::Factory,\n :socket => socket,\n :notify => current_actor\n )\n debug \"Starting production\"\n factory.async.produce\n debug \"Production in progress\"\n end",
"title": ""
},
{
"docid": "6fa6bc4f31129d50e75629a2efa54d33",
"score": "0.58146596",
"text": "def connect\n jid = Jabber::JID.new(@config[:jabber_id])\n logger.info(\"Connecting as %s...\",jid)\n begin\n @jabber = Jabber::Framework::Bot.new(jid, @config[:password])\n if connected?\n logger.info(\"Connected.\")\n # connect our avatar\n set_avatar\n\n jabber.stream.add_message_callback do |message|\n message = TykeMessage.new(self,message)\n # push private chats into the firehose as well (this may well break things)\n publish(:firehose, message) unless message.delay?\n publish_command(message) if valid_command?(message)\n end\n end\n rescue Exception => e\n logger.error(e)\n end\n end",
"title": ""
},
{
"docid": "68ba607ed62d8a251a3f479d68623bfc",
"score": "0.58052677",
"text": "def register_server(name, port); end",
"title": ""
},
{
"docid": "47f58ed7912dd714f576d69859bc2e70",
"score": "0.57966644",
"text": "def connect(args)\r\n email = @email.split('@')\r\n @server.write(\r\n @irc_proto.helper.nick(@nick),\r\n @irc_proto.helper.user(email[0], '0', '*', @realname)\r\n )\r\n end",
"title": ""
},
{
"docid": "2b5f4bfc6c0b26e80ddf6b4293bb2ebc",
"score": "0.57935673",
"text": "def connect\n @client.connect\n @client.auth(@password)\n @client.send(Presence.new.set_type(:available))\n \n #the \"roster\" is our bot contact list\n @roster = Roster::Helper.new(@client)\n \n #...to accept new subscriptions\n start_subscription_callback\n \n #...to do something with the messages we receive\n start_message_callback\n \n #When the backend application has done its job, it tells the listener\n #via the \"listener\" message queue.\n process_queue\n end",
"title": ""
},
{
"docid": "5b9a9dce64cea81bad93cbb04abd905c",
"score": "0.579339",
"text": "def nick(nickname)\n write \"NICK \"+nickname\n end",
"title": ""
},
{
"docid": "7bb469f7e650e18e9b41371202a0a27f",
"score": "0.57804775",
"text": "def register_server(name, &block); end",
"title": ""
},
{
"docid": "70a12ff38942c6ce691090c04f3c8711",
"score": "0.57769716",
"text": "def on_init\n\n # Request modes from ChanServ, if needed.\n $log.puts \"Channel #{@name} joined!\"\n if (cs = $config[\"servers/#{@server.name}/channels/#{@nname}/chanserv\"])\n name = $config[\"servers/#{@server.name}/services/chanserv/name\"] || 'ChanServ'\n $log.puts \"Requesting modes from #{name}...\"\n @server.cmd('PRIVMSG', name, \"OP #{@name}\") if cs['op']\n @server.cmd('PRIVMSG', name, \"VOICE #{@name}\") if cs['voice']\n end\n\n # Call plugin hooks.\n call_hooks(:init_chan)\n\n end",
"title": ""
},
{
"docid": "2242e63d0f8b7e8ed144388e526339e1",
"score": "0.57681465",
"text": "def on_client_connect(client)\n\tend",
"title": ""
},
{
"docid": "cb06ea94521903458ec775eb4ad3d87f",
"score": "0.5764689",
"text": "def set_nick(nick)\n @nick = nick\n send \"NICK #{@nick}\"\n end",
"title": ""
},
{
"docid": "ab608b8b25fb41e1b21f1c09bfdc47a8",
"score": "0.57568896",
"text": "def init_connect_listener\n start_connect_listener\n end",
"title": ""
},
{
"docid": "27265578991f0809e17651ea2055271d",
"score": "0.57568485",
"text": "def connect()\n\tputs \"entered connect thread\"\n\t@socket = TCPSocket.open(@host, @port)\n\tsend \"USER #{@nick} 0 * #{@nick}\"\n\tsend \"NICK #{@nick}\"\n\tsend \":source PRIVMSG userserv :login #{@nick} swagswag\"\n\tsend \"JOIN #{@chan}\"\n\t`logger \"#{@nick} connected to #{@host}\"`\nend",
"title": ""
},
{
"docid": "dffa53296eb5c28bb3ec07588d11c8cb",
"score": "0.5747337",
"text": "def listen_for_connections\n LividPenguin::Connection.reset_conn_count\n @tcp_ip_server = EM.start_server(@config[:address], @config[:port], LividPenguin::Connection, @logger)\n log(:info, \"server listening for connections on: #{@config[:address]}:#{@config[:port]}\")\n end",
"title": ""
},
{
"docid": "929765e1f18a2e8817013d0c335d897d",
"score": "0.5739623",
"text": "def register\n @@register ||= {:servers => [], :default_password => \"\", :default_user => \"root\"}\n end",
"title": ""
},
{
"docid": "853013ecbf10eeb857212ecab3d918a2",
"score": "0.5731783",
"text": "def post_init\n super\n send_line \"NOTICE AUTH :Marvin Server v#{Marvin.version} initialized, welcome.\"\n end",
"title": ""
},
{
"docid": "25eff075345dc4bd58972405f001c211",
"score": "0.57263404",
"text": "def connect; end",
"title": ""
},
{
"docid": "25eff075345dc4bd58972405f001c211",
"score": "0.57263404",
"text": "def connect; end",
"title": ""
},
{
"docid": "2a8894f9f87985e52a8e20c730416237",
"score": "0.5721869",
"text": "def connect(*) end",
"title": ""
},
{
"docid": "4f2d27fccdb870e614eec96b8d662d5a",
"score": "0.5721437",
"text": "def connect\n @xmpp_client.connect\n @xmpp_client.auth(@password)\n @xmpp_client.send(Presence.new.set_type(:available))\n @xmpp_client.send(Presence.new.set_status(@presence))\n\n # Process the messages we receive\n start_message_callback\n\n # Handle any subscription/presence requests\n listen_for_subscription_requests\n\n # When the backend application has done its job, it tells the listener\n # via the \"listener\" message queue.\n process_queue\n end",
"title": ""
},
{
"docid": "0f90cc95de96139b1c3b9b80eed3332c",
"score": "0.5712911",
"text": "def hook_init_chan(irc)\n irc.channel.users.each do |nn, u|\n irc.from = u\n auto_ident(irc, true)\n end\n end",
"title": ""
},
{
"docid": "1f796e4ff6ae3faa66b368e3e057edd2",
"score": "0.57031083",
"text": "def client_connected\n # incrementamos contadores\n if !controller_store[:users_count].blank?\n controller_store[:users_count] += 1\n else\n controller_store[:users_count] = 0\n end\n # Se notifica a todos los conectados por multidifusión\n logger.debug message.inspect\n broadcast_message :users_count_changed, {users_count: controller_store[:users_count]}\n # Se notifica al usuario que se acaba de conectar\n send_message :connection_success, {message: 'Conexión ok. Habla ahora o calla para siempre.'}\n end",
"title": ""
},
{
"docid": "411b21a5bce05b91e6f9a4ed5a10a0eb",
"score": "0.5696884",
"text": "def connect!\n connection(true)\n end",
"title": ""
},
{
"docid": "ae9457b40fab218ca6ddf98f0152ae21",
"score": "0.56876844",
"text": "def ch_nick(nick)\n IRCConnection.send_to_server(\"NICK #{nick}\")\n @nick = nick\n end",
"title": ""
},
{
"docid": "7214d6d4215aed6b3780ca78c0deaa6d",
"score": "0.56796825",
"text": "def connect\n\t\tend",
"title": ""
},
{
"docid": "1dc8d4e0338924025ea1863a541be6ca",
"score": "0.5679302",
"text": "def on_connected(event = nil)\n\t\t\t\treturn unless zk.connected?\n\t\t\t\t\n\t\t\t\taddress = @node_address.call\n\t\t\t\tif @node_path.nil? or not zk.exists?(@node_path)\t# Create presence node as it doesn't exist\n\t\t\t\t\t#p 'node re-created'\n\t\t\t\t\t@last_known_address = address\n\t\t\t\t\tconnect_setup\n\t\t\t\telsif @last_known_address != address\t\t# Recreate existing presence node as our IP changed\n\t\t\t\t\t#p 'node ip_changed, recreating'\n\t\t\t\t\tzk.async.ensure(:delete, @node_path)\n\t\t\t\t\t@last_known_address = address\n\t\t\t\t\tconnect_setup\n\t\t\t\telse\t\t\t\t\t\t\t\t\t\t\t\t# Else our node presence information is accurate, lets get the latest list\n\t\t\t\t\t@nodes = zk.children(@base_path, :watch => true)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tupdate_node_information\t\t\t\t\t\t\t\t# inform listeners of a node list update\n\t\t\tend",
"title": ""
},
{
"docid": "092afa9178a6672a9da44adc1f8cedab",
"score": "0.56519145",
"text": "def on_connect forever = false, &block\n on \"connected\", forever, &block\n end",
"title": ""
},
{
"docid": "00dd4731fa859530a0148a03dbe3aead",
"score": "0.5650594",
"text": "def hook_thyself\n me = self\n\n # Connect on join\n register_hook(:chan_connect, nil, [/connect/]){\n me.join_on_connect(bot)\n }\n end",
"title": ""
},
{
"docid": "820a165ee527d2ec5e44a169b6c25fed",
"score": "0.5648289",
"text": "def run\n begin\n log \"connecting...\"\n @notifo = Notifo.new(@service_user, @service_key)\n log \"connected\"\n \n if @task == :subscribe\n log \"subscribing #{@username}\"\n @notifo.subscribe(@username)\n else\n log \"sending #{@message} to #{@username}\"\n @notifo.post(@username, @message)\n end\n rescue => ex\n log \"Exception: #{ex.message}\"\n raise ex\n end\n end",
"title": ""
},
{
"docid": "fb78f9635b98c2b02302e52368e96760",
"score": "0.5644504",
"text": "def connected?; end",
"title": ""
},
{
"docid": "fb78f9635b98c2b02302e52368e96760",
"score": "0.5644504",
"text": "def connected?; end",
"title": ""
},
{
"docid": "fb78f9635b98c2b02302e52368e96760",
"score": "0.5644504",
"text": "def connected?; end",
"title": ""
},
{
"docid": "fb78f9635b98c2b02302e52368e96760",
"score": "0.5644504",
"text": "def connected?; end",
"title": ""
}
] |
41bb8b07db4a265fdfb2bbd1ac008774
|
open or create TAG_FILE
|
[
{
"docid": "3f76fd27f41c7ec9bedcc2382406f954",
"score": "0.55107677",
"text": "def open_tags_config\n tag_file_path = File.join(SETTINGS_DIR, TAG_FILE)\n Dir.mkdir(SETTINGS_DIR) unless File.exists?(SETTINGS_DIR)\n FileUtils.touch(tag_file_path)\n YAML.load_file(tag_file_path) || {:tags => [\"master\"], :current => \"master\"}\n end",
"title": ""
}
] |
[
{
"docid": "572b9b6acdc51ffdb1416fe568cce5e2",
"score": "0.67359",
"text": "def newFile (flag)\n\n if (flag == true)\n @current_final_path = getFinalPath\n @sizeCounter = 0\n end\n\n if (@tags.size != 0)\n @tempFile = File.new(@current_final_path+\".tag_\"+@tag_path+\"part\"[email protected]_s+\".txt\", \"w\")\n else\n @tempFile = File.new(@current_final_path+\".part\"[email protected]_s+\".txt\", \"w\")\n end\n\n end",
"title": ""
},
{
"docid": "b924d4cee7b4f3f4233e297918f2dd00",
"score": "0.66778195",
"text": "def open(file_name, create = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "bcbf9a872cf5855bf117ab351d11badb",
"score": "0.6565691",
"text": "def popular_xml_file(tag)\n fname = popular_fname(tag)\n File.open fname\n end",
"title": ""
},
{
"docid": "d291704193b2a9fa94e3d1ff659509d4",
"score": "0.65434265",
"text": "def close\n return if @file.nil?\n if @tag1 != @tag_orig\n @tag_orig.update(@tag1)\n @file.reopen(@filename, 'rb+')\n @file.seek(-TAGSIZE, File::SEEK_END)\n t = @file.read(3)\n if t != 'TAG'\n #append new tag\n @file.seek(0, File::SEEK_END)\n @file.write('TAG')\n end\n str = [\n @tag_orig[\"title\"]||\"\",\n @tag_orig[\"artist\"]||\"\",\n @tag_orig[\"album\"]||\"\",\n ((@tag_orig[\"year\"] != 0) ? (\"%04d\" % @tag_orig[\"year\"]) : \"\\0\\0\\0\\0\"),\n @tag_orig[\"comments\"]||\"\",\n 0,\n @tag_orig[\"tracknum\"]||0,\n @tag_orig[\"genre\"]||255\n ].pack(\"Z30Z30Z30Z4Z28CCC\")\n @file.write(str)\n end\n @file.close\n @file = nil\n end",
"title": ""
},
{
"docid": "65a670764d779b1fc8be764cf2e65bc3",
"score": "0.6490735",
"text": "def create_file(filename ='dta.txt')\n file = open( filename, 'w')\n file << create\n file.close()\n end",
"title": ""
},
{
"docid": "46389560a376e211743fd88068602d72",
"score": "0.6462637",
"text": "def build_file(filepath, title, link, timestamp)\n File.open(filepath, 'w') do |f|\n f << \"---\\n\"\n f << \"layout: post\\n\"\n f << \"title: \\\"#{title}\\\"\\n\"\n f << \"date: #{timestamp || Time.now.strftime('%Y-%m-%d')}\\n\"\n f << \"tags: ['New-Post', 'Tag']\\n\"\n f << \"---\\n\"\n f << \"\\n\"\n f << \"[see more details](#{link})\\n\\n#{DEFAULT_TEXT}\\n\"\n end\n puts \"Created: #{filepath}\"\nend",
"title": ""
},
{
"docid": "3bea073ae30209981920bb9ac7aec2ed",
"score": "0.6407759",
"text": "def datafile\n @tagdir + '/' + @name + '.tag'\n end",
"title": ""
},
{
"docid": "18e8e0031eb30a7dfea30545a8c44461",
"score": "0.6366936",
"text": "def gen_create_file file_name, file_content\n\tFile.open(file_name, 'w') do |_file| \n\t\t\t\t_file.puts file_content\n\tend\nend",
"title": ""
},
{
"docid": "804e79f02272bd4cb104fd11840feece",
"score": "0.6339",
"text": "def mkfile(name, contents, log, description='', branch_tag='')\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "5eebd86cd1fda46eb46e26051f94c12c",
"score": "0.6320401",
"text": "def create_file(file_created)\n file = File.new(file_created,\"a+\") \n file.close\n end",
"title": ""
},
{
"docid": "9f3ac1df9780ecfe2185cc2f95df6ee0",
"score": "0.62548673",
"text": "def generate_tagpage(tagname)\n begin\n File.open(\"../tag/\" + tagname + \".md\", \"w\") do |file|\n tagpage_formatter = TAGPAGE_TEMPLATE.gsub(/###/, tagname)\n file.puts(tagpage_formatter)\n end\n rescue\n end\n puts \"generated a tag page for \\\"%s\\\"\" % [tagname]\nend",
"title": ""
},
{
"docid": "1da8b407ab89b61d2266d25ce12bcb0c",
"score": "0.62226945",
"text": "def create_file\n @file = File.new(@path+'.tcx', \"w\")\n end",
"title": ""
},
{
"docid": "1d06428ee4dca0e35eccabf0c04a5af7",
"score": "0.61983144",
"text": "def write_tags_vim tags # :nodoc:\n open '../TAGS', 'w' do |io|\n io.write <<-INFO\n!_TAG_FILE_FORMAT\\t2\\t/extended format/\n!_TAG_FILE_SORTED\\t1\\t/sorted/\n!_TAG_PROGRAM_AUTHOR\\tEric Hodel\\t/[email protected]/\n!_TAG_PROGRAM_NAME\\trdoc-tags\\t//\n!_TAG_PROGRAM_URL\\thttps://github.com/rdoc/rdoc-tags\\t//\n!_TAG_PROGRAM_VERSION\\t#{VERSION}\\t//\n INFO\n\n tags.sort.each do |name, definitions|\n definitions = definitions.uniq\n\n definitions = definitions.sort_by do |(file, address,*_)|\n [file, address]\n end\n\n definitions.each do |(file, address, *field)|\n io.write \"#{name}\\t#{file}\\t#{address};\\\"\\t#{field.join \"\\t\"}\\n\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6d7026c573f1db19cb10a36730d78f1b",
"score": "0.6146719",
"text": "def commit\n File.open(@path, 'r+') {\n |f|\n f.seek(-TagSize, IO::SEEK_END)\n tag = f.read(3)\n if tag != 'TAG'\n\t# Append new tag\n\tf.seek(0, IO::SEEK_END)\n\tf.write('TAG')\n end\n f.write([@songname,@artist,@album, (\"%04d\" % @year), @comment, 0, @tracknum, @genre_id].pack(TAGFORMAT_WRITE))\n }\n end",
"title": ""
},
{
"docid": "27cd4ac6bd4ed1ac72c5c28a59ad95d5",
"score": "0.613724",
"text": "def write\n File.open(@path, 'w') do |file|\n [\n @tag,\n type,\n version,\n media_sequence,\n allow_cache?,\n target_duration,\n ].each { |tag| file.puts tag }\n end\n end",
"title": ""
},
{
"docid": "4a3a4248727334717bf6126af453113d",
"score": "0.61264706",
"text": "def create_file(name)\n\t\tfile = self[name].create\n\t\tfile.write('')\n\t\tfile\n\tend",
"title": ""
},
{
"docid": "3ba65c0e8b5d876948cd34d7086634d1",
"score": "0.6119485",
"text": "def process_tags(tagname, fp, count, tags, line)\n tag = Tag.new(tagname)\n tags << tag\n tag = create_children(fp, count, tagname, tag)\n tag = get_tagdata(line, tag)\n tag = get_content(line, tag)\n tag\nend",
"title": ""
},
{
"docid": "ea893d66b43f959b8cfe970cbbc363f0",
"score": "0.6104032",
"text": "def open_file(entry); end",
"title": ""
},
{
"docid": "9929561222d8d93999b34d650737032d",
"score": "0.60541785",
"text": "def tagmanifest_file(algo)\n File.join bag_dir, \"tagmanifest-#{algo}.txt\"\n end",
"title": ""
},
{
"docid": "8583b131378cdf180d3edfe57d823215",
"score": "0.6005052",
"text": "def find_or_create_tag(tag_name,parent)\n #log.debug \"Processing tag #{tag_name}\"\n tag_code_object = YARD::Registry.all(:tag).find {|tag| tag.value == tag_name } ||\n YARD::CodeObjects::Cucumber::Tag.new(YARD::CodeObjects::Cucumber::CUCUMBER_TAG_NAMESPACE,tag_name.gsub('@','')) {|t| t.owners = [] ; t.value = tag_name }\n\n tag_code_object.add_file(@file,parent.line)\n\n parent.tags << tag_code_object unless parent.tags.find {|tag| tag == tag_code_object }\n tag_code_object.owners << parent unless tag_code_object.owners.find {|owner| owner == parent}\n end",
"title": ""
},
{
"docid": "0bdd744f70454cb223d93c3cfd46abe3",
"score": "0.5984967",
"text": "def tag_file(target_path)\n \"#{target_path}/.CURRENT_TAG\"\n end",
"title": ""
},
{
"docid": "eba2045819ec4339fbb427ed4e5b8209",
"score": "0.59751886",
"text": "def open(node)\r\n @ios = File.new(@path, 'wb')\r\n end",
"title": ""
},
{
"docid": "52515c4b57fe79ff15b1d81af1b653cf",
"score": "0.59604675",
"text": "def create\n self.write(@file_content)\n end",
"title": ""
},
{
"docid": "34d18a670d44d11fddb046b5fce7c036",
"score": "0.5956145",
"text": "def create_tagged_filename(infile)\n path = infile.split(/\\//)\n\n # take care of the filename...\n components = path.pop.split(/\\./)\n position = [1, components.size-1].max\n components.insert position, 'tagged'\n path.push components.join('.')\n\n # ...and of the path\n path.insert -2, 'tagged'\n path.join '/'\n end",
"title": ""
},
{
"docid": "9c4e0351bc2780aa28e4c7c32833405f",
"score": "0.5939817",
"text": "def open() end",
"title": ""
},
{
"docid": "2d85fa287321bdda60b2fefb1aa06fb5",
"score": "0.5923761",
"text": "def create_file\n File.open(\"demo.txt\", w) { |f| f.write(\"This is a demo file.\") }\n end",
"title": ""
},
{
"docid": "7d830c1cfe6add0810a20c8dfe8cf200",
"score": "0.5919096",
"text": "def createfile(filename)\n newfile = File.new(filename, self)\n @contents[filename] = newfile\n end",
"title": ""
},
{
"docid": "dd63a5f578ae4803bccf4eedbfeebdc1",
"score": "0.5917566",
"text": "def create_file(file)\n @generic_file = GenericFile.new\n @generic_file.batch_id = object.batch.pid\n @generic_file.add_file(file.read, 'content', file.name)\n @generic_file.apply_depositor_metadata(object.edit_users.first)\n @generic_file.date_uploaded = Time.now.ctime\n @generic_file.date_modified = Time.now.ctime\n @generic_file.save\n end",
"title": ""
},
{
"docid": "1a530729c8bffd428d1a821c9d2e4e27",
"score": "0.58821225",
"text": "def file\n File.find_or_create self\n end",
"title": ""
},
{
"docid": "94f2309b13e2859843690a7e8fb1d8bb",
"score": "0.5863906",
"text": "def open(path); end",
"title": ""
},
{
"docid": "94f2309b13e2859843690a7e8fb1d8bb",
"score": "0.5863906",
"text": "def open(path); end",
"title": ""
},
{
"docid": "b127194ec65c8ac1272e2f9075dd1eaf",
"score": "0.5862603",
"text": "def file_create(*args, &block); end",
"title": ""
},
{
"docid": "df0b9dbd19f70064605507422bedfde5",
"score": "0.5860598",
"text": "def create_temp_file() end",
"title": ""
},
{
"docid": "df0b9dbd19f70064605507422bedfde5",
"score": "0.5860598",
"text": "def create_temp_file() end",
"title": ""
},
{
"docid": "3cb24176fc15963de7143a2cccffee9f",
"score": "0.5823296",
"text": "def initialize(file)\n self.fd = File.new(file, \"a\")\n end",
"title": ""
},
{
"docid": "22c63f722c25f94a6e1cb1132d90cea1",
"score": "0.5819379",
"text": "def atomic_create_and_write_file(filename, perms = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "16d6527736e0e83406254fb7967fc1bc",
"score": "0.58038574",
"text": "def create_txt_file(filepath, data)\n File.open(filepath, 'w+') do |file|\n file << data\n end\nend",
"title": ""
},
{
"docid": "99d44b55520f06e5c140690cd5aa3a19",
"score": "0.57964545",
"text": "def create(filename, options = {}, &block)\n rescueflag = false\n File.open(filename, \"wb\") do |fh|\n @fh = fh\n begin\n @header = HeaderWriter.new\n @tagtable = TagTableWriter.new\n @tags = TagDataWriter.new @tagtable\n\n yield self\n @fh.write @data\n rescue\n rescueflag = true\n end\n end\n FileUtils.rm_f(filename) if rescueflag\n end",
"title": ""
},
{
"docid": "fd2369f950d902ff5ab5e98aa49be142",
"score": "0.578419",
"text": "def create_file(name, data = nil)\n end",
"title": ""
},
{
"docid": "0d699a5403b54dcc2b682675ba65cce8",
"score": "0.57801676",
"text": "def CreateFile(cn, mn)\r\n\tfilename = sprintf(\"%s_%s.html\", cn, mn)\r\n\r\n\t$file = OpenFile(filename)\r\nend",
"title": ""
},
{
"docid": "42fec742a82d4985c37a1b023876e52b",
"score": "0.5778725",
"text": "def create_revision_info(git_path, info_file_path, tag)\n\tDir.chdir(git_path) do |path|\n\t\tcommit = `git show-ref --tags --hash=7 #{tag}`.strip\n\t\tputs \"Writing '#{tag} ~ #{commit}' to #{info_file_path}\" \n\t\tFile.open(info_file_path, \"w\") do |f|\n\t\t\tf.puts tag\n\t\t\tf.puts commit\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "b9cfdf20ac66cb76b82d363777b715a1",
"score": "0.5769037",
"text": "def open(fileName)\n\tend",
"title": ""
},
{
"docid": "49dbcf1609a0d4737dbcb0eeaa438684",
"score": "0.5767231",
"text": "def open\n _close\n mode = @mode & ~(File::CREAT|File::EXCL)\n @tmpfile = File.open(@tmpfile.path, mode, **@opts)\n __setobj__(@tmpfile)\n end",
"title": ""
},
{
"docid": "76c6c3d3d24c8830471ac6d139f34c0c",
"score": "0.5766777",
"text": "def create_file(name)\n File.new(name, \"w+\")\n end",
"title": ""
},
{
"docid": "d7110a0033db08a747df432f860d975e",
"score": "0.5766325",
"text": "def create_token_file\n File.open(TOKEN_PATH, 'w') { |file| file.write(ENV['GOOGLE_TOKEN']) }\nend",
"title": ""
},
{
"docid": "831851fb3883b47c5a22fc8a7a4be83d",
"score": "0.5765089",
"text": "def create_file(file, file_contents)\n vputs \"Creating file: #{file}\"\n begin\n File.open(file, 'w+') do |f| # open file for update\n f.print file_contents # write file_contents to the file\n end # file is automatically closed\n rescue Exception\n end\nend",
"title": ""
},
{
"docid": "8c3edeeee3e5be1a0c7bcec0b0a8ce01",
"score": "0.5754321",
"text": "def make_file(filename,contents,file_options={})\r\n raise \"creating files for #{file_system} file system not yet supported\"\r\n end",
"title": ""
},
{
"docid": "eb3b9b3972ca368a03641ddc9ce9d9f9",
"score": "0.57434404",
"text": "def create_file(path, content = 'Dummy content')\n File.open(path, 'w') do |file|\n file.write(content)\n end\nend",
"title": ""
},
{
"docid": "575777209b09deff5d49f3000f9511ea",
"score": "0.572929",
"text": "def create_file(filename)\n File.open(filename, \"w\") do |f| \n f.write('This is a new file.') \n end\nend",
"title": ""
},
{
"docid": "5f236a2db95fe649ef8107b6673687f4",
"score": "0.5716212",
"text": "def create_log_file(log_file)\n log_file.ensure_exists\n contents = <<~CONTENTS\n #{DiaryEntry::ENTRY_HEADER_MARKER} Biographical information\n\n #{@biography}\n\n #{DiaryEntry::ENTRY_HEADER_MARKER} Employment information\n\n Start date:: #{@start_date}\n Grade level:: #{@grade_level}\n\n CONTENTS\n new_file_entry = ObservationEntry.new(content: 'File generated by new-hire command').render('File created')\n contents += new_file_entry\n write_file(log_file.path, contents)\n print 'created'\n end",
"title": ""
},
{
"docid": "1ef562e811900876ab66964c9cfce305",
"score": "0.5689642",
"text": "def create_file(thread_id, filename)\r\n cmd_obj_ids = create_string(filename)\r\n fail_with(Failure::Unknown, \"Failed to allocate string for filename\") if cmd_obj_ids.length == 0\r\n\r\n cmd_obj_id = cmd_obj_ids[0][\"obj_id\"]\r\n size = @vars[\"objectid_size\"]\r\n data = [TAG_OBJECT].pack('C')\r\n data << format(size, cmd_obj_id)\r\n data_array = [data]\r\n runtime_class , runtime_meth = get_class_and_method(\"Ljava/io/FileOutputStream;\", \"<init>\", \"(Ljava/lang/String;)V\")\r\n buf = create_instance(runtime_class[\"reftype_id\"], thread_id, runtime_meth[\"method_id\"], data_array)\r\n fail_with(Failure::UnexpectedReply, \"Unexpected returned type: expected Object\") unless buf[0] == [TAG_OBJECT].pack('C')\r\n\r\n file = unformat(size, buf[1..1+size-1])\r\n fail_with(Failure::Unknown, \"Failed to create file. Try to change the TMP_PATH\") if file.nil? || (file == 0)\r\n\r\n register_files_for_cleanup(filename)\r\n\r\n file\r\n end",
"title": ""
},
{
"docid": "0386a1fcf6a273f007f316dd28fcfadd",
"score": "0.5685814",
"text": "def tag(taglib_filetype = 'TagLib::FLAC::File')\n {}.tap do |tag|\n Kernel.const_get(taglib_filetype).open(@filepath) do |flac_file|\n audio_tag = flac_file.tag\n\n tag[:artist] = audio_tag.artist\n tag[:album] = audio_tag.album\n tag[:title] = audio_tag.title\n tag[:year] = audio_tag.year\n tag[:track] = audio_tag.track\n tag[:genre] = audio_tag.genre\n tag[:comment] = audio_tag.comment\n end\n end\n end",
"title": ""
},
{
"docid": "1bc673db48122495a581371c75bb2869",
"score": "0.5685448",
"text": "def create_file(uid, info = {})\n file_path(uid).binwrite(\"\")\n file_path(uid).chmod(@permissions)\n\n info_path(uid).binwrite(\"{}\") unless info_path(uid).exist?\n info_path(uid).chmod(@permissions)\n end",
"title": ""
},
{
"docid": "c1f70444a903e15a4c688e0a1efa7b2c",
"score": "0.56741446",
"text": "def open_1(handler,file_name,t,id_name)\n \n handler = File.open(file_name, \"a+\")\n \n handler.write(\"====Starting #{t} | #{id_name}====\\n\")\n \n handler\n \n end",
"title": ""
},
{
"docid": "09eb1350888c7ca5964388af2e53dd85",
"score": "0.5664464",
"text": "def __create(file, name, project)\n end",
"title": ""
},
{
"docid": "d719101f2dc844709b72c396fbfd4f92",
"score": "0.56608266",
"text": "def creole_tag(tag, type, text=\"\")\n type = type.to_sym\n return unless [:open, :close].include?(type)\n return unless @chunks_hash.has_key?(tag)\n @chunks_hash[tag][type] = text\n end",
"title": ""
},
{
"docid": "12afaceb5c414a12d6e89c99bdf1aa69",
"score": "0.5658324",
"text": "def tags_path\n File.join @tags_dir, @tags_file\n end",
"title": ""
},
{
"docid": "d6826b1658feb3417a53b18de8a4273e",
"score": "0.56485957",
"text": "def new_file(filename = nil)\n name = filename || \"#{basename}.#{num_io}.log\"\n io = File.new(name, 'w+')\n Format::Current.write_prologue(io)\n streams.each_with_index do |s, i|\n Logfiles.write_stream_declaration(\n io, i, s.name, s.type.name, s.type.to_xml, s.metadata\n )\n end\n if num_io == 0\n @io = io\n elsif num_io == 1\n @io = IOSequence.new(@io, io)\n else\n @io.add_io(io)\n end\n @block_stream = BlockStream.new(@io)\n end",
"title": ""
},
{
"docid": "2f9221e3f5c9fbd033111689429ebbd4",
"score": "0.5631192",
"text": "def create_post(filename, title)\n if File.exist?(filename)\n abort(\"post with title still exists\")\n end\n\n puts \"* Creating a new post: #{filename}\"\n open(filename, 'w') do |post|\n post.puts \"---\"\n post.puts \"layout: post\"\n post.puts \"title: #{title}\"\n post.puts \"date: #{Time.now.strftime('%Y-%m-%d')}\"\n post.puts \"category: \"\n post.puts \"tags: [,]\"\n post.puts \"---\"\n end\nend",
"title": ""
},
{
"docid": "c9dd055506e7b181fdd68a31df48dd89",
"score": "0.5623714",
"text": "def open_file\n\t\tself.file = File.new(path_to_file, 'r')\n\tend",
"title": ""
},
{
"docid": "51a8c3bdc724cd58ffafed79ec6309c5",
"score": "0.5620597",
"text": "def write_tags_emacs tags # :nodoc:\n open '../TAGS', 'wb' do |io|\n tags.sort.each do |file, definitions|\n section = []\n\n definitions.sort.each do |(definition, tag_name, line, offset)|\n section << \"#{definition}\\x7F#{tag_name}\\x01#{line},#{offset}\"\n end\n\n section = section.join \"\\n\"\n\n io << \"\\x0C\\n#{file},#{section.length}\\n#{section}\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "03ef2b7f670b133f978e0ea3923a074a",
"score": "0.5609043",
"text": "def create_dictionary_file(dictionary)\n dictionary_file = File.open(\"./lib/dictionary.txt\", \"w\")\n dictionary_file.puts dictionary\n dictionary_file.close\n end",
"title": ""
},
{
"docid": "c5b68e5c4a7e26f8f3eaf82c5b5ce7fe",
"score": "0.55991906",
"text": "def create_file(filepath, contents = '')\n filepath = \"#{@dir}/#{@module}/#{filepath}\"\n puts \"... Creating file '#{filepath}'\"\n File.open(filepath, 'w') do |f|\n f.write contents\n end\n end",
"title": ""
},
{
"docid": "4c74e7639d68972951d04589bcf2bb11",
"score": "0.5599076",
"text": "def create_file(name, data = nil)\n data = data.read unless data.is_a?(String)\n\n @children << File.new(name, data, self)\n \"\\\"#{Digest::MD5.hexdigest(data)}\\\"\"\n end",
"title": ""
},
{
"docid": "a4f41e4ba31fe069ae7a7b8958066fac",
"score": "0.559044",
"text": "def mk_file\nFileUtils.touch(\"c:/scripts/logs/#{@@file}.txt\") unless File.exists?(\"c:/scripts/logs/#{@@file}.txt\")\nend",
"title": ""
},
{
"docid": "84f7f25c389e7c2c55e71f30a72226c5",
"score": "0.5589583",
"text": "def create_file(filename ='DTAUS0.TXT')\n file = open( filename, 'w')\n file << create\n file.close()\n print \"#{filename} created containing #{@bookings.size} bookings\\n\"\n end",
"title": ""
},
{
"docid": "cb89d3e1c069cb03a1771b8a7ef29143",
"score": "0.55787224",
"text": "def build_file(target_name, file_name=target_name, mode=0600)\n register target_name, file_path(file_name), mode\n self\n end",
"title": ""
},
{
"docid": "525a14dcb30160da1ef144020306c55a",
"score": "0.55755204",
"text": "def open_file(name, mode = 'r', &block)\n\t\t# Check that data exists\n\t\tDir.mkdir('data') unless File.directory?('data')\n\t\t\n path = \"data/#{self.class.name.downcase}\"\n Dir.mkdir(path) unless File.directory?(path)\n File.open(\"#{path}/#{name}\", mode, &block)\n end",
"title": ""
},
{
"docid": "bfab59466107d5320d751f4e5b732d71",
"score": "0.55735886",
"text": "def create_file(file_path, content)\n run %(echo \"#{content}\" > \"#{file_path}\")\n end",
"title": ""
},
{
"docid": "33d32f75869a435d161356ba004ee0ce",
"score": "0.5564456",
"text": "def createFileWithHeader \n # TODO - See about using !File.exist?(\"music_db.txt\")\n if File.exist?(\"music_db.txt\")\n else\n open('music_db.txt', 'w') { |z|\n }\n end \n end",
"title": ""
},
{
"docid": "4574f97b9ab41dd8ac69a7e0ff79fdf6",
"score": "0.5563023",
"text": "def create\n File.write(resource[:target_file], decrypt(resource[:name]))\n end",
"title": ""
},
{
"docid": "075b342045dee4eb1b8c38703324366a",
"score": "0.5562387",
"text": "def metadatafile\n @tagdir + '/' + @name + '.json'\n end",
"title": ""
},
{
"docid": "17ecfecb85d73a69fbbd2dc2d3b68056",
"score": "0.5555517",
"text": "def create\n self.class.send_log(:debug, \"call create()\")\n File.open(@resource[:name], \"w\") { |f| f.puts \"\" } # Create an empty file\n # Make sure the mode is correct\n should_mode = @resource.should(:mode)\n unless self.mode == should_mode\n self.mode = should_mode\n end\n end",
"title": ""
},
{
"docid": "ff0df320ba78ad671e0612590abf4cbb",
"score": "0.55550426",
"text": "def create_file(name, data = nil)\n new_path = @path + '/' + name\n ::File.open(new_path, 'w') do |file|\n if data.is_a?(String)\n file.write(data)\n else\n IO.copy_stream(data, file)\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "0fcc47b138063551971b47df880112b8",
"score": "0.5552194",
"text": "def close\n if tag != @original_tag\n path = File.join(Dir.tmpdir, \"ruby-ogginfo_#{$$}.ogg\") \n tempfile = File.new(path, \"wb\")\n\n File.open(@filename, \"rb\") do | input |\n replace_tags(input, tempfile, tag)\n end\n tempfile.close\n FileUtils.mv(path, @filename)\n end\n end",
"title": ""
},
{
"docid": "0880bea92081bb02e37b18505b80d2a3",
"score": "0.55507684",
"text": "def create_activity_file\n template \"activity.rb\", \"#{Activr.config.app_path}/activities/#{file_name}_activity.rb\"\n end",
"title": ""
},
{
"docid": "c0144fe8302a5fa095ae2b45e04211c8",
"score": "0.5546512",
"text": "def create_file(content)\n if is_url?(content)\n # return file name from url func\n create_url_file(extract_url(content))\n else\n # return file name from text func\n create_text_file content\n end\n end",
"title": ""
},
{
"docid": "863d4721f0d9de89bca1547ca557c031",
"score": "0.554555",
"text": "def writeInfotoFile(filename,info)\n file1 = File.open(filename,'a+')\n if not File.world_writable?(filename)\n file1.chmod(0777)\n end\n file1.write \"#{info}\\n\"\n file1.close\n end",
"title": ""
},
{
"docid": "e333f3aed30cd7fa28e3c6b59d919bdf",
"score": "0.5539619",
"text": "def create_content_file(id, content)\n File.open(\"#{@sub_revisions_dir}/#{id}.txt\", 'w') do |f|\n f.puts content\n end\nend",
"title": ""
},
{
"docid": "bffac0f2a1dbe2d098fc0212adf683ea",
"score": "0.5536518",
"text": "def open_new_file\n View[:file].buffer = FileBuffer.new(:file, 'unnamed')\n end",
"title": ""
},
{
"docid": "afc8e6965982ed7837a09c5fbcd4e3cc",
"score": "0.5524084",
"text": "def create_doc(path , doc_id , o = {})\n `mkdir -p #{path}` if !File.exist?(path)\n template = ERB.new(IO.read(to_path(\"doc_pd.rxml\")))\n File.open(\"#{path}/#{doc_id}.xml\", \"w\"){|f| f.puts template.result(binding)}\n puts \"[create_doc] #{doc_id} file created\"\nend",
"title": ""
},
{
"docid": "80039fe12d6afd7cd283ea064a71b362",
"score": "0.552058",
"text": "def make_file filepath, content, options={}\n File.open(filepath, \"w+\"){|f| f.write(content)}\n end",
"title": ""
},
{
"docid": "6527a355ea7b55f70d5f43b5e298028f",
"score": "0.55195326",
"text": "def create\n File.open(path, \"a+\") { |f| f << generate }\n end",
"title": ""
},
{
"docid": "6527a355ea7b55f70d5f43b5e298028f",
"score": "0.55195326",
"text": "def create\n File.open(path, \"a+\") { |f| f << generate }\n end",
"title": ""
},
{
"docid": "3ba79a526adeab0ed6ce9061409f8624",
"score": "0.55172306",
"text": "def create_document(name, content = '')\n File.open(File.join(data_path, name), 'w') do |file|\n file.write(content)\n end\nend",
"title": ""
},
{
"docid": "719de2a15cce405d669d92489f917c31",
"score": "0.55068314",
"text": "def create_file\n File.open(\"./#{@output_file}\", \"w\") { |f| f.puts(@contents) }\n FileUtils.chmod 0755, \"./#{@output_file}\"\n end",
"title": ""
},
{
"docid": "4f46ba9a8ebe3a34c8c34a2016989e11",
"score": "0.550612",
"text": "def generate(file, content)\n f = Chef::Resource::File.new(file, run_context)\n f.sensitive true\n f.owner new_resource.owner\n f.group new_resource.group\n f.mode 00600\n f.content content\n f.run_action :create\n end",
"title": ""
},
{
"docid": "d2474213f994f7930c43d65dd8b19901",
"score": "0.55061007",
"text": "def create_file(source, file)\n cookbook_file file do\n source source\n action :create\n owner 'root'\n group 'root'\n mode '0775'\n end\nend",
"title": ""
},
{
"docid": "094c0a2e97a363fc27e222e1f9294a8d",
"score": "0.5505591",
"text": "def create_file(file, contents, exists=:noisy)\n path = \"#{@location}/#{file}\"\n unless File.exists? path\n log_action \"create\", path\n File.open(path, 'w+') { |f| f.puts contents }\n else\n log_action \"exists\", path if exists == :noisy\n end\n end",
"title": ""
},
{
"docid": "84fefd3f60192677538e39a598887ed2",
"score": "0.5494304",
"text": "def open0(mode)\r\n unless mode == READ then touch(); end\r\n StringIO.new(@content, mode)\r\n end",
"title": ""
},
{
"docid": "d48523a6d41c9a3dc7657a811d5cc9b8",
"score": "0.54868966",
"text": "def create(filename,serialized_tree)\n\n end",
"title": ""
},
{
"docid": "41b68efa7b5c9db237ec94713a2399fc",
"score": "0.5482731",
"text": "def create_txt_file(filename, tweet)\n\t\t@txt_file = File.new(filename,\"w\")\n\t\tclean_tweet(tweet['tweet'], tweet['quoted_text'])\n\tend",
"title": ""
},
{
"docid": "2d8ffa337fb149fbcd26299990ca8617",
"score": "0.54713494",
"text": "def generate_tag(file)\n html_attributes = attributes(file).to_html_attributes\n \"<div #{html_attributes}>#{@text}</div>\"\n end",
"title": ""
},
{
"docid": "47660e50be8c802b154e535205806a5e",
"score": "0.54629594",
"text": "def create_file params\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "251bfe21d85eb34c76897968b86471a1",
"score": "0.54599315",
"text": "def open0(mode)\r\n File.open(path, mode + \"b\")\r\n end",
"title": ""
},
{
"docid": "8f0f64fb74325323f77e47203b7a4571",
"score": "0.5449661",
"text": "def create_and_write_to_file(filename, content)\n File.open(\"public/gallery.html\", \"w\") do |file|\n file.write(top_html)\n file.write(image_tag_list(ARGV))\n file.write(bottom_html)\n end\nend",
"title": ""
},
{
"docid": "b93f72e3bc2b2b4524649baf54e83a1b",
"score": "0.5447637",
"text": "def createFile(port)\r\n\[email protected](\"Verificando se o arquivo data#{port}.txt existe\")\r\n\tif !File.exists?(\"data#{port}.txt\")\r\n\t\[email protected](\"Arquivo data#{port}.txt nao existe, criando arquivo data.txt\")\r\n\t\t# Caso nao exista cria um novo arquivo\r\n\t\tfile = File.new(\"data#{port}.txt\", File::CREAT|File::TRUNC|File::RDWR, 0644)\r\n\t\[email protected](\"Arquivo data#{port}.txt criado com sucesso\")\r\n\tend\r\nend",
"title": ""
},
{
"docid": "585edd321954ba4d8f749442cb5a3c1c",
"score": "0.5447629",
"text": "def really_open_file(filename)\n $log.info{\"Going to open archive file '#{filename}'.\"}\n f = File.new(filename,(File::WRONLY | File::APPEND | File::CREAT))\n FileUtils.chown(\"prisma\",\"www-data\",filename) if PRISMA_ENV == \"production\"\n \n @open_files[filename] = f\n @used_files[filename] = true\n f\n end",
"title": ""
},
{
"docid": "e6e278d4c3292cd36256055be1789eb0",
"score": "0.544617",
"text": "def file_for(content)\n \"snp_#{template_name}\".tap do |file_name|\n File.open(file_name, \"w+\") { |f| f.write(content) }\n end\n end",
"title": ""
},
{
"docid": "a87b8ae6e69a642c135bcc8ce3c5e334",
"score": "0.54436904",
"text": "def open_file\n # do nothing\n end",
"title": ""
}
] |
672583f4ed8feb58d58f73ade5034d3a
|
GET /admin/instruments GET /admin/instruments.json
|
[
{
"docid": "1e5651d0559337b3e518ca20f7bf536b",
"score": "0.5921887",
"text": "def index\n @q = Instrument.search(params[:q])\n @instruments = @q.result(distinct: true) \n end",
"title": ""
}
] |
[
{
"docid": "71b060693f854b8125f1f99edfa9759d",
"score": "0.7456831",
"text": "def index\n \t@instruments = Instrument.all\n\n \trespond_to do |format|\n \t format.html # index.html.erb\n \t format.json { render :json => @instruments }\n \tend\n end",
"title": ""
},
{
"docid": "0ab331d23580c1e3d144d6786869e3f3",
"score": "0.741459",
"text": "def index\n @instruments = Instrument.all\n end",
"title": ""
},
{
"docid": "0ab331d23580c1e3d144d6786869e3f3",
"score": "0.7411693",
"text": "def index\n @instruments = Instrument.all\n end",
"title": ""
},
{
"docid": "0ab331d23580c1e3d144d6786869e3f3",
"score": "0.7411693",
"text": "def index\n @instruments = Instrument.all\n end",
"title": ""
},
{
"docid": "13a1e58d4a218e6b614e26ed141045ac",
"score": "0.7355353",
"text": "def instruments(options = { currency: 'BTC' })\n raise ArgumentError, 'currency is required' unless options[:currency]\n\n http.get '/public/get_instruments', options\n end",
"title": ""
},
{
"docid": "68e1f1c0f75a53bc06a0d165c2084a14",
"score": "0.6888902",
"text": "def instruments(exchange = \"NSE\")\n get(\"market.instruments\", {exchange: exchange})\n end",
"title": ""
},
{
"docid": "75528e8c3dac56168307c3da6f591a3c",
"score": "0.6654452",
"text": "def show\n\t\trender json: @instrument\n\tend",
"title": ""
},
{
"docid": "ea1fe4e84af869460e9bb8bdf88dabd3",
"score": "0.6541871",
"text": "def instrument\n fetch('music.instruments')\n end",
"title": ""
},
{
"docid": "fb4214f9188d1d7369359196431a36d5",
"score": "0.65331316",
"text": "def index\n @instrument_registrations = InstrumentRegistration.all\n end",
"title": ""
},
{
"docid": "53103c1b27c22b2b9239c6cd60d821e4",
"score": "0.6513003",
"text": "def show\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "fb9f8f395eda88959b8f8577254dc63a",
"score": "0.6461677",
"text": "def show\n @instrumento = Instrumento.find(params[:id])\n\n render json: @instrumento\n end",
"title": ""
},
{
"docid": "a2c32ca0f2b940435833c970a554f003",
"score": "0.64344794",
"text": "def index\n @instrument_types = InstrumentType.all\n end",
"title": ""
},
{
"docid": "c2de0c24ec10bec05134d026cc0e638b",
"score": "0.6387473",
"text": "def index\n @instruments = Instrument.all\n\tif params[:search]\n\t\t@instruments = Instrument.where(:showable => true).search(params[:search])\n\t\t@instruments_all = Instrument.search(params[:search])\n\telse\n\t\t@instruments = Instrument.where(:showable => true).all.order('created_at DESC')\n\t\t@instruments_all = Instrument.all.order('created_at DESC')\n\tend\n end",
"title": ""
},
{
"docid": "a79e50a353c37ac7aa13713b1c228c44",
"score": "0.63598084",
"text": "def index\n @instrumentos = Instrumento.all\n end",
"title": ""
},
{
"docid": "d8bee3edadb3040fe889446d32c8cbb9",
"score": "0.63290447",
"text": "def index \n\n result = @gateway.list_payment_instruments(@customer_id)\n @payment_instruments = JSON.parse(result.success?)\n end",
"title": ""
},
{
"docid": "07f1d442fd8bcdf367bab774a5b09dc7",
"score": "0.6270659",
"text": "def index\n @musical_instruments = MusicalInstrument.all.paginate(page: params[:page], per_page: 15)\n end",
"title": ""
},
{
"docid": "81ba35883440a680af112fa0b975205b",
"score": "0.6258166",
"text": "def show\n @instrumento = Instrumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instrumento }\n end\n end",
"title": ""
},
{
"docid": "7fa0778e5f36375b771621bc68ecf33e",
"score": "0.6249117",
"text": "def index\n @profile_has_instruments = ProfileHasInstrument.all\n @instruments = Instrument.all\n end",
"title": ""
},
{
"docid": "b6c529c49e1ae4e39f48065a476dd99d",
"score": "0.61064404",
"text": "def set_admin_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "0c7a6986f7219b113333cfedb81b3715",
"score": "0.60994923",
"text": "def get_instruments\n @eurusd = Instrument.new(\"EURUSD\", \"D1\", :shift => 10)\n use_instrument(@eurusd)\n end",
"title": ""
},
{
"docid": "ca0940426895cef1f5653d02e548e73c",
"score": "0.6036494",
"text": "def index\n @alunosinstrumentos = Alunosinstrumento.all\n end",
"title": ""
},
{
"docid": "a91057feeefd65bf226f28ef4bd063fa",
"score": "0.60080516",
"text": "def index\n @instrument_categories = InstrumentCategory.all\n end",
"title": ""
},
{
"docid": "04cf226dc1236dabb36dae38c8cb001e",
"score": "0.5997414",
"text": "def show\n @instrumentalist= Instrumentalist.find(@resume.instrumentalist_id)\n end",
"title": ""
},
{
"docid": "0e0321c46133e9c8a106ef2ee47f0427",
"score": "0.59667516",
"text": "def index\n authorize! :view, Instrument\n\n @instruments = Instrument.all\n @sites = Site.all\n\n\n end",
"title": ""
},
{
"docid": "a760f8e7c80e55f33e60091e34c0f749",
"score": "0.59616876",
"text": "def index\n @instruments = Instrument.all\n \tif params[:search]\n \t\t@instruments = Instrument.where(:showable => true).search(params[:search])\n \t\t@instruments_all = Instrument.search(params[:search])\n \telse\n \t\t@instruments = Instrument.where(:showable => true).all.order('created_at DESC')\n \t\t@instruments_all = Instrument.all.order('created_at DESC')\n \tend\n @sum = Instrument.count\n end",
"title": ""
},
{
"docid": "7b8d7fee479d7ddcd4fb653103cf6542",
"score": "0.5959569",
"text": "def index\n @indications = @drug.indications\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @indications }\n end\n end",
"title": ""
},
{
"docid": "cbaf0d1ef37d10264e462bd387f9e968",
"score": "0.5943098",
"text": "def instrument_get_indices(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: InstrumentApi#instrument_get_indices ...\"\n end\n \n # resource path\n path = \"/instrument/indices\".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', 'application/xml', 'text/xml', 'application/javascript', '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 = ['application/json', '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 = []\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 => 'Array<Instrument>')\n if Configuration.debugging\n Configuration.logger.debug \"API called: InstrumentApi#instrument_get_indices. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "ed82b14cfb28db0ac3d00ef1c6a1ed45",
"score": "0.59242916",
"text": "def get_option_instruments(type, expiration_date, chain_id)\n # Get all option instruments with the desired type and expiration\n params = {}\n params[\"chain_id\"] = chain_id\n params[\"expiration_dates\"] = expiration_date\n params[\"state\"] = \"active\"\n params[\"tradability\"] = \"tradable\"\n params[\"type\"] = type\n option_instruments = get(ROBINHOOD_OPTION_INSTRUMENT_ROUTE, params: params, return_as_json: true)\n option_instruments[\"results\"]\n end",
"title": ""
},
{
"docid": "5da70207794132fe291e9c1ca0bd8d28",
"score": "0.59207207",
"text": "def list_inventors\n json_out(Inventor.all)\n end",
"title": ""
},
{
"docid": "52a206903ad32f5cd65526bbceb8430a",
"score": "0.5908151",
"text": "def show\n\n @sum = Instrument.count\n @id = @instrument.id2\n @relation_service = RelationService.where(item: @id).pluck(:servicio)\n @applications = Application.where(id: @relation_service)\n\n @ids = @instrument.id2\n @records = Record.where(idEquipo: @ids)\n\n end",
"title": ""
},
{
"docid": "e5c8b19ab449c0b4d953381599eca868",
"score": "0.59011483",
"text": "def index\n @incidents = current_admin.systems.find(params[:system_id]).incidents.all\n end",
"title": ""
},
{
"docid": "cb658c47184c44ef9432a8473621f8cc",
"score": "0.5883125",
"text": "def index\n @instrutors = Instrutor.all\n end",
"title": ""
},
{
"docid": "cc3da6bd95bd5f87905ccee73ef4e37b",
"score": "0.588074",
"text": "def index\n @instrument_in_shops = InstrumentInShop.all\n end",
"title": ""
},
{
"docid": "c15cbe1268c96d28d2e483abc07b04b7",
"score": "0.5849798",
"text": "def index\n @inventories = @warehouse.inventories\n\n render json: @inventories\n end",
"title": ""
},
{
"docid": "b2326e90b1010164107a69933f9775cd",
"score": "0.58404446",
"text": "def index\n @audi_infos = AudiInfo.all\n end",
"title": ""
},
{
"docid": "fa098a15d7285811f13a39f763733649",
"score": "0.58394766",
"text": "def index\n @inscriptions = Inscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inscriptions }\n end\n end",
"title": ""
},
{
"docid": "4286c2a6b3d058837d5cd1843c99c285",
"score": "0.58355886",
"text": "def show\n begin\n set_instrutor\n rescue ActiveRecord::RecordNotFound\n render json: { error: \"instrutor does not exist\" }, status: :not_found\n else\n render json: @instrutor, include: :aulas\n end\n end",
"title": ""
},
{
"docid": "43c3003ad83b0a67c9dc225938af1f04",
"score": "0.5803231",
"text": "def index\n @inventories = @user.inventories\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end",
"title": ""
},
{
"docid": "32ced9342bb65cd5366ffb58be590be6",
"score": "0.57976663",
"text": "def index\n @aliquots = Aliquot.all\n end",
"title": ""
},
{
"docid": "ba0683cf7ccc2d0ab71e498df3b2b7bf",
"score": "0.5784043",
"text": "def installed_instruments; end",
"title": ""
},
{
"docid": "f236c7c04f41222c6cef9b276d729c04",
"score": "0.5759486",
"text": "def index\n @silk_samples = SilkSample.all\n end",
"title": ""
},
{
"docid": "80116c34a45ce3a25726eb83aa5de2d8",
"score": "0.57590616",
"text": "def index\n @insured_types = InsuredType.all\n @title = \"Types of Insured Patients\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insured_types }\n end\n end",
"title": ""
},
{
"docid": "a99a3fa8af0e51737c6acc0627c3399f",
"score": "0.57231617",
"text": "def show\n @assessment_iit = AssessmentIit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@assessment_iit }\n end\n end",
"title": ""
},
{
"docid": "f0900ce826e3e1af71379ff298a3edec",
"score": "0.5721658",
"text": "def index\n @indonations = Indonation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @indonations }\n end\n end",
"title": ""
},
{
"docid": "93e028ddfe205fa9432485b378295063",
"score": "0.5720537",
"text": "def get_all_institutions(**options)\n client.get(institutions_path(options))\n \tend",
"title": ""
},
{
"docid": "e11191e4e38b2baf624703ec2fb32e34",
"score": "0.57202137",
"text": "def index\n @i_software_insts = ISoftwareInst.all\n end",
"title": ""
},
{
"docid": "b81810c3ca86262f0f3f8614bbd351d8",
"score": "0.5716668",
"text": "def show\n render json: Encounter.find(params[:id])\n end",
"title": ""
},
{
"docid": "c817238a9fb8e7222c66bb2ac91351dc",
"score": "0.57073116",
"text": "def index\n @ingredients = Ingredient.all\n #@ingredients = @measurement_unit.ingredients\n end",
"title": ""
},
{
"docid": "2535da5ac6c33696f07baef6331bf65f",
"score": "0.5701637",
"text": "def index\n @illustrations = Illustration.all\n end",
"title": ""
},
{
"docid": "2535da5ac6c33696f07baef6331bf65f",
"score": "0.5701637",
"text": "def index\n @illustrations = Illustration.all\n end",
"title": ""
},
{
"docid": "e23d8236704bfba15c1cb92045c34682",
"score": "0.57005167",
"text": "def show\n @insight = Insight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @insight }\n end\n end",
"title": ""
},
{
"docid": "30b3ef7597ced3715c104fd185088830",
"score": "0.56961447",
"text": "def list_payment_instruments(customer_id)\n # response = ssl_get(\"https://qa.api.globallypaid.com/api/v1/paymentinstrument/list/#{customer_id}\", headers)\n response = ssl_get(get_url(\"list_payment_instruments\") + \"/\" + customer_id, headers)\n\n Response.new(\n response,\n authorization: authorization_from(response),\n ) \n end",
"title": ""
},
{
"docid": "e9322f273063b3f299349a51e77a7430",
"score": "0.56952834",
"text": "def index\n @induction_details = InductionDetail.all\n end",
"title": ""
},
{
"docid": "657825b7c83dd4cbe2790e55fff15849",
"score": "0.5690382",
"text": "def index\n @inspirations = Inspiration.all\n end",
"title": ""
},
{
"docid": "6103670e65e2ba8067ea91f2397382f7",
"score": "0.56836146",
"text": "def show\n\t\trender :json => Encouragement.find_by(id: params[:id]) || Encouragement.all.sample\n\tend",
"title": ""
},
{
"docid": "6666454afad97cafe8a1f65da3c4ab3f",
"score": "0.5683289",
"text": "def index\n @dis_generic_indications = DisGenericIndication.all\n end",
"title": ""
},
{
"docid": "3fe14dbe62a6dc9da1e7cfdecb01e8a7",
"score": "0.5680138",
"text": "def index\n\t\t@user = User.find(session[:user_id])\n\t\t@inventories = @user.inventories\n\t\tif @inventories\n\t\t\trender json: @inventories\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f6c5eb92bc8d6bf6724b616dbb35ae6c",
"score": "0.5675876",
"text": "def instrumentations\n @instrumentations ||= UltraMarathon::Instrumentation::Store.new([], prefix: instrumentation_prefix)\n end",
"title": ""
},
{
"docid": "003cb2a7f931c59a92feca10b0669d2b",
"score": "0.56701446",
"text": "def index\n @ivs = Iv.all\n render json: @ivs\n end",
"title": ""
},
{
"docid": "1d2f03db4f4485fe927385a176c70b72",
"score": "0.567004",
"text": "def index\n @industryes = Industrye.all\n end",
"title": ""
},
{
"docid": "cbebbd80abc1c36567150a4253ba7bce",
"score": "0.5669908",
"text": "def hash\n 'instrument_ids'\n end",
"title": ""
},
{
"docid": "24eeea765153147dca7642f463c1e90d",
"score": "0.56680095",
"text": "def index\n @sell_instrument_for_customers = SellInstrumentForCustomer.all\n end",
"title": ""
},
{
"docid": "609fc6a0d844e548e0671c83d04bdf40",
"score": "0.5660348",
"text": "def create\n @instrument = Instrument.new(admin_instrument_params)\n\n respond_to do |format|\n if @admin_instrument.save\n format.html { redirect_to @admin_instrument, notice: 'Instrument was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_instrument }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "402ac5a199c802b1c337cdafea0ee880",
"score": "0.56590563",
"text": "def index\n if params[:currency].present?\n @dynamic_iaps = DynamicIap.where(currency: params[:currency])\n else\n @dynamic_iaps = DynamicIap.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dynamic_iaps }\n end\n end",
"title": ""
},
{
"docid": "ae8511ec9f2393656122802f483fe96b",
"score": "0.5659023",
"text": "def index\n @ingredient_measurements = IngredientMeasurement.all\n end",
"title": ""
},
{
"docid": "19c25a7977273cbd5c63caea8abd8b8c",
"score": "0.5658041",
"text": "def show\n @audition_admin = AuditionAdmin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @audition_admin }\n end\n end",
"title": ""
},
{
"docid": "60c028c8853bec0cee9fd007417e1b92",
"score": "0.56576073",
"text": "def index\n @samplings = @user.samplings.includes(:experience_sample_config)\n end",
"title": ""
},
{
"docid": "bd23c5df7a93a80184d382fe0ea7bc27",
"score": "0.5656376",
"text": "def index\n @patients = Patient.all\n render json: @patients, :include => :surveys\n end",
"title": ""
},
{
"docid": "5f0a75d0a0e8ad09d5bdc033ec3a69cd",
"score": "0.5653095",
"text": "def index\n @instruktors = Instruktor.all\n end",
"title": ""
},
{
"docid": "a9c5ddce83c5afe5e090c2c4241dfcaf",
"score": "0.5652059",
"text": "def index\n @assessment_iits = AssessmentIit.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@assessment_iits }\n end\n end",
"title": ""
},
{
"docid": "f27f572bea2bcd4c5186eb2bd83bfeb3",
"score": "0.5649249",
"text": "def index\n @instruments = MemberInstrument.all.map { |mi| [mi.instrument.capitalize, mi.instrument] }.uniq\n joins = []\n\n if params[:instrument]\n joins << :member_instruments\n end\n if params[:set]\n joins << :member_sets\n end\n\n @members = Member.joins(joins)\n\n if params[:instrument]\n @members.where(\"instrument = ?\", params[:instrument])\n end\n if params[:set]\n @members.where(\"set_id = ?\", params[:set])\n end\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "c441c66a15b751ae160567fdab21111d",
"score": "0.5637957",
"text": "def index\n @incidents = Incident.all\n end",
"title": ""
},
{
"docid": "2268d3677d52949c53b98d6500d56d8f",
"score": "0.56377393",
"text": "def index\n @juridico_instrumentos = Juridico::DatInstrumentoLegal.consulta\n end",
"title": ""
},
{
"docid": "2600f08b3565460553290245be230540",
"score": "0.5637021",
"text": "def index\n @inpatients = Inpatient.all\n end",
"title": ""
},
{
"docid": "94fbc84194e0550b83203846e33dad48",
"score": "0.5631045",
"text": "def index\n @admin_surveys = Admin::Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_surveys }\n end\n end",
"title": ""
},
{
"docid": "c8ea2a29b7d15da07adbd1bc707c3ee9",
"score": "0.56303835",
"text": "def index\n @measurement_equipments = MeasurementEquipment.all\n end",
"title": ""
},
{
"docid": "13d2d37a142866701b4fac777955b346",
"score": "0.5625782",
"text": "def index\n @insp_skills = InspSkill.all\n end",
"title": ""
},
{
"docid": "3b54b19ad49df4915bcd33d947b77fa0",
"score": "0.56189007",
"text": "def index\n @study = Study.find_by_irb_number(params[:study_id])\n @involvements = Involvement.find_all_by_study_id(@study.id,\n :order => :case_number,\n :include => [ :response_sets,{ :subject => :involvements }, { :involvement_events => :event_type } ]\n )\n #@involvements = @study.involvements\n authorize! :show, @study\n respond_to do |format|\n format.html\n format.js {render :layout => false}\n end\n end",
"title": ""
},
{
"docid": "c234d4dccf4756b148b8c41da45316c3",
"score": "0.56148034",
"text": "def institutions(token)\n response = query({\n api: :data,\n endpoint: \"/institutions.json\",\n token: token,\n method: :GET,\n skip_parse: true,\n })\n\n response\n end",
"title": ""
},
{
"docid": "479cb7b046bbba3ce304b7eca9f9ed29",
"score": "0.5607454",
"text": "def index\n @metrics = @idea.metrics.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @metrics }\n end\n end",
"title": ""
},
{
"docid": "4e68b9b7ea9f6f824417a26bd3e9f24a",
"score": "0.5600958",
"text": "def index\n @indicateds = Indicated.all\n end",
"title": ""
},
{
"docid": "c384ce978d25c9a6744d18c0d71ae15f",
"score": "0.55997586",
"text": "def search_equipment_by_name(name)\n url = @base + \"/api/v1/instruments.json?token=#{@token}&name=#{name}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"title": ""
},
{
"docid": "dbfd56094c8002d3774c9f01984bbefc",
"score": "0.5599462",
"text": "def index\n @instrutores = Instrutor.all\n end",
"title": ""
},
{
"docid": "cb01d6e324086275a35b6c97c922d276",
"score": "0.5597088",
"text": "def show\n\t\t@auditor = Auditor.find(params[:id])\n @auditor_samples = @auditor.samples.limit(10)\n end",
"title": ""
},
{
"docid": "12448eb564f3b8087e329f37ce123af6",
"score": "0.55913043",
"text": "def index\n @midia = Midium.all\n end",
"title": ""
},
{
"docid": "bf0a7b4db5ccf6d8a1e8153d19e8e1e3",
"score": "0.5590003",
"text": "def index\n @specimen = Speciman.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @specimen }\n end\n end",
"title": ""
},
{
"docid": "31801531d26e09668bcea4deacc61922",
"score": "0.55854374",
"text": "def index\n @institutehandlers = Institutehandler.all\n end",
"title": ""
},
{
"docid": "dd52c3317026f7e5a067f6e251c14165",
"score": "0.5585224",
"text": "def index\n @illustrations = Illustration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @illustrations }\n end\n end",
"title": ""
},
{
"docid": "bdc7e334a53c1c2354b0a17c15cc8d32",
"score": "0.558324",
"text": "def index\n @spectators = Spectator.all\n render json: @spectators\n end",
"title": ""
},
{
"docid": "792aff1f0a64b034f1c6930d0e5a24d3",
"score": "0.5580654",
"text": "def index\n @inventories = Inventory.all\n respond_to do |format|\n format.html\n format.json { render :json => @inventories }\n end\n end",
"title": ""
},
{
"docid": "995a5a8065432d64c703a3b2b7fd3852",
"score": "0.5578325",
"text": "def details\n lid = params[:id]\n @experiments = get_library_experiments_details(lid)\n render json: {\n experiments_html: render_to_string(partial: \"shared/details_experiments\")\n }\n end",
"title": ""
},
{
"docid": "602f3c38580100e3649402bd696dac01",
"score": "0.557126",
"text": "def index\n @identifiers = Identifier.all\n\n render json: @identifiers\n end",
"title": ""
},
{
"docid": "2d23fb00fb78c4b1a65adb44b4c0cdd9",
"score": "0.5568989",
"text": "def index\n @device_interests = DeviceInterest.all\n end",
"title": ""
},
{
"docid": "4c233641e19d16b00495a518acba3a8f",
"score": "0.5565002",
"text": "def index\n @inventories = Inventory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end",
"title": ""
},
{
"docid": "c5f5004ea9c4c14c120f1b44193248f7",
"score": "0.5564762",
"text": "def index\n @inscriptions = Inscription.all\n end",
"title": ""
}
] |
3deaf4623788f72154be6219148b4748
|
fibonacci series: 0 1 1 2 3 5 8 13 21 ... e.g. 0th fibonacci number is 0 e.g. 1st fibonacci number is 1 .... e.g. 6th fibonacci number is 8
|
[
{
"docid": "93b5f4ae19b18211c423f891ad7e019c",
"score": "0.0",
"text": "def fibonacci(n)\n raise ArgumentError if n.class != Integer\n raise ArgumentError if n < 0\n return n if n < 2\n\n i = 1\n n1 = 0\n n2 = 1\n\n while i < n\n fibonacci = n1 + n2\n n1 = n2\n n2 = fibonacci\n i +=1\n end\n\n return fibonacci\n\nend",
"title": ""
}
] |
[
{
"docid": "f5829903a664494096cac8d9568680fc",
"score": "0.8257663",
"text": "def fibinacci(number)\n fibinacci_series = [1,1]\n index = 2\n while index <= (number-1)\n fibinacci_series[index] = fibinacci_series[index - 1] + fibinacci_series[index - 2]\n index = index + 1\n end\n return fibinacci_series\nend",
"title": ""
},
{
"docid": "6c5b80958dbaf804c3dc58115346399f",
"score": "0.8178365",
"text": "def fibonacci(how_many_numbers)\n fibonacci_sequence = []\n count = 0\n while count < how_many_numbers\n if count == 0\n fibonacci_sequence << 0\n count += 1\n elsif count == 1\n fibonacci_sequence << 1\n count += 1\n else\n fibonacci_sequence << fibonacci_sequence[-1] + fibonacci_sequence[-2]\n count += 1\n end\n end\n fibonacci_sequence\nend",
"title": ""
},
{
"docid": "34fb6afa0306469fd17f6bf30adc0e80",
"score": "0.8171532",
"text": "def fib(n)\n # edge cases:\n if n < 0\n raise Exception, 'Index was negative. No such thing as a negative index in a series.'\n elsif n == 0 || n == 1\n return n\n end\n\n # we'll be building the fibonacci series from the bottom up\n # so we'll need to track the previous 2 numbers at each step\n prev_prev = 0\n prev = 1\n current = prev + prev_prev\n\n # since we already initialized up to the 2nd number in the series\n # we take n - 2 steps ahead to reach n (.times is exclusive)\n (n - 1).times do\n current = prev + prev_prev\n prev_prev = prev\n prev = current\n end\n\n current\nend",
"title": ""
},
{
"docid": "ef89718ffae188630bf41c6edf669d3c",
"score": "0.8167482",
"text": "def fibonacci(n)\n if n == 0\n 0\n elsif n == 1\n 1\n else\n before_previous = 0\n previous = 1\n actual = nil\n (2..n).each do\n actual = previous + before_previous\n before_previous = previous\n previous = actual\n end\n actual\n end\nend",
"title": ""
},
{
"docid": "77c0af64a6c0299d9b8df1904b26f140",
"score": "0.81527185",
"text": "def nth_fib(x)\n arr = [0,1]\n count = 1\n while count < x\n next_val = arr[-1] + arr[-2]\n arr = [arr[-1], next_val]\n count += 1\n end\n puts next_val\n # puts \"The weird algorithm from Hackerank comes to: #{next_val % (10**8 + 7)}\"\n end",
"title": ""
},
{
"docid": "d389220f15819012f3c737bf5658a22b",
"score": "0.81171244",
"text": "def nthFibonacci (n)\n \n if n == 0\n return 0\n end\n\n i = 0\n\n sequence = Array.new\n\n sequence.push(i)\n\n i += 1\n\n sequence.push(i)\n\n while i < n do\n sequence[i+1] = (sequence[-1]) + (sequence[-2])\n\n i += 1\n end\n\n sequence[-1]\nend",
"title": ""
},
{
"docid": "103d253c8b112196a71f0d39079a9468",
"score": "0.81154644",
"text": "def fibonacci(num)\n fib_nums = []\n (0...num).each do |i|\n if i == 0 || i == 1\n fib_nums << 1\n next\n end\n fib_nums << fib_nums[i-2] + fib_nums[i-1]\n end\n return fib_nums\nend",
"title": ""
},
{
"docid": "118b844917560d0406d5877157c50fcf",
"score": "0.80886537",
"text": "def cool_fib(number)\n (0..number).inject([1,0]) {|i_arr| [i_arr.last, i_arr.first + i_arr.last]}.first\nend",
"title": ""
},
{
"docid": "d75d860e537d2510152e80a550cc8424",
"score": "0.8085999",
"text": "def fib (x)\n y = x-2\nfib_sequence = y.times.inject(%5B0,1%5D) do |a, idx|\n a << a[-2] + a[-1]\nend",
"title": ""
},
{
"docid": "26909d343f4fe34521d1e4bd6ec5bbca",
"score": "0.80676603",
"text": "def fibonaci(n)\n\tfi= [1, 1]\n\t(n-1).times do\n\t\tfi << fi[1]+fi.shift\n\tend\n\treturn fi[0]\nend",
"title": ""
},
{
"docid": "c97e2cd3020384d8a42227b33cb82925",
"score": "0.80594254",
"text": "def nth_fibonacci(n)\n return 0 if n == 1\n sequence = [1]\n (n - 2).times do\n current_number, last_number = sequence.last(2)\n sequence << current_number + (last_number || 0)\n end\n\n sequence.last\nend",
"title": ""
},
{
"docid": "63815972fbb4c7c5243432f03f2cf692",
"score": "0.80449474",
"text": "def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend",
"title": ""
},
{
"docid": "10ab0db6d4827228ac4c33d027413615",
"score": "0.80422944",
"text": "def get_fibonacci(num)\n f = [0,1]\n for i in (2..num)\n f << (f[-1] + f[-2])\n end\n if num == 0\n f = 0\n end\n f[-1]\nend",
"title": ""
},
{
"docid": "929d32e6a9302a4f932cca7b2e1bc3b8",
"score": "0.8032894",
"text": "def fibonacci_sequence index\n if index == 0 || index == 1\n return index\n else\n return fibonacci_sequence(index - 2) + fibonacci_sequence(index - 1)\n end\nend",
"title": ""
},
{
"docid": "5b1fd5ad9021decc26c1816bc3a10d08",
"score": "0.80276173",
"text": "def nthFibonacci (n)\r\n num = n.to_i\r\n fibonacci_sequence = Array.new\r\n case num\r\n when 0 \r\n fibonacci_sequence << 0\r\n when 1\r\n fibonacci_sequence << [0,1]\r\n else\r\n fibonacci_sequence[0] = 0\r\n fibonacci_sequence[1] = 1\r\n i = 1\r\n while i < num\r\n i+= 1\r\n fibonacci_sequence[i] = fibonacci_sequence[i-1] + fibonacci_sequence[i-2] \r\n end\r\n end\r\n return fibonacci_sequence\r\nend",
"title": ""
},
{
"docid": "7165b198f040e333b74bf05d0701e46a",
"score": "0.79766697",
"text": "def q9_fibonacci(num)\n f1 = 0\n f2 = 1\n (num-1).times {|_|\n tmp = f2\n f2 += f1 \n f1 = tmp\n }\n f2\nend",
"title": ""
},
{
"docid": "a9bacc8d85948f5c96a9a78a5647d596",
"score": "0.79524654",
"text": "def fibonacci_sequence(n)\n counter = 1\n fib_sum = 1\n previous = [1]\n if n == 1 || n == 2\n return 1\n else \n until counter == n - 1\n previous << fib_sum\n fib_sum += previous[counter - 1] \n counter += 1\n end\n return fib_sum\n end\nend",
"title": ""
},
{
"docid": "3e8089f6dbd60018efeaebb4e289e153",
"score": "0.79324615",
"text": "def nth_fibonacci(n)\n result = [0,1]\n\n for i in 1..n-1\n result[i+1] = result[i] + result[i-1]\n end\n\n return result[n]\nend",
"title": ""
},
{
"docid": "c91a73f3f47e07557c38b15533190b03",
"score": "0.7930777",
"text": "def fibonacci\n\tresults, first, second, current = 0, 1, 2, 2\n\twhile current <= 4000000\n\t\tif current % 2 == 0\n\t\t\tresults += current\n\t\tend\n\t\tcurrent = first + second\n\t\tfirst, second = second, current\n\tend\n\treturn results\nend",
"title": ""
},
{
"docid": "833acf9741045f69f3713a9cf5900a1d",
"score": "0.79231656",
"text": "def fibonacci_number(n)\n #define nth Fibonacci term\n fibonacci_lst=[0,1] #F1=1,F2=1\n for i in 2..n\n fibonacci_lst[i]=fibonacci_lst[i-1]+fibonacci_lst[i-2]\n end\n return fibonacci_lst[n]\nend",
"title": ""
},
{
"docid": "04e1fe28265b1b4b43340cb7212c9bca",
"score": "0.79110026",
"text": "def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"title": ""
},
{
"docid": "db12da60c4713e489bb5c79ff553c83b",
"score": "0.78940123",
"text": "def iterative_fib(num)\r\n a = 0\r\n b = 1\r\n\r\n num.to_i.times do\r\n temp = a\r\n a = b\r\n # Add up previous two numbers in sequence\r\n b = temp + b\r\n end\r\n\r\n return b\r\nend",
"title": ""
},
{
"docid": "3b652a9ba34245393ba91243248c1a51",
"score": "0.7893841",
"text": "def fibonacci\n @sequence = [1,1]\n x = 0\n while (@sequence[x+1] < 4e+6)\n @sequence << @sequence[x] + @sequence[x+1]\n x += 1\n end\n even? x\nend",
"title": ""
},
{
"docid": "18beb15c78c14c3a56face832d4dbf9b",
"score": "0.7880557",
"text": "def fibonacci(n)\n raise ArgumentError, \"n must be an integer greater than 0\" unless n && n >= 0\n current = 0\n one_before = 0\n two_before = 0\n i = 0\n while i <= n\n if i == 1\n current = 1\n else\n two_before = one_before\n one_before = current\n current = one_before + two_before\n end\n i += 1\n end\n return current\nend",
"title": ""
},
{
"docid": "51d291691af245554dba07c2041f2899",
"score": "0.7869352",
"text": "def fib(number)\n sequence = [0,1]\n number.times {sequence << sequence[-1] + sequence[-2]}\n sequence[-1]\n return sequence\nend",
"title": ""
},
{
"docid": "888238c016b971b0b1deb4fac06b4729",
"score": "0.78633183",
"text": "def fib (n)\n # return appropriate starter values if n is 0 or 1\n if n == 0 \n return 0\n elsif n == 1\n return 1\n end\n # set up initial constants\n prevNum = 0\n currNum = 1\n # Loop through fibonacci numbers, starting at index 2.\n 2.upto(n) do\n nextNum = prevNum + currNum\n prevNum = currNum\n currNum = nextNum\n end\n return currNum\nend",
"title": ""
},
{
"docid": "f554b170c7155ab49fd630f73a769c3d",
"score": "0.78547657",
"text": "def fibs(num)\n array = []\n 0.upto(num) do |i|\n array << i if i.zero? || i == 1\n array << array[i - 1] + array[i - 2] if i > 1\n end\n array\nend",
"title": ""
},
{
"docid": "161a8651844fa3fbaa93144760ece1a6",
"score": "0.7852672",
"text": "def nth_fibonacci(n) \n if n == 1\n return 0\n elsif n == 2\n return 1\n end\n return nth_fibonacci(n-1) + nth_fibonacci(n-2)\nend",
"title": ""
},
{
"docid": "dd5e230d274495fd3477735e18956255",
"score": "0.78521925",
"text": "def fibonacci(num)\n (1..num).inject( [0,1] ) { |fib| fib << fib.last(2).inject(:+) }\n\nend",
"title": ""
},
{
"docid": "ebd88364fc8c0ba1c0a7a0a2b3d63f89",
"score": "0.78476065",
"text": "def fibonacci(fib)\r\n \t#Set a variable to 0\r\n\tvalue1 = 0 \r\n\t#Set a variable to 1 (array must start with 0, 1...)\r\n\tvalue2 = 1\r\n\t\t#For the number of digits it will be, loop do this many times\r\n\t\tfib.times do \r\n\t\t\t#Create a temp to store value1\r\n \t\t\ttemp = value1\r\n \t\t\t#Make value1 equal value2\r\n \t\t\t#This will help when printing out 0,1,1.. in the beginning\r\n \t\t\tvalue1 = value2\r\n \t\t\t#Make value2 equal the sum of temp and value2\r\n \t\t\t#This will add the last numbers to get the next number\r\n \t\t\tvalue2 = temp + value2\r\n \t\t#End do loop\r\n\t\tend\r\n\t#Return the first value\r\n \tvalue1\r\n#End of method\r\nend",
"title": ""
},
{
"docid": "758d60f3b3009b463f9ab9d4e16bcf24",
"score": "0.7836736",
"text": "def fib(n)\n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n last = 1\n next_to_last = 0\n i = 2\n\n while i <=n\n cur_fib = last + next_to_last\n next_to_last = last\n last = cur_fib\n i +=1\n end\n return cur_fib\nend",
"title": ""
},
{
"docid": "df5c7bc558414d7f198a5c3d6b58b6b6",
"score": "0.78365374",
"text": "def fibonacci(integer)\n fibs = [1, 1]\n (integer - 2).times do |num|\n fibs << fibs[num] + fibs[num + 1]\n end\n fibs.last\nend",
"title": ""
},
{
"docid": "b598e989c07fb1b2dbc602ff3ab3be66",
"score": "0.7828583",
"text": "def fibonacci(term1, term2, num_terms)\n series = [term1, term2]\n series << series[-2] + series[-1] until series.length == num_terms\n series\nend",
"title": ""
},
{
"docid": "6fbc6b7dd9a08ffd4e9baa42b41987bf",
"score": "0.7825714",
"text": "def fibonacci_iterative(n)\n return 0 if n == 0\n fib_sequence = [0,1]\n index = 1\n until n == index\n fib_sequence << fib_sequence[index] + fib_sequence[index-1]\n index += 1\n end\n fib_sequence.last\nend",
"title": ""
},
{
"docid": "0b65ef5f659788a498381ef92deeb566",
"score": "0.78253984",
"text": "def fibonacci(num)\n arr = []\n (1..num).each do |number|\n number == 1 || number == 2 ? arr << 1 : arr << arr[-1] + arr[-2]\n end\n arr.last\nend",
"title": ""
},
{
"docid": "524de57d5d61e13014a10d7dc03488fb",
"score": "0.7816175",
"text": "def fib(n)\n\n fib_array = []\n first = 0\n second = 1\n\n if n == 0\n fib_array << nil\n elsif n == 1\n fib_array << 0\n else\n fib_array << 0\n fib_array << 1\n if n >= 3\n (3..n).each do # Due to the zero index of\n # Ruby, we use 3 here to represent the\n # numbers after 0, 1, 1\n\n next_number = (first + second)\n first = second\n fib_array << second = next_number\n\n end\n end\n end\n return fib_array\n\nend",
"title": ""
},
{
"docid": "bc85d88e40626d6a89d34fcbf76bea88",
"score": "0.7812385",
"text": "def fibonacci (integer)\n\tfib_arr = [0, 1]\n\t(integer-2).times do |index|\n\t\tresult = fib_arr[index+1] + fib_arr[index]\n\t\tfib_arr << result\n\tend\n\t\np fib_arr\nend",
"title": ""
},
{
"docid": "0106ab298d3e757264351151413e8f99",
"score": "0.78089124",
"text": "def fibonacci_series(input)\n fib = 2\n while(fib < input) do\n if(fib == 2)\n previous = fib\n fib += 1\n ap(1)\n ap(1)\n ap(previous)\n else\n tmp_previous = fib # number we got from current iteration will be previous value to next value\n fib = fib + previous \n previous = tmp_previous # setting the previous value\n end\n ap(fib)\n end\nend",
"title": ""
},
{
"docid": "d7eb34e56edd69526b7e42f17d1bf5b9",
"score": "0.7806643",
"text": "def fibonacci_last(n)\n return 1 if n <= 2\n n1, n2 = [1, 1]\n 3.upto(n) { n1, n2 = [n2, n1 + n2] }\n n2.to_s.chars[-1].to_i\nend",
"title": ""
},
{
"docid": "9f00089fb9e96b2b791ac9efde458a40",
"score": "0.7796158",
"text": "def fibonacci(n)\n raise ArgumentError if n == nil || n < 0 || n.class != Integer\n return n if n < 2\n\n if n >= 2\n current_value= 0\n previous_value = 1\n next_value = 0\n number = n - 1\n\n number.times do \n next_value = current_value + previous_value \n current_value = previous_value \n previous_value = next_value\n end\n end\n \n return next_value\nend",
"title": ""
},
{
"docid": "cc3ed65572568b14cee296113013332a",
"score": "0.7791316",
"text": "def fibonacci(n)\n if n == 0 || n == 1\n return n\n end\n\n first = 0\n second = 1\n current = 1\n\n while n > 2\n first = second\n second = current\n current = first + second\n n -= 1\n end\n\n return current\nend",
"title": ""
},
{
"docid": "a67c0d2249fef0d876389a8d3d5f8b75",
"score": "0.77833354",
"text": "def iter_fib(n)\n return n if n == 0 || n == 1\n\n two_before = 0\n one_before = 1\n\n for i in 2..n\n current = two_before + one_before\n two_before = one_before\n one_before = current\n end\n one_before\nend",
"title": ""
},
{
"docid": "033688127c32d6a91b09306ded2fa671",
"score": "0.7776486",
"text": "def fibs(number)\n\n\tfibonacci=[1]\n\tcount=0\n\tnum1=1\n\tnum2=0\n\twhile fibonacci.size<number\n\t\tsum=num1+num2\n\t\tfibonacci.push(sum)\n\t\tnum2=num1\n\t\tnum1=sum\n\tend\n\n\treturn fibonacci\nend",
"title": ""
},
{
"docid": "8bb6b450d4b7c986c495665fb38e1f1d",
"score": "0.7776365",
"text": "def fibonacci(num) \n\tfib = [0,1]\n (num - 2).times do \n \tfib << fib[-2] + fib[-1]\n end\n fib[-1]\nend",
"title": ""
},
{
"docid": "5c04a6cb55ef00498d0e8e28757eb381",
"score": "0.7772555",
"text": "def fibonacci(n)\n # raise NotImplementedError\n raise ArgumentError if n < 0 || n == nil #error if negative\n\n i = 0\n fib_array = [0, 1] #all fibonacci sequences begin with 0 and 1\n until fib_array.length == n+1 #until the correct index is reached\n fib_array.push fib_array[i] + fib_array[i+1]\n i += 1\n end\n return fib_array[n] #return number at requested index\nend",
"title": ""
},
{
"docid": "9b11b0a1cff0841ec05583a44db4354a",
"score": "0.77721024",
"text": "def iterative_nth_fib(n)\n return 1 if n <= 2\n a = 1\n b = 1\n i = 3\n while i <= n\n new_a = b\n b = a + b\n a = new_a\n i += 1\n end\n b\nend",
"title": ""
},
{
"docid": "b8cc31f92f82d3fbbe0aafae9316445a",
"score": "0.77700067",
"text": "def fibonacci(limit)\n sequence = [0]\n if limit == 0\n puts \"Please enter a number above 0\"\n else\n pattern = 1\n (limit - 1).times do |index|\n sequence << pattern\n pattern = pattern + sequence[index]\n end\n puts \"The first #{limit.to_s} numbers in the Fibonacci Sequence are #{sequence}\"\n end\nend",
"title": ""
},
{
"docid": "c7387136c0be508fdf5536f06247e65e",
"score": "0.7767506",
"text": "def fibonacci(n)\n ary = [0, 1]\n (n - 1).times { |_| ary << ary[-2] + ary[-1] }\n ary.pop\nend",
"title": ""
},
{
"docid": "dd35701845ee7d2a35670f39f6ae3297",
"score": "0.7750338",
"text": "def regular_fib(sequence)\n first = 0\n second = 1\n if sequence == 0\n puts \"total = 0\"\n end\n sequence.times do \n total = first + second\n puts \"total(#{total}) = #{first} + #{second}\"\n first = second\n second = total\n end \nend",
"title": ""
},
{
"docid": "021a0c5890b94e422aa75af46089925e",
"score": "0.7749046",
"text": "def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2]+obj[-1]}\nend",
"title": ""
},
{
"docid": "f42aeb971b3d1ca5d30a60555e419be6",
"score": "0.77472395",
"text": "def iterative_fib (num)\n fib_arr = []\n (1..num).each do |i|\n if i == 1 || i == 2\n fib_arr << 1\n else\n fib_arr << fib_arr[-1] + fib_arr[-2]\n end\n end\n fib_arr\nend",
"title": ""
},
{
"docid": "840b2c0b30d10f2e037e91b263d5e7f0",
"score": "0.7744178",
"text": "def fibonacci(n)\n if n == 0\n 1\n elsif n == 1\n 1\n else\n fibonacci(n-2) + fibonacci(n-1)\n end\nend",
"title": ""
},
{
"docid": "8217847e3e1353acdf0d8086cd7bce58",
"score": "0.77383935",
"text": "def fibonacci(n)\n raise ArgumentError, \"Not an integer larger than 0\" if !n || n < 0\n\n fib_array = [0, 1]\n i = 0\n\n if n == 0\n return 0\n elsif n == 1\n return 1\n else\n until i == (n - 1)\n fib_array << fib_array[i] + fib_array[i + 1]\n i += 1\n end\n end\n return fib_array[n]\nend",
"title": ""
},
{
"docid": "068365054893d27a41652ee7fd08a6f1",
"score": "0.77374804",
"text": "def fib(n) #n indicates # of elements we want in array\r\n a = 0\r\n b = 1\r\n fib_arr = []\r\n #loop starts iff n >= 1, but x starts from 0 (when n=1, x=0; n=2, x=0,1)\r\n n.times do |x| \r\n if x == 0\r\n fib_arr << a\r\n elsif x == 1\r\n fib_arr << b\r\n else\r\n c = a+b #c is the new fib # we are generating\r\n fib_arr << c\r\n a = b\r\n b = c\r\n end\r\n end\r\n return fib_arr\r\nend",
"title": ""
},
{
"docid": "d728bde67d12967d53bee2dc0f28b39a",
"score": "0.7735802",
"text": "def fib(x)\n fibo_number = [0, 1]\n (x - 2).times do\n n = fibo_number[-1] + fibo_number[-2]\n fibo_number << n\n end\n puts fibo_number\nend",
"title": ""
},
{
"docid": "c7fe46a8dfbf944e52341ea3ae2e9cee",
"score": "0.77345663",
"text": "def fibonacci(n)\n n = fibonacci( n - 1 ) + fibonacci( n - 2 ) if n > 1\n n\nend",
"title": ""
},
{
"docid": "cbd9859e15f9a2aa6b1eacbaab520a32",
"score": "0.77327585",
"text": "def fib(x)\n fib_nums = [0,1]\n number = x - 2\n number.times do\n fib_nums << fib_nums[-2] + fib_nums[-1]\n end\n p fib_nums\nend",
"title": ""
},
{
"docid": "c019fd53d9ea071c042a99b67d778911",
"score": "0.7732363",
"text": "def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"title": ""
},
{
"docid": "c019fd53d9ea071c042a99b67d778911",
"score": "0.7732363",
"text": "def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"title": ""
},
{
"docid": "debd917eb39c2f09bf5531e4372ee788",
"score": "0.7727317",
"text": "def fibonacci(n)\r\n if n == 0\r\n return 0\r\n elsif n == 1\r\n return 1\r\n else\r\n return fibonacci(n-1) + fibonacci(n-2)\r\n end\r\nend",
"title": ""
},
{
"docid": "f56fbd77c7b5da605d42d22193f59943",
"score": "0.77219653",
"text": "def fibonacci(int)\n range_array = (1..int).to_a\n final_array = [1,1]\n range_array.each do |num|\n p num > 2 ? final_array << final_array[num-3] + final_array[num-2] : nil\n end\n final_array[-1]\nend",
"title": ""
},
{
"docid": "e15be8386ce08cf34bea6fe2587d94e6",
"score": "0.77203566",
"text": "def fibonacci(int)\n range_array = (1..int).to_a\n final_array = [1,1]\n range_array.each do |num|\n num > 2 ? final_array << final_array[num-3] + final_array[num-2] : nil\n end\n final_array[-1]\nend",
"title": ""
},
{
"docid": "9b50521911bb06268c36f9d8fff2be29",
"score": "0.7720273",
"text": "def fibonacci(n)\n fib = [1, 1]\n #count from 3rd term but\n #i = 2 because of array 0 indexing\n i = 2\n\n while i < n\n fib.push(fib[i-1] + fib[i-2])\n i += 1\n end\n\n #print result\n puts fib.inspect\nend",
"title": ""
},
{
"docid": "19dad1318b39fe3b7b7ef55316db9ea8",
"score": "0.7715872",
"text": "def fibonacci_number(i)\n if i == 1 || i == 2\n 1\n else\n fibonacci_number(i - 1) + fibonacci_number(i - 2)\n end\nend",
"title": ""
},
{
"docid": "efa3b3d3c35a4a03790a995580265bf3",
"score": "0.77153796",
"text": "def fib1(n)\n fibs = [0, 1]\n ( 0..(n-1) ).each { |idx|\n next if fibs[idx] < 1\n fibs << fibs[idx] + fibs[idx - 1]\n }\n fibs.last\nend",
"title": ""
},
{
"docid": "84070ec4e200ba7d3c32c97c42c6c4c4",
"score": "0.77143455",
"text": "def iter_fib(number)\n v1 = 0\n v2 = 1\n (number-1).times.each do\n temp = v2\n v2 = v2 + v1\n v1 = temp\n end\n v2\nend",
"title": ""
},
{
"docid": "01f7f5085587e23438dfc12818b424e2",
"score": "0.77133167",
"text": "def fibonacci(amount)\r\n fib_array = [0, 1]\r\n current_value = 0\r\n if (amount == 0) ; return 0; end # Edge case...\r\n if (amount == 1) ; return 1; end # Edge case...\r\n\r\n index = 2 # Start indexing after the edge cases.\r\n until index == amount\r\n current_value = fib_array[-1] + fib_array[-2] # Equation for Fib-sequence. push it onto array afterwards.\r\n fib_array.push(current_value)\r\n index += 1 # counter approaching amount\r\n end \r\n return fib_array[-1] # return the last value we did!\r\nend",
"title": ""
},
{
"docid": "c90c82bd65590646172304572c12c6fa",
"score": "0.7712939",
"text": "def calc_fib(n)\n # initialize list with first two numbers\n fib_list = [0, 1]\n # then iteratively add new members of the series, up but not including n\n i = 2\n while i <= n\n fib_list.push(fib_list[i-1] + fib_list[i-2])\n i += 1\n end\n return fib_list[n]\nend",
"title": ""
},
{
"docid": "9f2a299291080f51d86d8612cae6c2ea",
"score": "0.7711577",
"text": "def fibonacci(integer)\n x = 2\n sequence = [1, 1]\n until x == integer\n last = sequence[0] + sequence[1]\n first = sequence[1]\n sequence[1] = last\n sequence[0] = first\n x += 1\n end\n\n sequence.last\nend",
"title": ""
},
{
"docid": "4698adb59d241fb7c21a2c2c67d2b84f",
"score": "0.7711542",
"text": "def fib_iterative(n)\n\tnum = 0\n\tnext_num = 1\n\tpositions = 1..n\n\tpositions.each do |position|\n\t\tnum = next_num\n\t\tnext_num = next_num + num\n\tend\n\tretun num\nend",
"title": ""
},
{
"docid": "8410ef6311b5cb5e587636c3d20cfc4e",
"score": "0.7710429",
"text": "def fibonacci(n)\n return [0,1].take(n) if n <= 2\n fib_seq = fibonacci(n-1)\n last_ele = fib_seq[-1] + fib_seq[-2]\n fib_seq << last_ele\nend",
"title": ""
},
{
"docid": "e8e11dfc9685d58bd9c68480b7c8449b",
"score": "0.77098906",
"text": "def fibonacci n\n first = 0\n second = 1\n n.times do\n third = first + second\n first = second\n second = third\n end\n first\nend",
"title": ""
},
{
"docid": "8e971636618fa4847839b1fdef503433",
"score": "0.7709483",
"text": "def fibonacci_number(num)\n # make sure fibonacci_number(0) and fibonacci_number(1)\n # start the sequence by returning 1 and 1. \n # This is an edge case\n\n if num <= 2\n return 1\n end\n # start the sequence with the first two numbers\n fibs_ar = [1, 1]\n # for educational purposes\n counter = 1\n\n # calculate the next number until the array has the one we want\n while fibs_ar.length < num\n second_to_last = fibs_ar[fibs_ar.length - 2]\n last = fibs_ar.last\n next_fib = second_to_last + last\n fibs_ar << next_fib\n counter +=1\n puts \"second_to_last = #{second_to_last}\"\n puts \"last = #{last}\"\n puts \"next_fib = #{next_fib}\"\n puts \"counter = #{counter}\"\n puts \"The Fibonacci Series is = #{fibs_ar}\"\n puts \"After #{counter} iterations, the last number is #{last}\"\n puts \"===========================================\"\n end\n print \"The final Fibonacci series is: #{fibs_ar}\"\n print \"\\n\"\n print \"The number in the Fibonacci series at position #{num} is: #{fibs_ar.last}\"\n print \"\\n\"\n fibs_ar.last\nend",
"title": ""
},
{
"docid": "34cfb182d3bf9a774ee003c9f28b11e7",
"score": "0.7708312",
"text": "def fib(n)\n current_value = 0\n next_value = 1\n\n n.times do |i|\n current_value, next_value = next_value, current_value + next_value\n end\n\n return current_value\nend",
"title": ""
},
{
"docid": "ba6a3bb082e9aa2c66bc51ecbb4f11f2",
"score": "0.7707094",
"text": "def fibonacci2(n)\n return 0 if n == 0\n return 1 if n == 1 || n == 2\n last = 0\n lastlast = 1\n current = 0\n n.times do\n current = last + lastlast\n lastlast = last\n last = current\n end\n current\nend",
"title": ""
},
{
"docid": "ba114eabc7cf0be61ed92f085f0ada5d",
"score": "0.77019745",
"text": "def fibonacci(n)\n fibonacci_num = 0\n prior_num = 0\n current_num = 1\n\n if !n || n < 0\n raise ArgumentError\n elsif n == 0 || n == 1\n return n\n else \n (n-1).times do\n fibonacci_num = prior_num + current_num\n prior_num = current_num\n current_num = fibonacci_num\n end\n return current_num\n end\nend",
"title": ""
},
{
"docid": "a33999f081dac704cc1d2696153d56ee",
"score": "0.7701471",
"text": "def fib(n)\n n.times.each_with_object([0,1]) { |_, results| results << results[-2] + results[-1] }\nend",
"title": ""
},
{
"docid": "2f1e528593745441f1d76412bb2b79b0",
"score": "0.7700722",
"text": "def fibonacci(n)\n fibb = []\n fibb[0], fibb[1], fibb[2] = 0, 1, 1\n (3).upto(n) do |i|\n fibb[i] = fibb[i - 2] + fibb[i - 1]\n end\n fibb[n]\n end",
"title": ""
},
{
"docid": "4c550f87dcae50161cd251f9f8770e54",
"score": "0.7697773",
"text": "def fibonacci(n)\n if n<=2\n [0,1].take(n)\n else\n arr = fibonacci(n-1)\n arr << arr[-2]+arr[-1]\n end\nend",
"title": ""
},
{
"docid": "50cc1fd7c4a91c48171f85c6be98a17f",
"score": "0.76976097",
"text": "def iterative_fib_sequence(n)\n\tfib = [0]\n\tn.times do\n\t\tif fib.length > 2\n\t\t\tfib << fib[-1] + fib[-2]\n\t\telse\n\t\t\tfib << 1\n\t\tend\n\tend\n\tfib\nend",
"title": ""
},
{
"docid": "2dca8e3ba2c0c6b1bc0c627323455ca7",
"score": "0.7695588",
"text": "def fibonacci (n)\r\n seq = [0, 1]\r\n \r\n (2..n).each do |i|\r\n seq.push seq[i-1] + seq[i-2]\r\n end\r\n \r\n return seq\r\nend",
"title": ""
},
{
"docid": "0c21347b9df4ec22a88bc2b29e1a422e",
"score": "0.7695317",
"text": "def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2] + obj[-1] }\nend",
"title": ""
},
{
"docid": "23ccbca4e62604e1c2cce3d17ed7596a",
"score": "0.7694684",
"text": "def fib_i(n)\n fin_fib = [0,1]\n until n == fin_fib.length\n fin_fib.push(fin_fib[-2] + fin_fib[-1])\n end\n fin_fib\nend",
"title": ""
},
{
"docid": "013a26449c8524b01cafd7d3e6f52645",
"score": "0.7693273",
"text": "def fib(num)\n fib_seq_arr = []\n\n (0..num).each do |number|\n fib_seq_arr << number if number <= 1\n fib_seq_arr << fib_seq_arr[-1] + fib_seq_arr[-2] if fib_seq_arr.length > 1\n end\n return fib_seq_arr\nend",
"title": ""
},
{
"docid": "6e495fe8561e752886660fe25430d92e",
"score": "0.76886487",
"text": "def fib(n)\n fib_0 = 0\n fib_1 = 1\n (0...n).each do \n temp = fib_0\n fib_0 = fib_1\n fib_1 = temp + fib_1\n end\n return fib_1\nend",
"title": ""
},
{
"docid": "1f571f1d7b6f647f15d2010e1097edf8",
"score": "0.7687236",
"text": "def fibs(n)\n result = []\n penultimate = 0\n last = 1\n ## skips iteration if n = 0\n 1.upto(n) do |num|\n if num == 1\n result << penultimate\n elsif num == 2\n result << last\n else\n next_num = penultimate + last\n penultimate = last\n last = next_num\n result << next_num\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "b9d6c0691f5ceab9f26ad2af18c177bc",
"score": "0.7685032",
"text": "def fib_seq(n)\n return \"#{n} isn't a positive integer number\" if n < 1\n\n fib_array = []\n\n n.times do |number|\n number > 1 ? fib_array.push(fib_array[number - 1] + fib_array[number - 2]) : fib_array.push(number)\n end\n\n fib_array\nend",
"title": ""
},
{
"docid": "a2a549d75bd6cfd4f0657c521bfbde11",
"score": "0.7684179",
"text": "def nthFibonacci(n)\r\n if n == 1\r\n return 1\r\n\r\n elsif n == 2\r\n return 1\r\n\r\n else n > 2\r\n n = nthFibonacci(n-1) + nthFibonacci(n-2)\r\n end\r\nend",
"title": ""
},
{
"docid": "ff691e4baca99346c3629eb36bfee9b1",
"score": "0.7683514",
"text": "def fibonacci(n)\n result = []\n i = 1\n while i <= n\n if i == 1 || i == 2\n result << 1\n else\n result << result[i - 3] + result[i - 2]\n end\n i += 1\n end\n result.last\nend",
"title": ""
},
{
"docid": "2d9188754e0058abd717e587ae04193f",
"score": "0.76808196",
"text": "def get_fibonacci_sequence(count)\n $i = 0\n # make sure we were passed in a number by converting it to an integer and then comparing the string value of the resulting\n # object to the original as to_i will output 0 if it can't convert to an integer\n # if it's not a number we'll raise an ArgumentError\n i_count = count.to_i\n if i_count.to_s != count || i_count < 0\n raise(ArgumentError, 'The requested number of items from the sequence must be a positive number.')\n end\n\n # create a new array to hold the calculated values and seed it with the first 2 numbers of the sequence to use in the calculations\n fib_sequence = Array.new\n fib_sequence.push 0\n fib_sequence.push 1\n $i+=2\n\n while $i <= i_count\n fib_sequence.push fib_sequence[-2] + fib_sequence[-1]\n $i+=1\n end\n # because we seed the array with the first 2 values of the sequence, we use slice to make sure we don't return too many items\n # in the case where they request 0 or 1 items\n fib_sequence.slice(0, i_count)\n end",
"title": ""
},
{
"docid": "f5033aa1ddaa25045572d930afd03969",
"score": "0.7677848",
"text": "def fibonacci number\n sequence = []\n a = 1\n b = 1\n while true\n sequence << b\n newa = b\n b = a+b\n a = newa\n break if b > number\n end\n sequence\nend",
"title": ""
},
{
"docid": "d6662819ec77abb64062b06cc2b7b971",
"score": "0.7676237",
"text": "def fibonacci(n)\n fib_array = [0,1]\n\tfib = n - 2\n fib.times do |fib|\n fib_array << fib_array[-1] + fib_array[-2]\n end\n\n\tif fib_array.count < 20\n \tp fib_array\n else\n \tp fib_array.last \n end\t\nend",
"title": ""
},
{
"docid": "19f41403e8fe6f4fe9922814f2dd5394",
"score": "0.76724976",
"text": "def fibonacci_numbers(num) #method takes one argument. The amount of fibonacci numbers you wish to generate.\r\n\tfib_arr = [0,1] #the fibonacci sequence begins with integers 0 and 1\r\n\t(num-2).times {fib_arr << fib_arr[-1] + fib_arr[-2]} #because the first two numbers are given we subtract 2 from the number of times we want to push numbers into our fib_arr.\r\n#we add the last two numbers in the sequence togther and push that to the fib_arr\r\n\treturn fib_arr #return array with new numbers\r\nend",
"title": ""
},
{
"docid": "41a94be27ee301eb5613100b99a52a71",
"score": "0.76710886",
"text": "def fibo(n)\n\n first = 0\n second = 1\n total = 0\n\n (1...n).each do\n total = first + second\n first = second\n second = total\n end\n return total\nend",
"title": ""
},
{
"docid": "7522d17c2d9c5a136b1af8009c143d49",
"score": "0.76683426",
"text": "def fibonacci(num)\n\tresult = [1]\n\tcurrent = 1\n\tuntil num == 1\n\t\tresult.push(current)\n\t\tcurrent += result[result.length-2]\n\t\tnum -= 1\n\tend\n\treturn result\nend",
"title": ""
},
{
"docid": "d931038b8d9b0a73c931c93949910e41",
"score": "0.7665556",
"text": "def iterative_fibinacci(num)\n\tfib_container = [1,1]\n\t(num-2).times { fib_container << fib_container[-2] + fib_container.last }\n\tfib_container\nend",
"title": ""
},
{
"docid": "2a134c42672b3e16b15de390c23513b4",
"score": "0.76615256",
"text": "def sim_fib(n)\n return '0' if n == 0\n return '01' if n == 1\n\n sim_fib(n - 1) + sim_fib(n - 2)\nend",
"title": ""
},
{
"docid": "8615bb3ff4c177ac46c17b615c50305d",
"score": "0.76603496",
"text": "def get_nth_fib(n)\n if n == 0 || n == 1\n return 0\n elsif n == 2\n return 1\n else\n return get_nth_fib(n-1) + get_nth_fib(n-2)\n end\n\nend",
"title": ""
},
{
"docid": "2c6896bbafa1c76f8e1502f59c4f545d",
"score": "0.7657386",
"text": "def fibonacci(n)\n return 1 if n <= 2\n num1, num2 = [1, 1]\n index = 2\n while n > index\n running_total = num1 + num2\n num1, num2 = num2, running_total\n n -= 1\n end\n running_total\nend",
"title": ""
},
{
"docid": "83bd8829336c7b2998ee779f4be5fd74",
"score": "0.7657383",
"text": "def fib(x)\n fib = [0,1]\n index_count = 0\n until index_count == x - 2\n fib << (fib[index_count] + fib[index_count + 1])\n index_count += 1\n end\n p fib\nend",
"title": ""
},
{
"docid": "1ed41a44df2030880fdba19e539e04f9",
"score": "0.76572466",
"text": "def find_fib_nth(n)\n if n == 0\n 1\n elsif n == 1\n 1\n else\n return (find_fib_nth(n - 2) + find_fib_nth(n - 1))\n end\nend",
"title": ""
}
] |
6a560efc10050a49d0f6929a8497bba4
|
Define a function to print the option list to the console
|
[
{
"docid": "e3f917969b7493ccce61e93e62e713f2",
"score": "0.7621106",
"text": "def printList(list)\n\tputs \"**** Options ****\"\n\t\tlist.each_with_index do |x, i|\n\t\t\tputs (i+1).to_s + \". \" + x\n\t\tend\n\tprint \"> \"\nend",
"title": ""
}
] |
[
{
"docid": "8b190e071e7da0f3a62b3bfc1df887df",
"score": "0.8002944",
"text": "def print_options; end",
"title": ""
},
{
"docid": "8d67069064a30e3b58f60e95cd37b3b4",
"score": "0.74881864",
"text": "def print_options\n puts \"1.Lattes sell for $4,\"\n puts \"2.Scones sell for $5,\"\n puts \"3.Tea sells for $3.\"\nend",
"title": ""
},
{
"docid": "aedbb324bf0c59ad65354c2f6605621a",
"score": "0.7467395",
"text": "def print\n %w[option term value].each do |condition|\n puts \"#{condition}: #{self[condition]}\"\n end\n end",
"title": ""
},
{
"docid": "b0009151d8fb49534778f74ba53e3649",
"score": "0.7436332",
"text": "def print_config(optionlist)\n\tconfig_lines(optionlist) { | line | $stdout.print line }\n end",
"title": ""
},
{
"docid": "714e17ea49ec4a55f3c0b18f33d51e61",
"score": "0.73407406",
"text": "def print_options_menu(question_lambda, options)\n print_question(question_lambda)\n print_options(options)\n end",
"title": ""
},
{
"docid": "88c071882b4ebe1d8692a8bd05138ab5",
"score": "0.7237484",
"text": "def display_options(state = $state)\n puts \"[\"\n options = fetch_options state\n options.each_index do |i|\n puts \" [#{i}] #{options[i]}\"\n end\n puts \"]\"\nend",
"title": ""
},
{
"docid": "199bb0de8a1061ba60065f42656f7d04",
"score": "0.71854144",
"text": "def display_options(options = @masteroptions_txt)\n options.each_with_index do |option_text, idx|\n puts \"#{idx}: #{option_text}\"\n end\n end",
"title": ""
},
{
"docid": "4a904858d2a5babdd8809d6454c55a11",
"score": "0.7167257",
"text": "def print(*opts); end",
"title": ""
},
{
"docid": "4a904858d2a5babdd8809d6454c55a11",
"score": "0.7167257",
"text": "def print(*opts); end",
"title": ""
},
{
"docid": "f6c32ecd9d4201523dee5eb43617f3f5",
"score": "0.7133809",
"text": "def print_options(shell, options, group_name = nil)\n return if options.empty?\n\n list = []\n padding = options.map { |o| o.aliases.size }.max.to_i * 4\n\n options.each do |option|\n next if option.hide\n item = [option.usage(padding)]\n item.push(option.description ? \"# #{option.description}\" : \"\")\n\n list << item\n list << [\"\", \"# Default: #{option.default}\"] if option.show_default?\n list << [\"\", \"# Possible values: #{option.enum.join(', ')}\"] if option.enum\n end\n\n shell.say(group_name ? \"#{group_name} options:\" : \"Options:\")\n shell.print_table(list, :indent => 2)\n shell.say \"\"\n end",
"title": ""
},
{
"docid": "889e62680f53dafe30458a3b410be65b",
"score": "0.71279544",
"text": "def list_options\r\n puts \"What statistics are you interested in?\"\r\n puts \"1. See a list of states with statistics.\"\r\n puts \"2. See statistics by state individually.\"\r\n puts \"3. Total Covid Cases by state.\"\r\n puts \"4. Total Covid Deaths by state.\"\r\n puts \"5. Total Covid Recoveries by state.\"\r\n puts \"6. Exit program.\"\r\n end",
"title": ""
},
{
"docid": "3b96404b0d069a1bec5d92cee575ab6a",
"score": "0.7124171",
"text": "def list_options\n puts \"\"\n puts \"I've created a new shelter for you. Enter the NUMBER from the list of actions below:\"\n puts \"\"\n puts \"1. Create an animal\"\n puts \"2. Create a client\"\n puts \"3. Display all animals\"\n puts \"4. Display all clients\"\n puts \"5. Quit\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "99a04be14e45af04a82c02c558606553",
"score": "0.7121543",
"text": "def show(new_options = nil)\n @options = new_options if new_options\n \n puts \"\\t\\t\\t--#{options[0]}--|--#{options[1]}--|--#{options[2]}--\"\n puts \"\\t\\t\\t--#{options[3]}--|--#{options[4]}--|--#{options[5]}--\"\n puts \"\\t\\t\\t--#{options[6]}--|--#{options[7]}--|--#{options[8]}--\"\n end",
"title": ""
},
{
"docid": "2179d5735b32e2c59716e8051bfca8a9",
"score": "0.70973",
"text": "def print_options(shell, options, group_name = nil)\n return if options.empty?\n\n list = []\n padding = options.map { |o| o.aliases.size }.max.to_i * 4\n\n options.each do |option|\n next if option.hide\n item = [option.usage(padding)]\n item.push(option.description ? \"# #{option.description}\" : \"\")\n\n list << item\n list << [\"\", \"# Default: #{option.default}\"] if option.show_default?\n if option.enum\n list << [\"\", \"# Possible values: #{option.enum.join(', ')}\"]\n end\n end\n\n shell.say(group_name ? \"#{group_name} options:\" : \"Options:\")\n shell.print_table(list, :indent => 2)\n shell.say \"\"\n end",
"title": ""
},
{
"docid": "d1c722190b66694fd59ff8adedae7291",
"score": "0.7027047",
"text": "def list_options\n puts \"Please enter one of the followings:\"\n puts \"====================================\"\n puts \"list users\"\n puts \"list channels\"\n puts \"select channel\"\n puts \"select user\"\n puts \"details\"\n puts \"send message\"\n puts \"fun message\"\n puts \"channel historys\"\n puts \"quit\"\n puts \"====================================\"\nend",
"title": ""
},
{
"docid": "c0d66a214b90ec8373e178b831ca76ae",
"score": "0.70215493",
"text": "def display_options\n puts \"Options available...\"\n puts \" a: add entry\"\n puts \" c: change safe password\"\n puts \" del: delete entry\"\n puts \" dump: dump all entries to plaintext file\"\n puts \" g: get an entry or entries that match a partial string\"\n puts \" h: help (show this screen)\"\n puts \" l: list all entries\"\n puts \" q: quit\"\n puts \" s: size (total number entries)\"\n puts \" u: update entry\"\n print \"Enter option: \"\nend",
"title": ""
},
{
"docid": "56e831708a5f4471dc7b55a06c87e18a",
"score": "0.7007895",
"text": "def run_options\n options.map { |k,_v| run_option(k) }.compact.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "05f4770b085b8f23d8c8701211c814bd",
"score": "0.69936144",
"text": "def print_options\n return unless self[:verbose]\n\n Helper.log.info \"Using these options:\"\n # For ruby 2.5.0+\n censored_values.each do |key, value|\n print(key.inspect, \"=>\", value.inspect)\n puts \"\"\n end\n puts \"\"\n end",
"title": ""
},
{
"docid": "514b356f68dc8beb932e9c625da726f6",
"score": "0.6991491",
"text": "def show_options(opts)\n puts(opts)\n exit!(false)\n end",
"title": ""
},
{
"docid": "514b356f68dc8beb932e9c625da726f6",
"score": "0.6991491",
"text": "def show_options(opts)\n puts(opts)\n exit!(false)\n end",
"title": ""
},
{
"docid": "32dabd07f9816d8d132706912dbce944",
"score": "0.6991274",
"text": "def list_options\n puts \"\"\n puts \"Enter the NUMBER from the list of actions below:\"\n puts \"\"\n puts \"1. List all apartments\"\n puts \"2. View an apartment's details\"\n puts \"3. Add an apartment\"\n puts \"4. Add a tenant to an apartment\"\n puts \"5. Quit\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "c8007c06689f94e3becf882defc1e059",
"score": "0.697578",
"text": "def list_options\n puts \"\"\n puts \"Enter the NUMBER from the list of actions below:\"\n puts \"\"\n puts \"1. List all shelters\"\n puts \"2. View shelters details\"\n puts \"3. Add an animal to a client\"\n puts \"4. Add an animal to the shelter\"\n puts \"5. Quit\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "d7224e57752d04d69f5d737d1e369331",
"score": "0.6965782",
"text": "def show_display\n puts '==================================='\n puts 'What would you like to do? Options:\n - Add\n - Update \n - Delete \n - Show list'\n puts '==================================='\nend",
"title": ""
},
{
"docid": "b854e449ae4094114a3291a7e3c901ea",
"score": "0.6932174",
"text": "def list_options\n puts <<-DOC.gsub /^\\s*/, ''\n\n 1. Local AQI Information\n 2. Top 5 Nationwide AQI Rankings\n 3. General AQI Information\n 4. View Previously Searched Cities\n\n DOC\n end",
"title": ""
},
{
"docid": "6d48842b6229087c5e74aaa578ab31da",
"score": "0.692145",
"text": "def msg_list_options(opts)\n # FIXME: use a fold, and write an rspec test\n msg = \"\"\n\n opts.each do |o|\n msg += \"\\n #{o}\"\n end\n\n msg\n end",
"title": ""
},
{
"docid": "9463613b61ace794527aed69f7c5ded2",
"score": "0.6911818",
"text": "def print_options(shell, options, group_name = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "89928fea7861fd90ec3a2d22915569d1",
"score": "0.6904992",
"text": "def print_choices\n puts 'Input selection from below: '\n choices = [\n '1 - View all existing databases',\n '2 - Delete Database',\n '3 - Get keys from database',\n '4 - Lookup Value',\n '5 - Exit'\n ]\n choices.each do |f|\n puts f\n end\nend",
"title": ""
},
{
"docid": "5031153c446fe37ac6cbf12d7dab6c74",
"score": "0.6881734",
"text": "def printOptions(options)\n count = 0\n options.each do |e|\n print \"#{count += 1}.-#{e} :\\n\"\n end\n end",
"title": ""
},
{
"docid": "57bde82d0451332dbd67f6f84462863c",
"score": "0.68772024",
"text": "def display_options\n @show.each_with_index do |option, index|\n puts \"#{index+1}. #{option}\"\n end\n end",
"title": ""
},
{
"docid": "eba43499e3f03729deac2e5b6f8c65e3",
"score": "0.6849762",
"text": "def options_list(matches)\n counter = 1\n puts\n matches.each do |match|\n printf(\"%<counter>2d ) %<option>s\\n\", counter: counter, option: match)\n counter += 1\n end\n puts\n end",
"title": ""
},
{
"docid": "2ab0faff2ccef2eea3d7968fe02deef0",
"score": "0.6810692",
"text": "def print_directory_options\n puts \"\\nSelect which (sub)set of students you'd like to see:\"\n puts \"--ALL -> display all students.\"\n puts \"--LETTER -> display only students whose first name begins with a specific letter\"\n puts \"--LENGTH -> display only students whose names are less than a set length\"\n puts \"--COHORT -> display only students of the selected cohort\"\n puts \"--ALL BY COHORT -> display all students ordered by cohort\"\n\n # Return the user filter setting via the print_options variable\n print_options = gets_break\nend",
"title": ""
},
{
"docid": "52ab7ec3eecdedc2b8b28d32d5c14ea6",
"score": "0.68098617",
"text": "def list_menu_options(array)\n array.each do |x|\n puts x\n end\nend",
"title": ""
},
{
"docid": "18b12eef67014f29fd6130855a5b21c9",
"score": "0.676886",
"text": "def dump_options\n self.class.public_instance_methods(false).each do |command|\n if command =~ /^[\\w\\d_]+$/\n puts \"--#{command.to_s.gsub('_', '-')}\"\n end\n end\n # TODO: list available options, too.\n end",
"title": ""
},
{
"docid": "8af248a20e282cab16301bf5fb995645",
"score": "0.67506206",
"text": "def options(options)\n # Do nothing if there's nothing to do.\n return if options.nil? || !options.size\n\n # If the option is a hash, run it through option_line. Otherwise\n # just print it out as is.\n options.each do |name, option|\n if !option.nil? && option.respond_to?(:to_h)\n option_line(option.to_h)\n else\n puts name\n end\n end\n end",
"title": ""
},
{
"docid": "fc49d4f3e0dc800afd19af66291bb5d5",
"score": "0.67496765",
"text": "def inspect_options(verbose = nil)\n desc = []\n # Find the longest option argument string\n my_job_options = @job_options\n my_job_options.delete(:compiler)\n all_arguments = @user_options.values + my_job_options.values + @compiler_options.values + @compiler_options_with_args.values\n min_argument_padding = 'Argument'.length + 2\n argument_padding = all_arguments.max_by { |e| e.to_s.length }.to_s.length + 3\n argument_padding = min_argument_padding if argument_padding < min_argument_padding\n puts \"\\n\"\n header = '| Option ' + '| Argument'.ljust(argument_padding) + '| Required |'\n desc << header\n desc << '-' * header.length\n [@user_options, my_job_options, @compiler_options, @compiler_options_with_args].each do |opt|\n opt.each_pair do |k, v|\n if k.match(/pinmap_workbook|path|id|directory|clean|location|recursive/i)\n req = 'true '\n else\n next if v.nil? || v == false\n req = 'false'\n end\n desc << \"| #{k}\".ljust(22) + \"| #{v}\".ljust(argument_padding) + \"| #{req} |\"\n end\n end\n puts desc\n end",
"title": ""
},
{
"docid": "fc49d4f3e0dc800afd19af66291bb5d5",
"score": "0.67496765",
"text": "def inspect_options(verbose = nil)\n desc = []\n # Find the longest option argument string\n my_job_options = @job_options\n my_job_options.delete(:compiler)\n all_arguments = @user_options.values + my_job_options.values + @compiler_options.values + @compiler_options_with_args.values\n min_argument_padding = 'Argument'.length + 2\n argument_padding = all_arguments.max_by { |e| e.to_s.length }.to_s.length + 3\n argument_padding = min_argument_padding if argument_padding < min_argument_padding\n puts \"\\n\"\n header = '| Option ' + '| Argument'.ljust(argument_padding) + '| Required |'\n desc << header\n desc << '-' * header.length\n [@user_options, my_job_options, @compiler_options, @compiler_options_with_args].each do |opt|\n opt.each_pair do |k, v|\n if k.match(/pinmap_workbook|path|id|directory|clean|location|recursive/i)\n req = 'true '\n else\n next if v.nil? || v == false\n req = 'false'\n end\n desc << \"| #{k}\".ljust(22) + \"| #{v}\".ljust(argument_padding) + \"| #{req} |\"\n end\n end\n puts desc\n end",
"title": ""
},
{
"docid": "c425810e72b402974c2b0061806debae",
"score": "0.67087334",
"text": "def print_adoption_list()\n puts \"\\n\"\n puts \"Available for adoption:\"\n animals.each {|animal| puts animal.name if animal.available_to_adopt == true}\n clients.each {|client| client.animals.each {|animal|\n puts animal.name if animal.available_to_adopt == true}}\n end",
"title": ""
},
{
"docid": "277d504adc12aacb3ef21ec2994d2bdd",
"score": "0.6687849",
"text": "def print_list; end",
"title": ""
},
{
"docid": "fb8c8b617a4479c47136e671e0e4a3cd",
"score": "0.66786265",
"text": "def choose(list, print: true)\n raise \"List is empty.\" if list.empty?\n\n if @options[:auto]\n line = 0\n else\n # Never print when --auto.\n if print\n list.each_with_index { |l, i| puts \"#{i}\\t#{l}\" }\n printf \"[0 - #{options.length - 1}]: \"\n end\n line = STDIN.gets.chomp || 0\n end\n\n meta = \"list[#{line}]\"\n mout = eval meta\n mout = mout.join \" \" if mout.is_a? (Array)\n mout\n end",
"title": ""
},
{
"docid": "9c37fd601056fc4d8843b9dc94b639db",
"score": "0.6593796",
"text": "def list_options(opts)\n opts.separator ''\n opts.separator 'List options:'\n\n opts.on('--all', 'Show all objects in the output') do\n @show_all = true\n end\n\n opts.on('--only-namespaces',\n 'Only show namespaces (classes, modules)') do\n @namespaces = :only\n end\n opts.on('--no-namespaces',\n 'Only show namespace children (methods, constants, ' \\\n 'attributes)') do\n @namespaces = :none\n end\n\n opts.on('--no-public', 'Do not show public objects') do\n set_visibility :public, false\n end\n opts.on('--no-protected', 'Do not show protected objects') do\n set_visibility :protected, false\n end\n opts.on('--private', 'Show private objects') do\n set_visibility :private, true\n end\n\n opts.on('--only-undocumented', 'Only show undocumented objects') do\n @undocumented = :only\n end\n opts.on('--no-undocumented', 'Only show documented objects') do\n @undocumented = :none\n end\n\n opts.on('--depth [DEPTH]',\n 'Only show objects up to a given DEPTH ' \\\n 'in the class tree') do |depth|\n @depth = depth.to_i\n end\n end",
"title": ""
},
{
"docid": "8a35d1014523bd63275da1c284f01192",
"score": "0.6587967",
"text": "def printn(*opts); end",
"title": ""
},
{
"docid": "8a35d1014523bd63275da1c284f01192",
"score": "0.6587967",
"text": "def printn(*opts); end",
"title": ""
},
{
"docid": "8a35d1014523bd63275da1c284f01192",
"score": "0.6587967",
"text": "def printn(*opts); end",
"title": ""
},
{
"docid": "8a35d1014523bd63275da1c284f01192",
"score": "0.6587967",
"text": "def printn(*opts); end",
"title": ""
},
{
"docid": "0c90ac104f5fc410e7a2932f08da4fd4",
"score": "0.65842134",
"text": "def list_options \r\n puts <<-DOC.gsub /^\\s*/, ''\r\n 1. List all states to get individual statistics\r\n 2. Top ten states with the most confirmed cases\r\n 3. Top ten states with the least confirmed cases \r\n 4. Top ten States with the most confirmed deaths \r\n 5. Top Ten States with the least confirmed deaths \r\n 6. List from most to least confirmed cases by region \r\n 7. List from most to least confirmed deaths by region\r\n 8. Overall U.S.A Statistics\r\n 9. Enter State Name\r\n Please enter 'exit' to stop program.\r\n DOC\r\n end",
"title": ""
},
{
"docid": "76c33da69a2f9fbb8cb7f56d3d2b4086",
"score": "0.6579846",
"text": "def main_options\n puts \"Main menu:\"\n puts \"To list all civilizations, type 'civs'.\"\n puts \"To list all units, type 'units'.\"\n puts \"To list all structures, type 'strucs'.\"\n puts \"To list all technologies, type 'techs'.\"\n end",
"title": ""
},
{
"docid": "e7d70507d52a5030e4309209ca041bb6",
"score": "0.6563203",
"text": "def display_choices\n puts <<-END\n What do you want to do?\n Options: #{yield}\n END\n end",
"title": ""
},
{
"docid": "bb5c7368fdfc7b41994adf7718951b64",
"score": "0.6542102",
"text": "def display\n options = [\n '********Welcome to BikeInfo********',\n '1. Add Bike',\n '2. Compare Bikes',\n '3. Change Bike Details',\n '4. List Bikes',\n '5. Find Bike with Max Milege',\n '6. Find Bike with Max Top Speed',\n '7. Quit',\n '***********************************'\n ]\n puts options.join(\"\\n\")\n puts 'Enter Your choice'\nend",
"title": ""
},
{
"docid": "5adfd8bf9a4be4198344cf8ef5982f94",
"score": "0.6527457",
"text": "def show_options(opts)\n puts opts\n\n at_exit { exit! }\n exit\n end",
"title": ""
},
{
"docid": "be2db6f91b5689734b436cf5d1eb6544",
"score": "0.6523247",
"text": "def print_options\n puts \"\\nGeneral options (not all options are valid for all tasks):\"\n puts \"files=<pattern> - Files for the task (a pattern to match the files)\"\n puts \"talia_root=<path> - Manually configure the TALIA_ROOT path\"\n puts \" (default:autodetect)\"\n puts \"reset_rdf={yes|no} - Flush the RDF store (default:no)\"\n puts \"reset_db={yes|no} - Flush the database (default:no)\"\n puts \"config=<filename> - Talia configuration file (default: talia_core)\"\n puts \"environment=<env> - Environment for configuration (default: development)\"\n puts \"data_dir=<dir> - Directory for the data files\"\n puts \"verbose={yes|no} - Show some additional info\"\n puts \"\"\n end",
"title": ""
},
{
"docid": "68c58fe1742d6d1c1541dcc81dc4c150",
"score": "0.65152943",
"text": "def tail()\n \"Available options:\"\n end",
"title": ""
},
{
"docid": "f17b7d6431a1f5fb646dd1593dd4f1cf",
"score": "0.6512375",
"text": "def option_menu\n puts \"CHOOSE OPTION \\n\"\n puts \"View Reading List? (type 'list')\\n\"\n puts \"New Search? (type 'new')\\n\"\n puts \"Exit program? (type 'exit')\\n\"\n end",
"title": ""
},
{
"docid": "c5889e24975ce8199f003e0c74fa2fc4",
"score": "0.64991546",
"text": "def print(*options)\n stdoutput.print(*options)\n end",
"title": ""
},
{
"docid": "c188d9cbf02b52c0ab4f9654353c2de8",
"score": "0.64961714",
"text": "def print_parameters(options)\n puts \"\\nRunning with parameters:\".bold\n options.each { |k, v| puts \"\\t#{k}: #{v}\".yellow }\n puts ''\n end",
"title": ""
},
{
"docid": "2342620cdab61df66797f0b57f2c8957",
"score": "0.6469999",
"text": "def option_list(name, options)\n options.map { |option| option(name, option) }.join(' ') if name && options\n end",
"title": ""
},
{
"docid": "6fa8badd7e995cc69a764b3d97d53d4b",
"score": "0.6468142",
"text": "def define_print_flag\n @options.on(\"-p\", \"--print\", \"Print the merged configuration.\") do |name_or_path|\n puts(@configuration.to_yaml)\n end\n end",
"title": ""
},
{
"docid": "a0657dadf0ee6c3876e6b5a107f9516a",
"score": "0.64275604",
"text": "def print_program(list)\n puts \"Here is your list\"\n puts\n list.each { |x| puts x }\n puts\n puts \"start, print, finish, or help for help\"\nend",
"title": ""
},
{
"docid": "582b310548be58f7e0382e4044718dc0",
"score": "0.6421773",
"text": "def show_check_options(options, checkboxes)\r\n\tpara \"\\n\"\r\n\tfor i in 0..options.length - 1\r\n\t\tcheckboxes[i] = check()\r\n\t\tpara \"#{options[i]} \\n\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "45ca383bc0741ed8dbc35e05d29d4b8b",
"score": "0.6396648",
"text": "def list_options\r\n puts <<~MAINMENU\r\n\r\n Select from the following options!\r\n\r\n 1. Enter your team\r\n 2. List of teams\r\n 3. About the NBA\r\n 4. Credits\r\n 5. Exit\r\n\r\n\r\n MAINMENU\r\n menu_input\r\n end",
"title": ""
},
{
"docid": "34026be41a5bf143dd529261a3464bf3",
"score": "0.6390329",
"text": "def list(options = {}, &proc)\r\n write('<ol>', &proc)\r\n proc.call\r\n write('</ol>', &proc)\r\n end",
"title": ""
},
{
"docid": "22d3c66d582255107956b360cde9893f",
"score": "0.6390228",
"text": "def display_board(options)\n puts \" #{options[0]} | #{options[1]} | #{options[2]} \"\n puts \"-----------\"\n puts \" #{options[3]} | #{options[4]} | #{options[5]} \"\n puts \"-----------\"\n puts \" #{options[6]} | #{options[7]} | #{options[8]} \"\nend",
"title": ""
},
{
"docid": "642d92978224cd1a0d554abb8246f630",
"score": "0.6355917",
"text": "def list_display_options\n puts \"Please enter the corresponding number of your desired data type:\"\n puts <<-DOC.gsub /^\\s*/, ''\n -----------------\n 1. Intraday\n 2. Daily\n 3. Daily Adjusted\n -----------------\n DOC\n puts \"You may enter 'main' to access the main menu and 'exit' at any time to exit the program.\"\n menu\n end",
"title": ""
},
{
"docid": "7c7038cd1281dbbac8c7ddf79e4c3815",
"score": "0.6332689",
"text": "def show_menu_options\n puts \"What would you like to do?\\n1. Show a random report\\n2. Show 3 most recent reports\\n3. Show 3 highest rated reports\\nType 'exit' to exit the program\"\n end",
"title": ""
},
{
"docid": "0b043f07938ffbac7ad6cb383427dd56",
"score": "0.6290649",
"text": "def text_options\n option_list.each do |opt|\n if @options.key?(opt.name)\n opt.description = @options[opt.name]\n end\n end \n\n max = option_list.map{ |opt| opt.usage.size }.max + 2\n\n s = []\n s << \"OPTIONS\"\n option_list.each do |opt|\n mark = (opt.name.size == 1 ? ' -' : '--')\n s << \" #{mark}%-#{max}s %s\" % [opt.usage, opt.description]\n end\n s.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "b0ffa4480cc3a8b6bf92f99d71fef5d7",
"score": "0.6272289",
"text": "def execute\n @env.peek.each do |option|\n print \"#{option} \"\n end\n nil\n end",
"title": ""
},
{
"docid": "495419ea568ab1c50e1d8023645231e6",
"score": "0.6267492",
"text": "def options() end",
"title": ""
},
{
"docid": "65d346904da411cc39f2389302b203a2",
"score": "0.62658775",
"text": "def print_menu\n prompt = TTY::Prompt.new\n prompt.enum_select(\"Welcome to the Marvel Superhero CLI!\\n What Superhero do you want to know about? Here's a list!\\n Enter a number from the list to see more info about that character \\n\\n\", Superhero.choices, per_page: 20)\n end",
"title": ""
},
{
"docid": "d87358ce300586cf7655c8ea17f30fc6",
"score": "0.62649876",
"text": "def print_help\n ['new', 'Create a new log entry',\n 'outcsv', 'Export everything to CSV',\n 'help', 'print this dialog',\n 'end', 'Exit the progam',\n 'delete', 'Remove the issue with a given id',\n 'archive', 'Archive a file into a specific issue',\n 'invoices', 'Go to invoices interface',\n 'templates', 'Go to template interface, and set templates',\n 'git', 'Go git interface for setting git options',\n 'focus', 'Focus on a particular ',\n 'show', 'List all the issues',\n 'help', 'Show this information',\n 'search', 'Search for a specific text',\n 'config', 'Set differeing configuration parameters'\n ].each_with_index do |el,ix|\n print ' ' if 1 == ix % 2\n puts el\n end\n end",
"title": ""
},
{
"docid": "4136d85a979a4218c20aaa73b467062b",
"score": "0.62474555",
"text": "def options_menu\r\n puts \"1: Catalogue\"\r\n puts \"2: Checkout\"\r\n puts \"3: View Cart\"\r\n puts \"4: Remove item from cart\"\r\n #\r\n # puts \"\\n4: Add Products\"\r\n puts \"-\" * 10 + \"\\n> \"\r\n end",
"title": ""
},
{
"docid": "286e945d0ee88fbd1d729868808466a0",
"score": "0.62467104",
"text": "def display_string\n long_str = \"\"\n @options.each_with_index do |option, index|\n if option == @default_option\n long_str << option.as_default\n else\n long_str << option.as_non_default\n end\n long_str << \"/\" if index < (@options.size-1)\n end\n \"#{@prompt} [#{long_str}] \"\n end",
"title": ""
},
{
"docid": "0feb853462274543f4138986ffaa75b8",
"score": "0.62443143",
"text": "def _print\n return printPair(@commandMap[\"listName\"], @listMap[@commandMap[\"listName\"]])\n end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6243611",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6243611",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6243611",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "c5b30b4ef26007f28ae85c6779598bce",
"score": "0.62370074",
"text": "def show_options\n puts \"What would you like to do?\"\n yield\n puts \"Enter the letter corresponding with your choice.\"\nend",
"title": ""
},
{
"docid": "979b3036baeb814d8bba48aa36a96665",
"score": "0.623381",
"text": "def collect_lint\n @options.map { |opt| \"#{ opt.first }: #{ opt.last }\" }.join(\", \")\n end",
"title": ""
},
{
"docid": "fb812ea343eb28eda0668474b9223165",
"score": "0.62308735",
"text": "def print_config_options\n env = value(:environment)\n val = value(:configprint)\n if val == \"all\"\n hash = {}\n each do |name, obj|\n val = value(name,env)\n val = val.inspect if val == \"\"\n hash[name] = val\n end\n hash.sort { |a,b| a[0].to_s <=> b[0].to_s }.each do |name, val|\n puts \"#{name} = #{val}\"\n end\n else\n val.split(/\\s*,\\s*/).sort.each do |v|\n if include?(v)\n #if there is only one value, just print it for back compatibility\n if v == val\n puts value(val,env)\n break\n end\n puts \"#{v} = #{value(v,env)}\"\n else\n puts \"invalid parameter: #{v}\"\n return false\n end\n end\n end\n true\n end",
"title": ""
},
{
"docid": "0c3503da4b3fff4dacfddac40a8e99d0",
"score": "0.6226277",
"text": "def main_options(menu)\n print \"---------------------------------------------------------------\n \\nMain menu options:\\n\n 1: Branches\n 2: Staff Members\n 3: Books\n 4: Patrons\n exit: Exit\\n\\nWhat would you like to do? \"\nend",
"title": ""
},
{
"docid": "c441eb9857b223e9c67f1c375618425c",
"score": "0.6222189",
"text": "def print_list(list, index) \n system 'clear'\n list.each do |option| # Loop through each item in the list array\n puts \"#{index}. #{option.name}\"\n index += 1\n end\nend",
"title": ""
},
{
"docid": "cbaa84d37f6cc8091d9d6d15159ab81a",
"score": "0.62153226",
"text": "def options\n puts \"1.Hit\"\n puts \"2.Stand\"\n puts \"3.Double Down\" if self.can_double_down?\n puts \"4.Split\" if self.can_split?\n end",
"title": ""
},
{
"docid": "eee14184748eab860ce28ea91caa3b2a",
"score": "0.61838746",
"text": "def print_list(list)\n\tputs list\nend",
"title": ""
},
{
"docid": "9c5caa4a60f275195c79f0b69f461d44",
"score": "0.61821806",
"text": "def extracted_options(*names, **options)\n puts \"#{names} / #{options}\"\nend",
"title": ""
},
{
"docid": "7e5e586abd8b4ad4500d383154d29b98",
"score": "0.6178935",
"text": "def menu_with_options(options)\n columns = `tput cols`.to_i # num terminal cols (gotta be from Stack Overflow)\n output = []\n current_line = \"\"\n options.each_with_index do |option, i| # looks like Python's enumerate(list)\n option = option.sub(ENV[\"HOME\"], \"~\") # ENV[\"HOME\"] is the terminal's $HOME variable (viz. /Users/Ethan)\n option_text = \"#{i + 1}.#{colorize_blue(option)}\" # print the option number, and the option-in-blue\n\n # if the new option's text will fit on the current line, add it;\n # otw save the current line (by appending it to a list),\n # and create a new line with this text in it\n if current_line.size + (option.size + i.to_s.size) >= columns - 1\n output.push(current_line)\n current_line = option_text\n else\n current_line += (current_line.empty? ? \"#{option_text}\" : \" #{option_text}\") # diff spacing for 1st item\n end\n end\n output.push(current_line) # out of options, save running text\n output.join(\"\\n\") + \" \" # turn array into string\nend",
"title": ""
},
{
"docid": "61d73413b7ff0626627eb4ad2cd6982b",
"score": "0.61755943",
"text": "def print_list(list, index) \r\n system 'clear'\r\n list.each do |option| # Loop through each item in the list array\r\n puts \"#{index}. #{option.name}\"\r\n index += 1\r\n end\r\nend",
"title": ""
},
{
"docid": "583c4e4764e9b9941a178dc7389b0f13",
"score": "0.61755174",
"text": "def display_messages(options)\n if @use_options\n options.each_with_index do |option, index|\n puts \"#{index + 1}: #{option}\"\n end\n else\n puts options\n end\n\n if(@use_back) then\n puts \" (enter b to go back to previous menu)\".yellow\n end\n\n if(@use_main_menu) then\n puts \" (enter m to go to the main menu)\".yellow\n end\n\n puts \" (enter q to quit)\".red\n end",
"title": ""
},
{
"docid": "3df3733cf1a404a3f8c45e19aa39b490",
"score": "0.6173768",
"text": "def option_prompt\n \"\\nOptions:\\n\\t1. Timekeeping\\n\\t2. List Tasks\\n\\t3. Exit\\n\"\n end",
"title": ""
},
{
"docid": "3f818e4b55aff14f950b60d82f4308cc",
"score": "0.6170754",
"text": "def listCommands()\n puts(\"q - quit\")\n puts(\"h - help\")\n puts(\"f - feed\")\n puts(\"p - play\")\n puts(\"\")\nend",
"title": ""
},
{
"docid": "b6cf7e4f0e1ca0928b1789e83c36fe90",
"score": "0.61698157",
"text": "def main_sub_menu_options(sub_menu_name)\n print \"---------------------------------------------------------------\n \\n#{sub_menu_name.capitalize} menu options:\\n\n 1: List all #{sub_menu_name.pluralize}\n 2: New #{sub_menu_name}\n exit: Exit to Main menu\\n\\nWhat would you like to do? \"\nend",
"title": ""
},
{
"docid": "cb77a271795b1a4afe5d5f2e4f5e0500",
"score": "0.61687297",
"text": "def helper\n \"Display all available options on the selected analysis module.\"\n end",
"title": ""
},
{
"docid": "40cc92b320542ce09626a0f4b3a3884e",
"score": "0.6167647",
"text": "def print_list\n print_title\n print_items\n puts\n end",
"title": ""
},
{
"docid": "a570bb573d72148f9e4627bcc91b8ff1",
"score": "0.61624587",
"text": "def options_text\n options\n end",
"title": ""
},
{
"docid": "9699d8e15ef67d6221ae05b203e52ee7",
"score": "0.61572707",
"text": "def print_help()\r\n puts \"Use one or more of the following options:\"\r\n puts \" showall: Show units even if not affected by any syndrome\"\r\n puts \" showeffects: shows detailed effects of each syndrome\"\r\n puts \" showdisplayeffects: show effects that only change the look of the unit\"\r\n puts \" ignorehiddencurse: Hides syndomes the user should not be able to know about (TODO)\"\r\n puts \" selected: Show selected unit\"\r\n puts \" dwarves: Show dwarves\"\r\n puts \" livestock: Show livestock\"\r\n puts \" wildanimals: Show wild animals\"\r\n puts \" hostile: Show hostiles (e.g. invaders, thieves, forgeten beasts etc)\"\r\n puts \" world: Show all defined syndromes in the world\"\r\n puts \" export:<filename> Write the output to a file instead of the console.\"\r\n puts \"\"\r\n puts \"Will show all syndromes affecting each units with the maximum and present duration.\"\r\nend",
"title": ""
},
{
"docid": "bcf9b22af8a56e19a4412ce662168325",
"score": "0.6157178",
"text": "def show_options(options)\n # Setting iterator to start at 0\n i = 1\n # Showing option words\n options.each do |option|\n if options.index(option).even?\n puts \"#{i}. #{option}\"\n i += 1\n end\n end\nend",
"title": ""
},
{
"docid": "8a8ab1816b3edca6a6fd38d3b02493b1",
"score": "0.6154661",
"text": "def get_selection_options(dwarf_planets)\n return \"\\nPLANETS#{dwarf_planets.list_planets}\n #{dwarf_planets.number_of_planets + 1}. ADD\n #{dwarf_planets.number_of_planets + 2}. EXIT\\n\"\nend",
"title": ""
},
{
"docid": "1d668d7c7e97cb9d978b89faf0e041ab",
"score": "0.614862",
"text": "def main_menu_options\n puts \"Type werk, to see a list of Queens!\"\n puts \"Type bye, to make a dramatic exit\"\n puts \"Type win, to see just the winning gals\"\n main_menu\n end",
"title": ""
},
{
"docid": "b82d7272ce3c7903340ad22cf0fa3c37",
"score": "0.614794",
"text": "def print_help()\n puts self.desc\n puts \"Parameters:\"\n self.conf.each { |y|\n print \"#{y[:name]}\"\n print \" (#{BlackStack::SimpleCommandLineParser.type_name(y[:type])}. optional)\" if !y[:mandatory]\n print \" (#{BlackStack::SimpleCommandLineParser.type_name(y[:type])})\" if !y[:mandatory]\n print \": \"\n print y[:description]\n puts \"\"\n puts \"\"\n }\n end",
"title": ""
},
{
"docid": "9080d5a14d4514c59b5616aaa6b72b26",
"score": "0.614508",
"text": "def show_possibilities possibilities\n puts \"Possibilities:\\n\"\n possibilities.each_with_index do |possibility, index|\n puts \"#{index + 1}) #{possibility}\"\n end\n end",
"title": ""
},
{
"docid": "b583facc035aad22d5821bd1e52fe71f",
"score": "0.614019",
"text": "def display_options(options_hash)\n # Guard Clause: Check if no product options are available\n if options_hash.empty?\n message = 'No options available for specified Product Type / Option(s)'\n puts message\n return message\n end\n\n options_hash.each do |key, value|\n # Guard Clause: Check if set value is empty\n puts \"#{key.capitalize}: #{value.to_a.join(', ')}\" unless value.empty?\n end\n end",
"title": ""
},
{
"docid": "d076e8b3ad15c24e03748af87c1dda45",
"score": "0.61339307",
"text": "def all(options = {})\n puts \"-\" * @title.length\n puts @title.colorize(:color => :white, :background => :cyan)\n puts \"-\" * @title.length\n print_items = options.empty? ? @items : options\n print_items.each_with_index do |item, position|\n puts \"#{position + 1}) #{item.details}\"\n end\n end",
"title": ""
},
{
"docid": "a12b6af837734d4849c2125ed66667bd",
"score": "0.61327",
"text": "def tire_options(list)\n result = '' \n list.each do |option|\n \n end\n end",
"title": ""
}
] |
afad453293f9f3099f5bf66a72e800c0
|
DELETE /consortia/1 DELETE /consortia/1.json DELETE /consortia/1.xml
|
[
{
"docid": "a69949ab22b73f2cc0ce7e478b96ce5b",
"score": "0.0",
"text": "def destroy\n begin\n @consortium.destroy\n flash[:success] = \"successfully destroyed.\"\n rescue ActiveRecord::DeleteRestrictionError => e\n @consortium.errors.add(:base, e)\n flash[:error] = \"#{e}\"\n redirect_to consortiun_url\n else\n redirect_to consortia_url\n end\n end",
"title": ""
}
] |
[
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.6980486",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "ac051b7769e46d3cbab1d5fda84d7f00",
"score": "0.6967528",
"text": "def destroy\n @condominios = Condominio.find(params[:id])\n @condominios.destroy\n\n respond_to do |format|\n format.html { redirect_to condominia_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8a6f9c4d4ef97494caf0fc46a23bbb4a",
"score": "0.6917166",
"text": "def destroy\n @conversazione = Conversazione.find(params[:id])\n @conversazione.destroy\n\n respond_to do |format|\n format.html { redirect_to conversazioni_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "94ef0712e239841801244ec432028d6f",
"score": "0.6905729",
"text": "def destroy\n @condo = Condo.find(params[:id])\n @condo.destroy\n\n respond_to do |format|\n format.html { redirect_to condos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d855f873fb84d1e7c81ee58e0711a0e",
"score": "0.68931776",
"text": "def destroy\n @conexao.destroy\n respond_to do |format|\n format.html { redirect_to conexoes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6826006",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.6809528",
"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": "c37ed15310cd1a4f93d91b6b2bb7f121",
"score": "0.67886496",
"text": "def destroy\n @concurso = Concurso.find(params[:id])\n @concurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(concursos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "64584a414b87eb462b5502ae3de1f4ec",
"score": "0.67562777",
"text": "def delete\n # TODO: impl\n collection = Occi::Collection.new\n respond_with(collection, status: 501)\n end",
"title": ""
},
{
"docid": "64584a414b87eb462b5502ae3de1f4ec",
"score": "0.67562777",
"text": "def delete\n # TODO: impl\n collection = Occi::Collection.new\n respond_with(collection, status: 501)\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6729836",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6673371",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "c59064840a68ccaa1b833134d0075639",
"score": "0.6669587",
"text": "def destroy\n @conexao.destroy\n respond_to do |format|\n format.html { redirect_to conexoes_url, notice: 'Conexao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9db77723091cc68ce4fc63e75986714c",
"score": "0.6666408",
"text": "def destroy\n @tconexion = Tconexion.find(params[:id])\n @tconexion.destroy\n\n respond_to do |format|\n format.html { redirect_to(tconexions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "305c89e9ca28c59248487130677d8378",
"score": "0.66653323",
"text": "def destroy\n @congregacion = Congregacion.find(params[:id])\n @congregacion.destroy\n\n respond_to do |format|\n format.html { redirect_to congregacions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ccadee36ba3a4936922b49962b77fb91",
"score": "0.66611624",
"text": "def destroy\n @contadore.destroy\n respond_to do |format|\n format.html { redirect_to contadores_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e4245f58017fd51e9d5493a2ed9bd78",
"score": "0.66609913",
"text": "def destroy\n @condo.destroy\n respond_to do |format|\n format.html { redirect_to condos_url, notice: 'Condo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.665187",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "afba0d2812065b56b09a0c7fe4f5a9a7",
"score": "0.6651509",
"text": "def destroy\n @consignado = Consignado.find(params[:id])\n @consignado.destroy\n\n respond_to do |format|\n format.html { redirect_to consignados_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8d67c3987ecf8860024cd87197efeb4c",
"score": "0.6648282",
"text": "def destroy\n @convenente.destroy\n respond_to do |format|\n format.html { redirect_to convenentes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e08862761fb37f79f91232f3fe6f6a51",
"score": "0.6645774",
"text": "def destroy\n @consumo.destroy\n respond_to do |format|\n format.html { redirect_to consumos_url, notice: 'Consumo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08253b713c969634cc5940112e4868af",
"score": "0.6641234",
"text": "def destroy\n @tipo_concurso.destroy\n respond_to do |format|\n format.html { redirect_to tipo_de_concursos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de295daf1b44c35b439fd84ab8af46af",
"score": "0.66082966",
"text": "def destroy\n @condicionesdepago.destroy\n respond_to do |format|\n format.html { redirect_to condicionesdepagos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5027d77c37f3b57a8eae74e5f23ef770",
"score": "0.66039556",
"text": "def destroy\n @cotacoes = Cotacao.find(params[:id])\n @cotacoes.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_contatos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "32460fdd3e93e79677cdaad812e17442",
"score": "0.6599228",
"text": "def destroy\n @condomino = Condomino.find(params[:id])\n @condomino.destroy\n\n respond_to do |format|\n format.html { redirect_to condominos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed8b26ac67988906e766a7c8953dce37",
"score": "0.6585015",
"text": "def rest_delete(url, token_id, ssl_ca_file = @ssl_ca_file)\n begin\n RestClient::Request.execute(method: :delete, url: \"#{url}\", headers: {'accept': 'application/json', 'x-auth-token': token_id}, :ssl_ca_file => \"#{ssl_ca_file}\")\n rescue\n RestClient::Request.execute(method: :delete, url: \"#{url}\", headers: {'accept': 'application/json', 'x-auth-token': token_id}, verify_ssl: false)\n end\n end",
"title": ""
},
{
"docid": "0d60c27dbe0868476133eab0e5666c28",
"score": "0.65835893",
"text": "def destroy\n @congregacoes = Congregacoes.find(params[:id])\n @congregacoes.destroy\n\n respond_to do |format|\n format.html { redirect_to(congregacoes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d1375c254015f9e8c8de108a1eeaac09",
"score": "0.6581665",
"text": "def destroy\n @concurso.destroy\n respond_to do |format|\n format.html { redirect_to concursos_url, notice: 'Concurso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "faa9e5141e69d3a2d5a9188024e7b46f",
"score": "0.65794504",
"text": "def destroy\n @dependencia = Dependencia.find(params[:id])\n @dependencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(dependencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6567978",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6567978",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6567978",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "c53a7ddfb5f66bdab62b1fc4305a0473",
"score": "0.6562923",
"text": "def delete *args\n make_request :delete, *args\n end",
"title": ""
},
{
"docid": "79e649905b8faad562ccddc0ec11f002",
"score": "0.6562173",
"text": "def destroy\n @conferencium = Conferencium.find(params[:id])\n @conferencium.destroy\n\n respond_to do |format|\n format.html { redirect_to conferencia_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.6559364",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "0063393becfeea5760b7e0e3a0f34cc8",
"score": "0.6554896",
"text": "def destroy\n @comunidad.destroy\n respond_to do |format|\n format.html { redirect_to comunidades_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06d1bd4e48c5bab82a1f4cf16f4f31d2",
"score": "0.65445465",
"text": "def destroy\n @conta = Conta.find(params[:id])\n @conta.destroy\n\n respond_to do |format|\n format.html { redirect_to(contas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c68e5cdc9105fcefa909015a055ad7e7",
"score": "0.65403503",
"text": "def destroy\n @tconsumo = Tconsumo.find(params[:id])\n @tconsumo.destroy\n\n respond_to do |format|\n format.html { redirect_to(tconsumos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f66b6447dc8c35ed0f9d522bd69f1547",
"score": "0.6538126",
"text": "def destroy\n @contenido.destroy\n respond_to do |format|\n format.html { redirect_to contenidos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "981209190b41da38a7c126d080cf12e4",
"score": "0.6532502",
"text": "def destroy\n @ordenes_de_consumo.destroy\n respond_to do |format|\n format.html { redirect_to ordenes_de_consumos_url, notice: 'La orden de consumo fue eliminada.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "875092c53cdb3f2e1a1317bac5eee1e9",
"score": "0.65213275",
"text": "def destroy\n @consorcio.destroy\n respond_to do |format|\n format.html { redirect_to consorcios_url, notice: 'Consorcio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.6520718",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "bea19625a501ac4d8fadd4a36c6b3ef3",
"score": "0.6517975",
"text": "def destroy\n @consumable.destroy\n respond_to do |format|\n format.html { redirect_to consumables_url, notice: 'Consumible fue eliminado de forma exitosa.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4551795db0968df84d97e4b21dc26888",
"score": "0.6516371",
"text": "def destroy\n @base_conhecimento = Base::Conhecimento.find(params[:id])\n @base_conhecimento.destroy\n\n respond_to do |format|\n format.html { redirect_to(base_conhecimentos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "32432c8603163b5f195fc3da7a827611",
"score": "0.6509656",
"text": "def destroy\n @tipo_contato = TipoContato.find(params[:id])\n @tipo_contato.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_contatos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "da3aae77a19b7203c508fdc000aedd13",
"score": "0.6508702",
"text": "def destroy\n @contravertion.destroy\n respond_to do |format|\n format.html { redirect_to contravertions_url, notice: 'Contravertion eliminada' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9ec212f62402c26e0f73d4d5a7d4eca",
"score": "0.65075225",
"text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend",
"title": ""
},
{
"docid": "cef857471089b938c912e72f49ec42fc",
"score": "0.65074617",
"text": "def destroy\n @obrasproyecto = Obrasproyecto.find(params[:id])\n @obrasproyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(obrasproyectos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "eb87d9a3154c29c054c54fd32e6403d0",
"score": "0.6505489",
"text": "def destroy\n @conta.destroy\n addlog(\"Apagou uma conta\")\n respond_to do |format|\n format.html { redirect_to contas_url, notice: 'Conta apagada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52f7ad42a15e1105482ceb1911f04f5e",
"score": "0.65046746",
"text": "def destroy\n @condominio.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Condominio foi excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eaae245c9a70ec9308a75e26decf04b8",
"score": "0.65033543",
"text": "def destroy\n @conta = Conta.find(params[:id])\n @conta.destroy\n\n respond_to do |format|\n format.html { redirect_to contas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4087a62942dfa21d94cc17b2613c234",
"score": "0.649649",
"text": "def destroy\n @cobros_detalhe = CobrosDetalhe.find(params[:id])\n @cobros_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/cobros/#{@cobros_detalhe.cobro_id}\" }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "77c742322d16bbccac07ab52cc2f42db",
"score": "0.64948916",
"text": "def delete\n # TODO\n end",
"title": ""
},
{
"docid": "2efae214c7654b4379b09a504a6a8b6c",
"score": "0.6492609",
"text": "def destroy\n @convo = Convo.find(params[:id])\n @convo.destroy\n\n respond_to do |format|\n format.html { redirect_to(convos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d2375b11675de0e152de07976b50e9c7",
"score": "0.64921296",
"text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend",
"title": ""
},
{
"docid": "2f34ec3e4ad665020b06b00de2d3e5fe",
"score": "0.6492022",
"text": "def destroy\n @est_comentario.destroy\n respond_to do |format|\n format.html { redirect_to est_comentarios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00c90bc63b0302afbbc4b2979ae20b57",
"score": "0.6490125",
"text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "a5766791764e0af7ae2caf5e13ffa648",
"score": "0.6482612",
"text": "def destroy\n @sala_de_conferencium.destroy\n respond_to do |format|\n format.html { redirect_to sala_de_conferencia_url, notice: 'Sala de conferencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "718fd485f95a30a8c897e2403defb29f",
"score": "0.648235",
"text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end",
"title": ""
},
{
"docid": "6f4e63099a451de9a0c9d9f52bc3d02d",
"score": "0.6481508",
"text": "def destroy\n @os_deb_tecnico.destroy\n respond_to do |format|\n format.html { redirect_to os_deb_tecnicos_url, notice: 'Os deb tecnico foi excluído(a)' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0138c1c46aa8ddada9c429c6060b9585",
"score": "0.64814866",
"text": "def destroy\n @cli= @factura.cliente\n @factura.destroy\n respond_to do |format|\n format.html { redirect_to @cli, notice: 'La factura fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "323103cff91433eca1de9081cdb9a500",
"score": "0.64665145",
"text": "def destroy\n @clave_catalogo.destroy\n respond_to do |format|\n format.html { redirect_to clave_catalogos_url, notice: 'La clave de catálogo se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6463877",
"text": "def delete; end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.6460998",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "3b57496e746302d7ef90c7faef94f8da",
"score": "0.64608574",
"text": "def destroy\n @concessionaire = Concessionaire.find(params[:id])\n @concessionaire.destroy\n\n respond_to do |format|\n format.html { redirect_to(concessionaires_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c01b1289773e49233a7bf455f0e6a81b",
"score": "0.645861",
"text": "def destroy\n @contenido = Contenido.find(params[:id])\n @contenido.destroy\n\n respond_to do |format|\n format.html { redirect_to(contenidos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5e37bb28ba39dbf5491781070b128eb1",
"score": "0.6458205",
"text": "def destroy\n @consola.destroy\n respond_to do |format|\n format.html { redirect_to consolas_url, notice: 'Consola was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c12d4b3a3dca1faca099dae9c943ea40",
"score": "0.6453717",
"text": "def destroy\n @convenio.destroy\n respond_to do |format|\n format.html { redirect_to convenios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61a109c3d8b12f19b234b81304316bc5",
"score": "0.644619",
"text": "def destroy\n @loja_concorrencium = LojaConcorrencium.find(params[:id])\n @loja_concorrencium.destroy\n\n respond_to do |format|\n format.html { redirect_to loja_concorrencia_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ba4ee278a91921acc5b2ced6642a79c",
"score": "0.644605",
"text": "def destroy\n @coleccion = Coleccion.find(params[:id])\n @coleccion.destroy\n\n respond_to do |format|\n format.html { redirect_to(colecciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ce21b0fddbbaabc79f54aac3a5cfa1b1",
"score": "0.64445364",
"text": "def destroy\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to conversaciones_url, notice: \"Conversacion was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "419097c1c4a142adaf725a2112822e8e",
"score": "0.64441013",
"text": "def delete\n request_method('DELETE')\n end",
"title": ""
},
{
"docid": "4eadb61943fa9a636cad510bf21db1aa",
"score": "0.64440167",
"text": "def destroy\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n @agronomiadecanato.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiadecanatos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14142c25f131ba650b373132afac315a",
"score": "0.6442095",
"text": "def delete(headers=false); call_client(:delete, headers); end",
"title": ""
},
{
"docid": "f652b9b9af589a5e20da45b920fd40aa",
"score": "0.6440944",
"text": "def destroy\n @correspondencia = Correspondencia.find(params[:id])\n @correspondencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "43ecb1a3efac7074ec66568c541f2cbb",
"score": "0.643675",
"text": "def destroy\n @correo_plantilla = CorreoPlantilla.find(params[:id])\n @correo_plantilla.destroy\n\n respond_to do |format|\n format.html { redirect_to(correo_plantillas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fe4cd6029c400c722aef2ce824de8cfe",
"score": "0.6433959",
"text": "def destroy\n @conyugue.destroy\n respond_to do |format|\n format.html { redirect_to internos_path, notice: 'Conyugue fue borrado satisfactoriamente.' }\n format.json { head :no_content }\n\n end\n end",
"title": ""
},
{
"docid": "12d6881a07e84a966800b3ed54ffe5a9",
"score": "0.6431913",
"text": "def datadelete\n\n current_email = current_user.email\n athena_name = current_email[/[^@]+/]\n\n @neo = Neography::Rest.new(ENV['NEO4J_URL'] || \"http://localhost:7474\")\n\n category_name = params[:category]\n\n ret = {:response => \"All good\"}\n\n if category_name == \"living group\" or category_name == \"work\"\n ret = {:response => \"Can't delete living gorup or work categories!\"}\n else\n if params[:name]\n connection_name = params[:name]\n puts \"DELETING CONNECTION TO #{connection_name} IN CATEGORY #{category_name}\"\n @neo.execute_query(\"START n=node(*) MATCH (n)-[r:`#{category_name}`]->(x) WHERE (n.athena ='#{athena_name}' and x.athena='#{connection_name}') DELETE r;\")\n else\n puts \"DELETING CATEGORY #{category_name}\"\n @neo.execute_query(\"START n=node(*) MATCH (n)-[r:`#{category_name}`]->() WHERE n.athena ='#{athena_name}' DELETE r;\")\n end\n end\n \n render :json => ret.to_json\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.6428593",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "bcbdbdd02e54abe1d00fca401e0f8c43",
"score": "0.6420716",
"text": "def destroy\n @servico_cruzeiro.destroy\n respond_to do |format|\n format.html { redirect_to servico_cruzeiros_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7dcf2b66db6f87752bd1b6f60193588b",
"score": "0.6420312",
"text": "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidad_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c22010b3b2a41bc56274c47a5bed15f2",
"score": "0.64190483",
"text": "def destroy\n @contenuto = Contenuto.find(params[:id])\n @contenuto.destroy\n\n respond_to do |format|\n format.html { redirect_to(contenuti_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f245bcabc83c5d69181fc839e9c33b4f",
"score": "0.64188695",
"text": "def destroy\n @ocupacion = Ocupacion.find(params[:id])\n @ocupacion.destroy\n\n respond_to do |format|\n format.html { redirect_to ocupacions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f835adbfffd77d06801907605d85f6e3",
"score": "0.6418042",
"text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f835adbfffd77d06801907605d85f6e3",
"score": "0.6418042",
"text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8c4e724ed57271255b67acbf8f0d198",
"score": "0.64171934",
"text": "def destroy\n @tipo_de_conta.destroy\n addlog(\"Tipo de conta apagado\")\n respond_to do |format|\n format.html { redirect_to tipos_de_conta_url, notice: 'Tipo de conta apagado com sucesso' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a351226f0931a54bee39a0697e70c9d0",
"score": "0.6415443",
"text": "def destroy\r\n @sivic_contato.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contatos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "23af5f7a75275b63501651ea903adaa9",
"score": "0.6414722",
"text": "def destroy\n @ev_comentario.destroy\n respond_to do |format|\n format.html { redirect_to ev_comentarios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf3e291fd42c45baaad69380ee6dd485",
"score": "0.6413896",
"text": "def destroy\n @ocupacion = Ocupacion.find(params[:id])\n @ocupacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(ocupaciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1abb26bf31f5093c3848b2927ff648be",
"score": "0.641152",
"text": "def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to aplicaciones_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df2a83afdcc160be6fcbbe8653c7a412",
"score": "0.64104867",
"text": "def destroy\n @asignatura_x_curso = AsignaturaXCurso.find(params[:id])\n @asignatura_x_curso.destroy\n\n respond_to do |format|\n format.html { redirect_to asignatura_x_cursos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4e4cde974b868a2308785db39e608fad",
"score": "0.6409343",
"text": "def destroy\n set_redireccion\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to @redireccion, notice: \"Documento base was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0d0d63b63f92b8e0e28cc88ea5d7a880",
"score": "0.64076054",
"text": "def destroy\n @cota = Cota.find(params[:id])\n @cota.destroy\n\n respond_to do |format|\n format.html { redirect_to cotas_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aad0d29c0a9dc13beff3172707547c56",
"score": "0.64039797",
"text": "def destroy\n @cliente_naviera.destroy\n respond_to do |format|\n format.html { redirect_to cliente_navieras_url, notice: 'Registro Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c58b90fe889a33e20a8d48b733cdd83",
"score": "0.64038414",
"text": "def destroy\n @balanco = Balanco.find(params[:id])\n @balanco.destroy\n\n respond_to do |format|\n format.html { redirect_to balancos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
27415e5514475681c6ea22a7b2692889
|
DELETE /downloads/1 DELETE /downloads/1.json
|
[
{
"docid": "c69cea6b12ee8e16108af72b6735f018",
"score": "0.756834",
"text": "def destroy\n @download.destroy\n respond_to do |format|\n format.html { redirect_to downloads_url, notice: 'Aggregate download was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "fd2a1141e1026019ac5c04626c25fe9a",
"score": "0.7762203",
"text": "def destroy\n @download = Download.find(params[:id])\n @download.destroy\n\n respond_to do |format|\n format.html { redirect_to downloads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c492192a968090b7a605de32fa9c3982",
"score": "0.77304214",
"text": "def destroy\n @download.destroy\n respond_to do |format|\n format.html { redirect_to downloads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d628e3e011b58c3fe3133119f5778a10",
"score": "0.75973046",
"text": "def destroy\n @file_download = FileDownload.find(params[:id])\n @file_download.destroy\n\n respond_to do |format|\n format.html { redirect_to file_downloads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85f5f943a445fb03810005d1f14baad5",
"score": "0.7466472",
"text": "def destroy\n @download.destroy\n respond_to do |format|\n format.html { redirect_to downloads_url, notice: 'Download was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85f5f943a445fb03810005d1f14baad5",
"score": "0.7466472",
"text": "def destroy\n @download.destroy\n respond_to do |format|\n format.html { redirect_to downloads_url, notice: 'Download was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0289fe6d1c82be6014a06b4654582edb",
"score": "0.7449843",
"text": "def destroy\n @download_item = DownloadItem.find(params[:id])\n @download_item.destroy\n\n respond_to do |format|\n format.html { redirect_to download_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.7425344",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "d7d81bc28981b5a4f30a80b3f2a24cf3",
"score": "0.7412717",
"text": "def destroy\n @download = Download.find(params[:id])\n @download.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_downloads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.73749626",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.73182756",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "04ebe4a177ca4f6663d944dc8afd580b",
"score": "0.7309749",
"text": "def destroy\n @download = Download.find(params[:id])\n @download.destroy\n redirect_to downloads_path\n end",
"title": ""
},
{
"docid": "2148e2fd9383c12872890f51efee3615",
"score": "0.7285901",
"text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end",
"title": ""
},
{
"docid": "0f54c7a9ca98b6a22115ad264c59bdad",
"score": "0.7285081",
"text": "def destroy\n @download = Download.find(params[:id])\n @download.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_downloads_url }\n end\n end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.72743046",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.72743046",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "2675aa0e2ced04fc9c7de6fc57be6a59",
"score": "0.72665554",
"text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end",
"title": ""
},
{
"docid": "2c816b8d693d9006c9b8d05ea4226bcd",
"score": "0.7265135",
"text": "def destroy\n @download = @download_folder.downloads.find(params[:id])\n @download_folder = @download.download_folder\n @download.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_club_file_path(@download_folder.club, @download_folder)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0f32e313dd340185654ae79821d37f9d",
"score": "0.72610646",
"text": "def delete(path)\n http_execute(Net::HTTP::Delete.new(path))\n end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.72447884",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "09f6303f18ce5612216026bdd448d644",
"score": "0.7195134",
"text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end",
"title": ""
},
{
"docid": "5cbd9400cd001af247f9c442e902d68d",
"score": "0.71539235",
"text": "def delete(path)\n send_request(:delete, :path => path)\n end",
"title": ""
},
{
"docid": "830703f3ef9eb599481171cff43f76df",
"score": "0.71428734",
"text": "def destroy \n @versioned_file.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "2163c00655324c6555c24681d91cd5a7",
"score": "0.7132833",
"text": "def delete(path)\n resp = request('/files/delete', path: path)\n parse_tagged_response(resp)\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.7122606",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "e090f055903dc5a6c7da785858e521ab",
"score": "0.71220344",
"text": "def delete\n client.file_delete(path)\n end",
"title": ""
},
{
"docid": "c53a7ddfb5f66bdab62b1fc4305a0473",
"score": "0.71164966",
"text": "def delete *args\n make_request :delete, *args\n end",
"title": ""
},
{
"docid": "fa434c603aef770326d3bcfb13e2a884",
"score": "0.7104173",
"text": "def destroy\n puts \"delete --\" * 10\n result = access_token.delete(\"/api/v1/file_assets/#{params[:id]}\")\n\n display_api_response( result )\n \n respond_to do |format|\n format.html { redirect_to(file_assets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "acbf46fe620a826dd45f370c1a625c83",
"score": "0.7088346",
"text": "def delete(path)\n HTTP\n .headers(headers)\n .delete(get_full_url(path))\n end",
"title": ""
},
{
"docid": "bbed65774f9489c73d250b9e57131b95",
"score": "0.7086467",
"text": "def delete(path)\n request(:delete, path)\n end",
"title": ""
},
{
"docid": "bbed65774f9489c73d250b9e57131b95",
"score": "0.7086467",
"text": "def delete(path)\n request(:delete, path)\n end",
"title": ""
},
{
"docid": "e1516a76c03a1a8f79c0c6b1ff5cf920",
"score": "0.70737183",
"text": "def delete(url)\n req(url, :delete)\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.70717525",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "49d71d908b09b6ad6a4b36706bfbd4db",
"score": "0.70538867",
"text": "def delete!\n res = Seaweed::HTTP.delete url\n !(Seaweed::HTTP.parse(res)[:size].nil?)\n end",
"title": ""
},
{
"docid": "681902b52cabe762dced640f449f38a6",
"score": "0.7036279",
"text": "def delete(path)\n req = Net::HTTP::Delete.new(@basic_path + path)\n res = @http.request(req)\n validate_status(res, ['204', '301'])\n end",
"title": ""
},
{
"docid": "b965aa2e76649b84623ed925811f4794",
"score": "0.7031112",
"text": "def delete(_path)\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.70293516",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.70263356",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.70263356",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "d2b45d86e1789d16d66be3c9fc0392c0",
"score": "0.70171636",
"text": "def destroy\n @jsonfile = Jsonfile.find(params[:id])\n @jsonfile.destroy\n\n respond_to do |format|\n format.html { redirect_to(jsonfiles_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a3c541f14459e116655c873dfe7c85f3",
"score": "0.6987108",
"text": "def v3_delete(path)\n # Expire cached objects from here on down\n expire_matching \"#{parent_path(path)}.*\"\n # Create request parameters\n delete_params = { \n :method => \"delete\" \n }\n # Request\n v3_do_request(delete_params, path)\n end",
"title": ""
},
{
"docid": "f567c9f7363eb7a91debf00a15775a61",
"score": "0.69711345",
"text": "def delete(path)\n request(:delete, path, build_request_headers)\n end",
"title": ""
},
{
"docid": "a328e27d7f3f16f17260a09f7ca6f4df",
"score": "0.6970742",
"text": "def delete(url)\n authsub_http_request(Net::HTTP::Delete,url)\n end",
"title": ""
},
{
"docid": "56be699aa8afb95f92704b69649c0b12",
"score": "0.6959315",
"text": "def destroy\n repository = @single_file.repository\n @single_file.destroy\n respond_to do |format|\n format.html { redirect_to repository, notice: 'Single file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c02f1fdcf38fb3eec977c695a1ce6f4d",
"score": "0.6946125",
"text": "def destroy\n @offline_download_record.destroy\n respond_to do |format|\n format.html { redirect_to offline_download_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c3a2374f4f3ebabf715e8db37f712356",
"score": "0.69380283",
"text": "def delete(path)\n\t\t\tresponse = @session.rcp('/files/delete_v2', path: path)\n\n\t\t\tparse_metadata(response['metadata'])\n\t\tend",
"title": ""
},
{
"docid": "eb17bb60f85d952738360f55504fbf9e",
"score": "0.69320816",
"text": "def delete(path, opts = {})\n request(:delete, path, opts)\n end",
"title": ""
},
{
"docid": "b905a58fc3bc314eb053e9e898348267",
"score": "0.6925759",
"text": "def destroy\n @downloaded_datum = DownloadedDatum.find(params[:id])\n @downloaded_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to data_provider_user_downloaded_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b01c3a0827e241a025f07b0f8d47cdf9",
"score": "0.69092005",
"text": "def destroy\n @download_job = DownloadJob.find(params[:id])\n @download_job.destroy\n\n respond_to do |format|\n format.html { redirect_to download_jobs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e3ea90f717278b79d8908e5b537926be",
"score": "0.690762",
"text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end",
"title": ""
},
{
"docid": "00c90bc63b0302afbbc4b2979ae20b57",
"score": "0.6899265",
"text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.68947273",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "5df0f46057bf97b13d699284b6fe55d4",
"score": "0.6894057",
"text": "def delete\n status 404\n nil\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.68939155",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "b4d048dcfd4a37fc70d37907c8515974",
"score": "0.68891",
"text": "def delete(url, headers={})\n RestClient.delete url, headers\n end",
"title": ""
},
{
"docid": "53679d136700b74b9bf37b7816abb41d",
"score": "0.68882483",
"text": "def destroy\n @download.destroy\n respond_to do |format|\n if @download.destroyed?\n format.html { destroy_redirect @download, notice: 'Download was successfully destroyed.' }\n format.json { head :no_content}\n else\n format.html { destroy_redirect @download, notice: 'Download was not destroyed, ' + @download.errors.full_messages.join('; ') }\n format.json { render json: @download.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d110b0274dfc7b1752c3427682cb5539",
"score": "0.68855476",
"text": "def delete(path, **args)\n process(:delete, path, **args)\n end",
"title": ""
},
{
"docid": "0476521f8ec9941ca22cf273656b26ab",
"score": "0.68842703",
"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": "c0e04e7b24575da23f7965e8dad6e32c",
"score": "0.6878603",
"text": "def delete(path, params = {})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.68614334",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "9214fc42c6353aba54e17fc2c36aa926",
"score": "0.6859412",
"text": "def destroy\n @downfile = Downfile.find(params[:id])\n @downfile.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_downfiles_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "24ad0a67a9a37abf58570157d30b0b6e",
"score": "0.6853382",
"text": "def destroy\n @file_name.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "660e9cc8a1ccdea2e27c1afa137d15f3",
"score": "0.6848914",
"text": "def destroy\n @download_type = DownloadType.find(params[:id])\n @download_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(download_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6a19ba99f0d1f7225b5ed73fe068136d",
"score": "0.68482065",
"text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.684662",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "29e28212ea9de38cd83d020a35812c77",
"score": "0.68440956",
"text": "def destroy\n @filepath.destroy\n respond_to do |format|\n format.html { redirect_to filepaths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8679cb1650d9f95ab68d7988aa3f9382",
"score": "0.6837593",
"text": "def delete(url)\n\n request(url, 'DELETE', '')\n\n end",
"title": ""
},
{
"docid": "8679cb1650d9f95ab68d7988aa3f9382",
"score": "0.6837593",
"text": "def delete(url)\n\n request(url, 'DELETE', '')\n\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.6836191",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.6836191",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "b14cfb868a87dc502831c1080a1121c9",
"score": "0.6834624",
"text": "def destroy\n @download_list.destroy\n respond_to do |format|\n format.html { redirect_to download_lists_url, notice: 'Download list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98074a183384cefa9512240d2d65da81",
"score": "0.6834067",
"text": "def delete(url, **args)\n @http_client.delete(url, **args)\n end",
"title": ""
},
{
"docid": "29c5346324687e5f4b8b7c741962badc",
"score": "0.6832208",
"text": "def a_delete(path)\n a_request(:delete, Twitter::REST::Client::ENDPOINT + path)\nend",
"title": ""
},
{
"docid": "8d0d2d303d131f3cca244bf9402b53a7",
"score": "0.682602",
"text": "def delete id\n req = Net::HTTP::Delete.new \"/#{id}\", @headers\n make_request(req)\n end",
"title": ""
},
{
"docid": "e1fc687abf98cbf17738b2f5098d1f61",
"score": "0.6823652",
"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": "114202d509f2ca5cdf9d2483f8cb0a9c",
"score": "0.6822772",
"text": "def delete(url, *args)\n handle_rest_client_exceptions do\n rest_client_resource(url).delete(*args)\n end\n end",
"title": ""
},
{
"docid": "146d517a56b4be0278a7fab3db674bc0",
"score": "0.6819436",
"text": "def delete(*args)\n arguments(args, required: [:user, :repo, :id])\n\n delete_request(\"/repos/#{arguments.user}/#{arguments.repo}/downloads/#{arguments.id}\", arguments.params)\n end",
"title": ""
},
{
"docid": "9c4b48c08b524a45588714b4a6c46295",
"score": "0.68185514",
"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": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.681387",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.681387",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.681387",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.68135804",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "f8826278366249b77b122f31df54e8eb",
"score": "0.6811885",
"text": "def destroy\n @download_folder = @club.download_folders.find(params[:id])\n @download_folder.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_club_files_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "be430184aa0d535a6f4e1c92699a2f60",
"score": "0.6810649",
"text": "def delete(path, headers = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "233719c7e8a9c3765615cfea096984ae",
"score": "0.6809346",
"text": "def destroy\n @export_file.destroy\n\n respond_to do |format|\n format.html { redirect_to export_files_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c537b3a0008ef6459c518123cbcc9d5",
"score": "0.6808812",
"text": "def delete(path, params = {})\n request :delete, path, params\n end",
"title": ""
},
{
"docid": "0c1a309a3867d4ff0545014832b63cde",
"score": "0.68009454",
"text": "def delete(path)\r\n h = @headers.clone\r\n h['X-HTTP-Method-Override'] = 'DELETE'\r\n @url.delete(path, h)\r\n end",
"title": ""
},
{
"docid": "718fd485f95a30a8c897e2403defb29f",
"score": "0.680022",
"text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end",
"title": ""
},
{
"docid": "14b5deb8d47814d7ca16fb78aed0c468",
"score": "0.67989784",
"text": "def destroy\n @dfile = Dfile.find(params[:id])\n @dfile.destroy\n\n respond_to do |format|\n format.html { redirect_to dfiles_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9771b1b59ddf6c923542bd4ae134bf43",
"score": "0.6798344",
"text": "def destroy\n @registered_download.destroy\n respond_to do |format|\n format.html { redirect_to(admin_registered_downloads_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted registered download: #{@registered_download.name}\")\n end",
"title": ""
},
{
"docid": "9771b1b59ddf6c923542bd4ae134bf43",
"score": "0.6798344",
"text": "def destroy\n @registered_download.destroy\n respond_to do |format|\n format.html { redirect_to(admin_registered_downloads_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted registered download: #{@registered_download.name}\")\n end",
"title": ""
},
{
"docid": "67de1235949157d9159b6eaec62f65e2",
"score": "0.6796327",
"text": "def delete(path)\n RestClient.delete url_for(path)\n true\n rescue\n false\n end",
"title": ""
},
{
"docid": "70be323439f16c4ce9edb3c5c98fe545",
"score": "0.67914575",
"text": "def delete(*args)\n http_client.delete(uri, *merge_http_options(args))\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "b2834e6124c920737809b7669107f8b2",
"score": "0.67821556",
"text": "def delete(path, params={})\n request(:delete, path, params)\n end",
"title": ""
},
{
"docid": "be41bcd571d31004f0c78949f5e3eb9b",
"score": "0.67773664",
"text": "def destroy\n @download_permission = DownloadPermission.find(params[:id])\n @download_permission.destroy\n\n respond_to do |format|\n format.html { redirect_to download_permissions_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] |
3fc764faa5fdddf4d14adb6590659765
|
Ensure valid credentials, either by restoring from the saved credentials files or intitiating an OAuth2 authorization. If authorization is required, the user's default browser will be launched to approve the request.
|
[
{
"docid": "768d7a54be8aedbed2a2c6272c1c770a",
"score": "0.62978417",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
}
] |
[
{
"docid": "fdf03d140fe16dc072651520e61398ac",
"score": "0.69318885",
"text": "def authorize\r\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\r\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\r\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\r\n user_id = \"default\"\r\n credentials = authorizer.get_credentials user_id\r\n\r\n # launch default browser to approve request of initial OAuth2 authorization\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url base_url: OOB_URI\r\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\r\n end\r\n\r\n credentials\r\nend",
"title": ""
},
{
"docid": "303a5e196c08f6a4d7d7da00a855e31f",
"score": "0.67232203",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(@CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(@CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(@CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => @SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{@CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\n end",
"title": ""
},
{
"docid": "46b32047086417936af8b0524882688d",
"score": "0.66598016",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIAL))\n file_store = Google::APIClient::FileStore.new(CREDENTIAL)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRET)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIAL}\" unless auth.nil?\n end\n auth\n end",
"title": ""
},
{
"docid": "1a262b6d9dc9b2ee5bcf5e8130f56647",
"score": "0.6650692",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n credentials = authorizer.get_credentials('default')\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n\n server = WEBrick::HTTPServer.new(Port: 3000)\n server.mount_proc('/oauth2callback') do |req, res|\n code = req.query['code']\n credentials = authorizer.get_and_store_credentials_from_code(user_id: 'default', code: code, base_url: OOB_URI)\n res.body = 'Authorization successful. You can close this window and return to the terminal.'\n server.shutdown\n end\n\n warn('Open the following URL in your browser and authorize the app:')\n warn(url)\n server.start\n end\n credentials\nend",
"title": ""
},
{
"docid": "634a08a7f4489d1d021dc891832e9c8b",
"score": "0.6555921",
"text": "def authorize interactive\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? and interactive\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n code = ask(\"Open the following URL in the browser and enter the resulting code after authorization\\n\" + url)\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "a2de092e0ab7a65833e733e40c89a0b6",
"score": "0.65252346",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(@CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(@CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: @CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, @SCOPE, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: @OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: @OOB_URI)\n end\n credentials\n end",
"title": ""
},
{
"docid": "6ab951250ffd32c8ec8813b892096e7f",
"score": "0.6498784",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n \n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end",
"title": ""
},
{
"docid": "85fc41df45959e45af1ebca15e0f96fc",
"score": "0.64935696",
"text": "def find_or_prompt_for_credentials\n client_id = Google::Auth::ClientId.from_hash(CLIENT_SECRET_HASH)\n token_store = Google::Auth::Stores::RedisTokenStore.new(:prefix => REDIS_KEY_PREFIX)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization:\"\n puts url\n\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n\n credentials\n end",
"title": ""
},
{
"docid": "40b7ad5f017a917c64a348e6d7b62db2",
"score": "0.6472355",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\n # changed SCOPE to SCOPES to pass in multiple OAUTH scopes\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPES, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end",
"title": ""
},
{
"docid": "d7f75f63bee10a8de32aa870350c48a1",
"score": "0.6464035",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' +\n 'resulting code after authorization'\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "03887969de5ba1eb7c20e5e7c81e25cc",
"score": "0.64566356",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend",
"title": ""
},
{
"docid": "9b1727fe2aa098822a445ea636b53512",
"score": "0.645468",
"text": "def authorize(interactive)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store, '')\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? && interactive\n url = authorizer.get_authorization_url(base_url: BASE_URI, scope: SCOPE)\n code = ask(\"Open the following URL in the browser and enter the resulting code after authorization\\n#{url}\")\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: BASE_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "f33853dd00c1cca0db828714c19387a1",
"score": "0.6453015",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend",
"title": ""
},
{
"docid": "8372407a2f8bc53d1e294de5e832d780",
"score": "0.64511627",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n end\n auth\nend",
"title": ""
},
{
"docid": "214a506768629d322390377704e62034",
"score": "0.64483833",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(self.credentials_path)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: self.token_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPES, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "ac0eec27cee922d3d23f64e88bd8f7c3",
"score": "0.64404464",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = ask \"code?: \"\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "e9c4fd4f5c67118d5f31f64d1b880267",
"score": "0.64376974",
"text": "def authorize\r\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\r\n\r\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\r\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\r\n authorizer = Google::Auth::UserAuthorizer.new(\r\n client_id, SCOPE, token_store)\r\n user_id = 'default'\r\n credentials = authorizer.get_credentials(user_id)\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url(\r\n base_url: OOB_URI)\r\n puts \"Open the following URL in the browser and enter the \" +\r\n \"resulting code after authorization\"\r\n puts url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI)\r\n end\r\n credentials\r\nend",
"title": ""
},
{
"docid": "24a36df41617d63dcd1c5952ff0ebbbd",
"score": "0.6408466",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "e962cc9b6d73d77a3bc5a3dca8ad74eb",
"score": "0.64001566",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "05f8d9e9d07201acd90282d58dd8bb0e",
"score": "0.6395092",
"text": "def authorize\n\tFileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n\tclient_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\tauthorizer = Google::Auth::UserAuthorizer.new(\n\t\tclient_id, SCOPE, token_store)\n\tuser_id = 'default'\n\tcredentials = authorizer.get_credentials(user_id)\n\tif credentials.nil?\n\t\turl = authorizer.get_authorization_url(\n\t\t\tbase_url: OOB_URI)\n\t\tputs \"Open the following URL in the browser and enter the \" +\n\t\t\"resulting code after authorization\"\n\t\tputs url\n\t\tcode = STDIN.gets\n\t\tcredentials = authorizer.get_and_store_credentials_from_code(\n\t\t\tuser_id: user_id, code: code, base_url: OOB_URI)\n\tend\n\tcredentials\nend",
"title": ""
},
{
"docid": "822e527a15ed12298bac301e64171f10",
"score": "0.63935935",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "9b99162042c394743c8f605a8e4747b0",
"score": "0.638506",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "9b99162042c394743c8f605a8e4747b0",
"score": "0.638506",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "b0d9a535269c14614512b78e43ced9da",
"score": "0.63808763",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI,\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "37ecb0853de295dd74c8d3a885e23c69",
"score": "0.6379494",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "f92cfcf2e3c3128e3ad1a5529a675d06",
"score": "0.637932",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "9a878b2fd8f3497919a7411c23158b2c",
"score": "0.63687724",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "76b3f9c48f90853d7641477dbd469bff",
"score": "0.634916",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.readline()\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "0e6e70dc7700f26aab7a3e6a1172f3f1",
"score": "0.6339304",
"text": "def authorize\r\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\r\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\r\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\r\n user_id = \"default\"\r\n credentials = authorizer.get_credentials user_id\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url base_url: OOB_URI\r\n puts \"Open the following URL in the browser and enter the \" \\\r\n \"resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI\r\n )\r\n end\r\n credentials\r\nend",
"title": ""
},
{
"docid": "514aff3948cdf227e8328e1b4bd1a73e",
"score": "0.6333245",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n # client_id = Google::Auth::ClientId.from_hash(Rails.application.config.gdrive_secrets)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store\n )\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI\n )\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization'\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "723ff63b51048b0ccffc614c885bd3d0",
"score": "0.6331787",
"text": "def authorize\r\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\r\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\r\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\r\n user_id = 'default'\r\n credentials = authorizer.get_credentials(user_id)\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url(base_url: OOB_URI)\r\n puts 'Open the following URL in the browser and enter the ' \\\r\n \"resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI\r\n )\r\n end\r\n credentials\r\nend",
"title": ""
},
{
"docid": "7d360c124c5e734360c8683070e61055",
"score": "0.63308454",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n\n credentials\n end",
"title": ""
},
{
"docid": "bc9a9dbcfc348f19b8f23841c184a558",
"score": "0.63308007",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPES, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "7a9e4646f87c24899c4a4e9724d08726",
"score": "0.6327534",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "9a4bc2f9e82d4b3257a11eee708352a0",
"score": "0.6327191",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.\n new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.\n new(client_id, SCOPE, token_store)\n credentials = authorizer.\n get_credentials(CONFIGURATION[\"calendar\"][\"user_id\"])\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \"\\\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: CONFIGURATION[\"calendar\"][\"user_id\"],\n code: code,\n base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "ed19f745affeff9ee97af9f4e1334b13",
"score": "0.63250905",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "cc687b46784d68ffa739949d9ef08575",
"score": "0.63238406",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI,\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "88cfe8daa806f02c8d08b5b3d04b3fb7",
"score": "0.6322635",
"text": "def authorize\n ##FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n if !File.exist?(CLIENT_SECRETS_PATH)\n puts \"Error: OAuth2認証用のsecretファイルが見つかりませんでした\"\n puts \"以下のURLからこのプロジェクト用のsecretを作成し、'client_secret.json'というファイル名でこのディレクトリに保存してください。\"\n puts\n puts \"https://console.developers.google.com/start/api?id=sheets.googleapis.com\"\n exit 1\n end\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"以下のURLにWebブラウザでアクセスし、認証を行った後、表示されるコードを入力してください:\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "e63f08be7a93c8fe544508e6e6481ef0",
"score": "0.63213277",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "235574bb3a1e1fc1a25c99ee3a92afca",
"score": "0.63205355",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "235574bb3a1e1fc1a25c99ee3a92afca",
"score": "0.63205355",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "235574bb3a1e1fc1a25c99ee3a92afca",
"score": "0.63205355",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "235574bb3a1e1fc1a25c99ee3a92afca",
"score": "0.63205355",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "339a7d6dfc73c62b261f65921f001822",
"score": "0.63171214",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "339a7d6dfc73c62b261f65921f001822",
"score": "0.63171214",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "d6fed33cc669961c5e945ff42c77e2dd",
"score": "0.6303736",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = $stdin.gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "edfbd144743643b505e3cc143d038342",
"score": "0.6299574",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "6db0f21e62cad17d8ff24c1b93f65074",
"score": "0.6287229",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "beddf54f103269722b465dce6382cd64",
"score": "0.6278718",
"text": "def authorize\n return credentials if credentials\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.gets\n authorizer.get_and_store_credentials_from_code(\n user_id: user_id,\n code: code,\n base_url: OOB_URI\n )\n end",
"title": ""
},
{
"docid": "8a8286ec07041091aa1bf95ad5c4d65a",
"score": "0.627095",
"text": "def authorize(force_reload)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if force_reload || credentials.nil?\n session[:is_authorized] = false\n redirect_to google_fetch_path\n return\n end\n credentials\n end",
"title": ""
},
{
"docid": "a932bfb73d222c054e8f07aaec5b502c",
"score": "0.626694",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(@credentials_path)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: @token_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, @scope, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: @oob_uri)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: @oob_uri\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "a5e90b571b461c72bde23ca9d0eec3c2",
"score": "0.6249106",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code( user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "747e83d084b05479b160f3c8379dfcbd",
"score": "0.6247173",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "f051f0642244e01a7c1f0e2f5544b92f",
"score": "0.62469876",
"text": "def authorize(credentials_path, secrets_path, scope)\n\n FileUtils.mkdir_p(File.dirname(credentials_path))\n\n file_store = Google::APIClient::FileStore.new(credentials_path)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(secrets_path)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => scope})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{credentials_path}\" unless auth.nil?\n end\n auth\n end",
"title": ""
},
{
"docid": "6c04be3be7f6a63ae104e4d7a91f869f",
"score": "0.6232074",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\\n\"\n puts url\n print \"\\nCode: \"\n code = gets\n puts\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "67e18c235ec85206fd7861b6cd45db7f",
"score": "0.62244236",
"text": "def check_credentials\n raise \"Please set load_configuration with #{RightSignature2013::Connection.api_token_keys.join(',')} or #{RightSignature2013::Connection.oauth_keys.join(',')}\" unless has_api_token? || has_oauth_credentials?\n end",
"title": ""
},
{
"docid": "a855634ffbf1c9f4f1debd4c731b7a2e",
"score": "0.6190306",
"text": "def valid_for_http_auth?; end",
"title": ""
},
{
"docid": "867108fec54d0a6b20c3c93e02aafc1a",
"score": "0.61846787",
"text": "def authorize\n credentialsFile = FILE_POSTFIX\n\n if File.exist? credentialsFile\n File.open(credentialsFile, 'r') do |file|\n credentials = JSON.load(file)\n @authorization.access_token = credentials['access_token']\n @authorization.client_id = credentials['client_id']\n @authorization.client_secret = credentials['client_secret']\n @authorization.refresh_token = credentials['refresh_token']\n @authorization.expires_in = (Time.parse(credentials['token_expiry']) - Time.now).ceil\n if @authorization.expired?\n @authorization.fetch_access_token!\n save(credentialsFile)\n end\n end\n else\n auth = @authorization\n url = @authorization.authorization_uri().to_s\n server = Thin::Server.new('0.0.0.0', 8081) do\n run lambda { |env|\n # Exchange the auth code & quit\n req = Rack::Request.new(env)\n auth.code = req['code']\n auth.fetch_access_token!\n server.stop()\n [200, {'Content-Type' => 'text/html'}, RESPONSE_HTML]\n }\n end\n\n Launchy.open(url)\n server.start()\n\n save(credentialsFile)\n end\n\n return @authorization\n end",
"title": ""
},
{
"docid": "5851594a5cc0df6b1025a650cb402773",
"score": "0.6128017",
"text": "def authorize\n\tclient_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n\tauthorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\tuser_id = 'default'\n\n\tcredentials = authorizer.get_credentials(user_id)\n\treturn credentials unless credentials.nil?\n\n\turl = authorizer.get_authorization_url(base_url: OOB_URI)\n\tputs 'Open the following URL in the browser and enter the ' \\\n\t\t \"resulting code after authorization:\\n#{url}\"\n\tcode = gets\n\n\treturn authorizer.get_and_store_credentials_from_code(\n\t\tbase_url: OOB_URI,\n\t\tuser_id: user_id,\n\t\tcode: code,\n\t)\n\nend",
"title": ""
},
{
"docid": "e9bfb78239f717ca58e960fa0294b95c",
"score": "0.61025524",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\"\n puts url\n puts \"\"\n puts \"paste code here:\"\n code = gets\n\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "2cae34eca7393cda2dc152a1c8a99e40",
"score": "0.602673",
"text": "def authorize(credentials)\n credentials_path = \"#{PATH}#{credentials}-gmail.json\"\n token_path = \"#{PATH}#{credentials}-token.yaml\"\n client_id = Google::Auth::ClientId.from_file credentials_path\n token_store = Google::Auth::Stores::FileTokenStore.new file: token_path\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "7d32c5cf71c86a775684304e1c82c9ed",
"score": "0.59745187",
"text": "def authorize(token_path, scope)\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: token_path\n authorizer = Google::Auth::UserAuthorizer.new client_id, scope, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "9ceabf97ff4a47ee3545f30c1175a6db",
"score": "0.5946648",
"text": "def authorize\n client_id = create_client_id\n token_store = create_token_store\n\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI\n )\n Rails.logger.debug do\n 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization'\n end\n Rails.logger.debug url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id:, code:, base_url: OOB_URI\n )\n end\n credentials\n end",
"title": ""
},
{
"docid": "fd04b51c9fb40d901d928c9fb1dae90e",
"score": "0.5941438",
"text": "def verify_credentials!\n raise AuthenticationError.new(\"missing client code\") if Applitrack.client_code.nil? || Applitrack.client_code.empty?\n raise AuthenticationError.new(\"missing username\") if Applitrack.username.nil? || Applitrack.username.empty?\n raise AuthenticationError.new(\"missing password\") if Applitrack.password.nil? || Applitrack.password.empty?\n end",
"title": ""
},
{
"docid": "31ee246ea6cc9656436ecdf8afeb96ac",
"score": "0.58535695",
"text": "def check_auth_expiration(auth, client_secrets_path, scope)\n return false unless auth.nil? ||\n (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(client_secrets_path)\n flow = Google::APIClient::InstalledAppFlow.new(\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: scope)\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{credentials_path}\" unless auth.nil?\n end",
"title": ""
},
{
"docid": "99648f2e175c6c55cc0f72477a3acf77",
"score": "0.5841386",
"text": "def prompt_user_authorisation\n\n require './app/routes/web'\n\n # Start local API\n Launchy.open(\"http://localhost:5000/cli/auth\")\n\n auth_thread = Thread.new do\n Linkedin2CV::Routes::Web.run!\n end\n\n auth_thread\n end",
"title": ""
},
{
"docid": "2b8f50bf4ce3724dbde318d0e89c3432",
"score": "0.5838343",
"text": "def auth_process\n\t\tif @auth_file.authorization.nil?\n \t\t\tmake_auth\n\t\telse\n\t\t\[email protected] = @auth_file.authorization\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b6194370056e1753db447ffd5a40869b",
"score": "0.58366865",
"text": "def grant_authorization\n create_verification_code if authorized?\n redirect_back\n end",
"title": ""
},
{
"docid": "05eb5b1157705a381c46926f64fb840b",
"score": "0.58300155",
"text": "def ensure_auth # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n if session[:prospect_params]\n # we have an application going so we've probably just refreshed the\n # screen\n redirect_to action: 'new', controller: 'prospects'\n elsif session[:cas].nil? || session[:cas][:user].nil?\n render status: :unauthorized, plain: 'Redirecting to SSO...'\n else\n user = User.find_by cas_directory_id: session[:cas][:user]\n if user.nil?\n render status: :forbidden, plain: 'Unrecognized user'\n else\n update_current_user(user)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "a7f3dab9556e6d9f94ff740afd8a9630",
"score": "0.5805814",
"text": "def authorize\n\t\tclient_id = Google::Auth::ClientId.new(@config[\"AuthKey\"], @config[\"AuthSecret\"])\n\t\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\t\tauthorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\t\tuser_id = \"default\"\n\t\tLOGGER.debug \"[GmailDriver#authorize] Authorizing...\"\n\t\tcredentials = authorizer.get_credentials(user_id)\n\t\tif credentials.nil?\n\t\t\turl = authorizer.get_authorization_url(base_url: OOB_URI)\n\t\t\tLOGGER.warn \"Open the following URL in the browser and enter the \" \\\n\t\t\t\t\t \"resulting code after authorization:\\n\" + url\n\t\t\tcode = gets\n\t\t\tcredentials = authorizer.get_and_store_credentials_from_code(\n\t\t\t\tuser_id: user_id, code: code, base_url: OOB_URI\n\t\t\t)\n\t\tend\n\t\tcredentials\n\tend",
"title": ""
},
{
"docid": "22f0daf58f0936dde04a11387748a591",
"score": "0.58033246",
"text": "def authorize!(current_user)\n @authorized = false\n oauth_drive_token = OauthDriveToken.get_provider_for(current_user, APP_CONFIG['oauth']['google']['provider_number'])\n if oauth_drive_token.present?\n # Set details\n @client.authorization.access_token = oauth_drive_token.access_token\n @client.authorization.refresh_token = oauth_drive_token.refresh_token\n @client.authorization.client_id = oauth_drive_token.client_number\n\n if oauth_drive_token.expires_at < Time.now\n # Present but expired, attempt to refresh\n @authorized = true if self.refresh_token(oauth_drive_token)\n elsif self.current_token_still_valid?\n @authorized = true\n else\n # Not valid so destroy it and prompts for re-auth\n oauth_drive_token.destroy\n end\n end\n end",
"title": ""
},
{
"docid": "ee304a77b3f958a41852e51840e59b25",
"score": "0.5799787",
"text": "def setup_credentials\n unless yes?('Would you like to configure and store your credentials?')\n $stderr.puts \"Unable to proceed without credentials\"\n exit 1\n end\n\n begin\n choice = choose do |menu|\n menu.prompt = 'Which type of credentials would you like to set up? (token is highly recommended) '\n menu.choices(:password, :token, :none)\n end.to_sym\n end until [:password, :token, :none].include? choice\n\n if choice == :password\n setup_password_credentials\n elsif choice == :token\n setup_token_credentials\n else\n return false\n end\n rescue StandardError => e\n options.debug ? warn(e) : raise(e)\n false\n end",
"title": ""
},
{
"docid": "ae4ed6d19536390f70aac3cd6813d549",
"score": "0.5798885",
"text": "def request_authorization\n create_ticket\n verify_resource_owner or return\n render_authorize_form\n end",
"title": ""
},
{
"docid": "bba481177c4cab36f21ac1195398f2d6",
"score": "0.57845545",
"text": "def user_credentials_for(scope)\n FileUtils.mkdir_p(File.dirname(token_store_path))\n\n if ENV['GOOGLE_CLIENT_ID']\n client_id = Google::Auth::ClientId.new(ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'])\n else\n client_id = Google::Auth::ClientId.from_file(client_secrets_path)\n end\n token_store = Google::Auth::Stores::FileTokenStore.new(:file => token_store_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, scope, token_store)\n\n user_id = options[:user] || 'default'\n\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n say \"Open the following URL in your browser and authorize the application.\"\n say url\n code = ask \"Enter the authorization code:\"\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end",
"title": ""
},
{
"docid": "0e337a7738e1ff6a520869b0e1852e13",
"score": "0.57660097",
"text": "def credentials(authorization, request); end",
"title": ""
},
{
"docid": "ec8523c3ce8e40c7187d843e4a179362",
"score": "0.5759502",
"text": "def authorise\n # checks can go here (is the application registered for example)\n grant = generate_grant\n valid_grants << grant\n grant\n end",
"title": ""
},
{
"docid": "7a1d1346d6c59a6548a8f006dbb28465",
"score": "0.57247895",
"text": "def oauth\n\t\tdropbox = DropboxConnection.new\n\t\n\t\tif params[:not_approved] == 'true'\n\t\t\tredirect_to dropbox_path, flash: { error: 'You just cancelled, didn\\'t you?' }\n\t\telse\n\t\t\t# the user has returned from Dropbox so save the session and go away\n\t\t\tdropbox.authorized\n\t\t\tredirect_to :root\n\t\tend\n\tend",
"title": ""
},
{
"docid": "69307c1ce15b1fff7aade56ea6cf622e",
"score": "0.57124627",
"text": "def login_required\n return if authorized?\n unauthorized! unless auth.provided?\n bad_request! unless auth.basic?\n unauthorized! unless authorize(*auth.credentials)\n @req.env['REMOTE_USER'] = auth.username\n end",
"title": ""
},
{
"docid": "f65ed80fc89d134a1161b95bfdb3ce2c",
"score": "0.5707083",
"text": "def authorize\n @credentials = authorizer.get_credentials(user_id)\n if @credentials.nil? || @credentials.expired?\n raise CalendarBot::AuthorizationError\n end\n\n @credentials\n end",
"title": ""
},
{
"docid": "617618cbab2cb8d5f71b79fe37ccff3f",
"score": "0.5680041",
"text": "def login_required\n authorized? || throw(:halt, :access_denied)\n end",
"title": ""
},
{
"docid": "4cc772f757410e4a819429927a28f2ef",
"score": "0.5651187",
"text": "def oauth_token_required\n unless oauth_token\n headers['WWW-Authenticate'] = 'Bearer'\n halt 403, 'OAuth token required'\n end\n end",
"title": ""
},
{
"docid": "3b4d9c4219545e7a448653b8046e2ca9",
"score": "0.56382614",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(ENV['CREDENTIALS_PATH'])\n token_store = Google::Auth::Stores::FileTokenStore.new(file: ENV['TOKEN_PATH'])\n authorizer = Google::Auth::UserAuthorizer.new(client_id, ENV['SCOPE'], token_store)\n user_id = 'default'\n authorizer.get_credentials(user_id)\n end",
"title": ""
},
{
"docid": "22c675e777a6e0721ee44ff468f6467c",
"score": "0.5626166",
"text": "def login_required\n authorized? || throw(:halt, :access_denied)\n end",
"title": ""
},
{
"docid": "85d61a45168fcc298a6792cc5392b068",
"score": "0.5614478",
"text": "def auth_required\n unless Facts.config.user\n Facts.ui.puts \"Authorization required for this task, use `facts config`\"\n exit(0)\n end\n end",
"title": ""
},
{
"docid": "2cdc5aa65e4e81b2eefca27d20283a59",
"score": "0.5614442",
"text": "def check_authorization\n # Decode Basic Auth, future jwt?\n require 'base64'\n\n credentials = request.headers['Authorization']\n\n if credentials.nil?\n render json: { error: 'Missing credentials, Authorization: Basic Auth ([email protected]:usertwo)'}, status: :forbidden\n else\n # Split > decode > split\n credentials = Base64.decode64(credentials.split[1]).split(':')\n\n # Get the creator by email\n @current_creator = Creator.find_by(email: credentials[0].downcase)\n\n # If nil and not able to authenticate with the password, return forbidden 403\n unless @current_creator && @current_creator.authenticate(credentials[1])\n render json: { error: 'Not authorized! Wrong credentials!'}, status: :forbidden\n end\n end\n end",
"title": ""
}
] |
41670aa8ce5514eba444badea48998d6
|
f = FlickrManager.new response = f.flickr.call_method "flickr.collections.getTree"
|
[
{
"docid": "c438b181d76c9461ae0ae6b81f51021f",
"score": "0.0",
"text": "def get_collections xml\n collections = Array.new\n xml.root.elements.each(\"collection\") do |x|\n collections << parse_collection(x)\n end\n return collections\nend",
"title": ""
}
] |
[
{
"docid": "d07571b7daa8b4957062a94e3625d43b",
"score": "0.6634057",
"text": "def get_root token, get_children=false\n uri_str = \"https://#{get_hostname(token)}/sf/v3/Items\"\n if get_children\n uri_str += \"?$expand=Children\"\n end\n uri = URI.parse uri_str\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Get.new uri.request_uri\n request[\"Authorization\"] = get_authorization_header(token)\n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n root = JSON.parse response.body\n puts \"#{root['Id']} #{root['CreationDate']} #{root['Name']}\"\n if root[\"Children\"]\n for child in root[\"Children\"]\n puts \"#{child['Id']} #{child['CreationDate']} #{child['Name']}\"\n end\n end\n return root\n end\nend",
"title": ""
},
{
"docid": "c2732d48d47e4d2817637ea5042b94ef",
"score": "0.6253192",
"text": "def retrieve_flickr\n url = URI(\"https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=9d0358bdb316fb63337122f6d5f8a8a5&text=%23dctech&min_upload_date=#{(Date.today - 30).to_s}&max_upload_date=#{Date.today.to_s}&media=photo&format=json&nojsoncallback=1\")\n request = Net::HTTP::Get.new(url.to_s)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n photos = JSON.parse(http.request(request).body)\n\n collect_flickr_url_and_comments(photos[\"photos\"][\"photo\"])\nend",
"title": ""
},
{
"docid": "00ad8c5fa70fa8cf896f8b243e4258b6",
"score": "0.6162584",
"text": "def get_folder_with_query_parameters(token, item_id)\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{item_id})?$expand=Children&$select=Id,Name,Children/Id,Children/Name,Children/CreationDate\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Get.new uri.request_uri\n request['Authorization'] = get_authorization_header token \n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n root = JSON.parse response.body\n puts \"#{root['Id']} #{root['Name']}\"\n if root[\"Children\"]\n for child in root[\"Children\"]\n puts \"#{child['Id']} #{child['CreationDate']} #{child['Name']}\"\n end\n end\n end \nend",
"title": ""
},
{
"docid": "3ccf89158de49a2b2f95320ad8658ce1",
"score": "0.6084762",
"text": "def tree\n tree = Location.to_tree\n response_json tree\n end",
"title": ""
},
{
"docid": "32d8ed4bfb78c0c09d3fb33b8378bcca",
"score": "0.6077804",
"text": "def tree\n\t\t\t@tree ||= Hpricot.parse(retrieve)\n\t\tend",
"title": ""
},
{
"docid": "fc0697488ad12fd3faaa23aa306c1610",
"score": "0.60476524",
"text": "def make_flickr_coll_hash_tree(coll_tree, hash_tree)\n coll_tree.each { |coll|\n coll_title = coll['title']\n hash_tree[coll_title] = coll.is_a?(FlickRaw::Response) ? coll.to_hash : coll\n if coll['collection']\n coll_subtree = { }\n make_flickr_coll_hash_tree(coll['collection'], coll_subtree)\n hash_tree[coll_title]['collection'] = coll_subtree\n else\n hash_tree[coll_title]['collection'] = { }\n end\n }\nend",
"title": ""
},
{
"docid": "b6b5e1d32fbcd830c95d6a54ba3e200b",
"score": "0.60355717",
"text": "def get_flickr_photos\n require 'rexml/document'\n xml = open(%(http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=#{YAHOO['flickr_key']}&license=4%2C5%2C6%2C7&safe_search=true&woe_id=#{woeid}&extras=url_m&sort=interestingness-desc))\n doc = REXML::Document.new(xml)\n doc.elements.collect('//photo') do |photo_element|\n photo_attributes = { :place_id => self.id }.merge(FlickrPhoto.attributes_from_xml(photo_element.attributes))\n FlickrPhoto.find_or_create_by_flickr_id_and_place_id(photo_attributes)\n end\n end",
"title": ""
},
{
"docid": "24850a0ae69fb5ec2d738a5e4b328775",
"score": "0.5796617",
"text": "def downloadUserPhotosFromFlickr(doc, container)\n\n begin \n @virtualContainerManager = VirtualContainerManager.new(@user, container.dev_name)\n \n nodes = doc.find('//photos/photo')\n \n nodes.each do |node|\n \n if node['farm'] != nil && node['server'] != nil && node['id'] != nil && \n node['secret'] != nil && node['title'] != nil\n \n # Build url \n photo_url = \"http://farm\"+node['farm']+\".static.flickr.com\"\n photo_params = \"/\"+node['server']+\"/\"+node['id']+\"_\"+node['secret']+\".jpg\"\n \n purl = URI.parse(photo_url)\n \n # Get the photo\n photo = Net::HTTP.start(purl.host, purl.port) {|http|\n http.get(photo_params)\n }\n \n filename = '/' + node['title'] + \".jpg\"\n \n @virtualContainerManager.addFile(filename, photo.body)\n puts \"File \" + filename + \" created.\"\n \n ### Get photo info\n getPhotoInfoFromFlickr(node['id'], node['secret'], container, filename) \n \n end\n \n end \n \n rescue => e\n puts e\n end \n @virtualContainerManager.commit\n end",
"title": ""
},
{
"docid": "1adf3aa0f6522fc09b872f99c60d0aad",
"score": "0.5796581",
"text": "def local_photos\n xml = open(\"http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=b5d467685e70a84f79bc78f8d0953555&tags=battersea&sort=date-posted-desc&content_type=1&lat=51.4715810000&lon=-0.1682200000&radius=1&radius_units=km&extras=geo&per_page=20&page=1\") { |f| Hpricot(f) }\n end",
"title": ""
},
{
"docid": "9f601281d094cbf2b8c103a59e56c00f",
"score": "0.5771126",
"text": "def getPhotosFromFlickr\n if params[:getPhotosFromFlickr] && params[:getPhotosFromFlickr] == \"true\" && \n params[:container_name] && params[:privacy_setting]\n \n container = Device.find_by_user_id_and_dev_type_and_dev_name(@user.id, \"virtual_container\", params[:container_name])\n if container == nil\n return false\n end\n \n if params[:privacy_setting] == \"public\"\n privacy_setting = 1\n elsif params[:privacy_setting] == \"private\"\n privacy_setting = 5\n else \n return false\n end\n\n \n # Make photo search in Flickr for User's photos\n method = \"flickr.photos.search\"\n \n calculate_this = \"#{@@flickr_secret}api_key#{@@flickr_api_key}\" +\n \"auth_token#{@flickr_data.s_token}\" +\n \"method#{method}\" +\n \"privacy_filter#{privacy_setting}\" +\n \"user_id#{@flickr_data.s_id}\"\n\n api_sig = Digest::MD5.hexdigest(calculate_this)\n \n \n flickr_url = \"http://api.flickr.com\"\n flickr_params = \"/services/rest/?api_sig=#{api_sig}&\" +\n \"api_key=#{@@flickr_api_key}&\" +\n \"auth_token=#{@flickr_data.s_token}&\" +\n \"method=#{method}&\" +\n \"privacy_filter=#{privacy_setting}&\" +\n \"user_id=#{@flickr_data.s_id}\"\n #puts flickr_params\n begin\n url = URI.parse(flickr_url)\n res = Net::HTTP.start(url.host, url.port) {|http|\n http.get(flickr_params)\n }\n xml = res.body\n if xml == nil\n return false\n end\n \n doc = XML::Document.string(xml) \n #puts \"XML: #{xml}\"\n \n @amountOfPhotosFromFlickr = doc.find_first('//photos')['total']\n puts\n puts \"Number of files to download from Flickr to virtual container: #{@amountOfPhotosFromFlickr}\"\n puts \n if @amountOfPhotosFromFlickr == nil || @amountOfPhotosFromFlickr == \"0\"\n return false\n end \n\n ##### Start new thread for retrieving files from flickr #####\n Thread.new do\n downloadUserPhotosFromFlickr(doc, container) \n end\n ##### END #####\n \n # Set the time when files were fetched\n if privacy_setting == 1\n @flickr_data.update_attribute(:extra_1, Time.now)\n elsif privacy_setting == 5\n @flickr_data.update_attribute(:extra_2, Time.now)\n end\n return true\n rescue => e\n putsE(e)\n end \n end\n \n return false\n end",
"title": ""
},
{
"docid": "408f43bccd8d5d8f8fd5551576b1dab2",
"score": "0.5753014",
"text": "def get_photosets\n config = YAML.load_file(\"config/flickr.yml\")\n @api_key = config['key']\n @user = config['user']\n\n @doc = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=#{@api_key}&user_id=#{@user}\"))\n \n first = true\n flickr_photosets = []\n \n @doc.xpath(\"/rsp/photosets/photoset\").each do |node|\n title = node.children\n \n # get the first photo in the set for the primary photo\n @photoset_photos = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=#{@api_key}&photoset_id=#{node['id']}&per_page=1\"))\n first_photo = @photoset_photos.xpath(\"/rsp/photoset/photo\").first\n \n # now take that id and find me the actual photo\n @set_photo = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=#{@api_key}&photo_id=#{first_photo['id']}\"))\n \n set_photo = \"\"\n \n @set_photo.xpath(\"/rsp/sizes/size\").each do |size|\n if size['label'] == \"Square\"\n set_photo = size['source']\n end\n end\n \n a_class = \"\"\n \n if !params[:setid] && first\n a_class = \"current\"\n elsif params[:setid] == node['id']\n a_class = \"current\"\n end\n \n flickr_photosets.push(\"<a class=\\\"#{a_class}\\\" href=\\\"/photogallery/#{node['id']}\\\"><img src=\\\"#{set_photo}\\\" /><br /><span class=\\\"title\\\">#{title.text}</span></a>\")\n \n # its not the first run through\n first = false\n end\n \n return flickr_photosets\n end",
"title": ""
},
{
"docid": "a2fb34ad149d264337874841f2f810bc",
"score": "0.5752764",
"text": "def get_photo_list(set_id) \n\tphoto_list = flickr.photosets.getPhotos(:photoset_id => set_id)\n\tif @debug.eql? 1 then puts photo_list.inspect end\n\treturn photo_list\nend",
"title": ""
},
{
"docid": "a2fb34ad149d264337874841f2f810bc",
"score": "0.5752764",
"text": "def get_photo_list(set_id) \n\tphoto_list = flickr.photosets.getPhotos(:photoset_id => set_id)\n\tif @debug.eql? 1 then puts photo_list.inspect end\n\treturn photo_list\nend",
"title": ""
},
{
"docid": "81f6cc05acf763767527262e99f1b8d1",
"score": "0.5712607",
"text": "def flickr_albums\n flickr.photosets.getList\n end",
"title": ""
},
{
"docid": "9cf44f762de8ff19d9fa1edafcec6d45",
"score": "0.57076925",
"text": "def flickr_call(name)\n\n FlickRaw.api_key =ENV['API_KEY']\n FlickRaw.shared_secret =ENV['SHARED_SECRET']\n\n picture = flickr.photos.search(\n :text => name,\n :sort => 'interestingness-desc',\n :safe_search => 1,\n :format => 'json',\n :nojsoncallback => 1,\n :per_page => 1,\n :extras => 'url_q'\n )\n puts \"flicker_call complete\"\n return picture[0]\n end",
"title": ""
},
{
"docid": "d5a6b72ebeddbf27e5f14f66892edf0d",
"score": "0.5658249",
"text": "def getPhotoInfoFromFlickr(photo_id, photo_secret, container, filename)\n begin\n \n method = \"flickr.photos.getInfo\" \n \n flickr_url = \"http://api.flickr.com\"\n flickr_params = \"/services/rest/?api_key=#{@@flickr_api_key}&\" +\n \"method=#{method}&\" +\n \"photo_id=#{photo_id}&\" +\n \"secret=#{photo_secret}\"\n \n\n url = URI.parse(flickr_url)\n res = Net::HTTP.start(url.host, url.port) {|http|\n http.get(flickr_params)\n }\n\n xml = res.body\n \n if xml == nil\n #next\n end\n\n doc = XML::Document.string(xml) \n \n # Description\n description = doc.find_first('//photo/description').content\n if description != nil && description.strip != \"\"\n @virtualContainerManager.addMetadata(filename, \"description\", description.strip)\n puts \" Description: #{description}\"\n end\n \n # Datetime taken\n taken = doc.find_first('//photo/dates')['taken']\n if taken != nil && taken.strip != \"\"\n @virtualContainerManager.addMetadata(filename, \"taken\", taken.strip)\n puts \" Picture taken: #{taken}\"\n end\n \n # Tags\n tags = doc.find('//photo/tags/tag')\n tags.each do |tag| \n @virtualContainerManager.addMetadata(filename, \"tag\", tag['raw'])\n puts \" Tag: #{tag['raw']}\"\n end\n \n # Url\n url_photo = doc.find_first('//photo/urls/url').content\n if url_photo != nil && url_photo.strip != \"\"\n @virtualContainerManager.addMetadata(filename, \"url\", url_photo.strip)\n puts \" Photo url: #{url_photo}\"\n end\n \n # Origin\n @virtualContainerManager.addMetadata(filename, \"origin\", \"flickr\")\n \n puts\n puts \"FETCHING METADATA FOR FILE IS NOW DONE.\"\n puts \"\\n\"\n rescue => e\n puts e\n end\n \n return \n end",
"title": ""
},
{
"docid": "9e19580e2388d55a42d7111b79563de0",
"score": "0.5650265",
"text": "def photos\n f = get_flickraw\n params[:limit] ||= 10\n params[:page] ||= 1\n unless params[:q]\n @photos = f.photos.search(\n :user_id => current_user.flickr_identity.flickr_user_id, \n :extras => 'url_s',\n 'per_page' => params[:limit], \n 'page' => params[:page])\n else\n # Try to look up a photo id\n if params[:q].to_i != 0 && params[:q].to_i > 10000\n @photos = [f.photos.getInfo(:photo_id => params[:q])].compact\n else\n @photos = @flickr.photos.search(\n 'user_id' => current_user.flickr_identity.flickr_user_id, \n 'text' => \"#{params[:q]}\",\n :extras => 'url_s',\n 'per_page' => params[:limit],\n 'page' => params[:page]).map do |fp|\n FlickrPhoto.new_from_api_response(fp)\n end\n end\n end\n respond_to do |format|\n format.html\n format.json { render :json => @photos.to_json }\n end\n end",
"title": ""
},
{
"docid": "e51fa6e4593de1a5964cc0f9c97eb0f3",
"score": "0.5648881",
"text": "def flickr_selection\n \"select * from flickr.photos.search where\"\n end",
"title": ""
},
{
"docid": "623ae8ade86576721c8c90c0ac5ca80c",
"score": "0.56452715",
"text": "def call\n tree\n end",
"title": ""
},
{
"docid": "12d9306496b3bdc3b1ca55c425b7520b",
"score": "0.56333405",
"text": "def tree\n render json: serialized_page_tree\n end",
"title": ""
},
{
"docid": "332896e87dae2f51d3f5bb368ce2b0cf",
"score": "0.5627818",
"text": "def call_flickr_api(parameters)\n\n uri = URI.parse( \"http://api.flickr.com/services/rest/\" )\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.path)\n request.set_form_data( parameters )\n request = Net::HTTP::Get.new( uri.path+ '?' + request.body )\n response = http.request(request)\n xml_data = response.body\n\n return xml_data\n end",
"title": ""
},
{
"docid": "facc67ccccdcba84906d6582c9dd4787",
"score": "0.56232315",
"text": "def photos\n \tobject.photos\n end",
"title": ""
},
{
"docid": "605ad365f20dd6f29a4920df12ff9a92",
"score": "0.5619245",
"text": "def listChildCollections() \n @obj.listChildCollections() \n end",
"title": ""
},
{
"docid": "d45e7aa5156ac39b8c9c00934ac361a9",
"score": "0.56130725",
"text": "def flickr_ll(lat, long)\n meters_in_km = 1000\n fk_entities = []\n source_latlng = [lat, long]\n\n radius = \"32\"\n radius_units = \"km\"\n accuracy = 3 # Current range is 1-16 : World level is 1, Country is ~3, Region is ~6, City is ~11, Street is ~16\n days_prior = 5\n min_taken_date = Time.now.to_i - (days_prior * 8640)\n per_page = 10\n\n fk_photos = flickr.photos.search(:lat => lat.to_s, :lon => long.to_s, :radius => radius.to_s,\n :radius_units => radius_units, :accuracy => accuracy.to_s,\n :media => \"photos\", :sort => \"interestingness-desc\",\n :min_taken_date => min_taken_date.to_s, :max_taken_date => Time.now.to_i,\n :per_page => per_page.to_s, :extras => \"description, date_upload, date_taken,\n owner_name, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_z\")\n\n if fk_photos.size > 0\n interestingness_counter = 80\n interestingness_step = interestingness_counter/fk_photos.size\n end\n\n fk_photos.each do |photo|\n photo_latlng = [photo[\"latitude\"], photo[\"longitude\"]]\n entity = Entity.new\n entity.type = \"image\"\n entity.source = \"Flickr\"\n entity.external_url = \"http://www.flickr.com/photos/\" +\n photo[\"owner\"] + \"/\" + photo[\"id\"]\n\n entity.media_url = photo[\"url_z\"]\n\n # Build the caption like so:\n # \"Title\" if description is blank\n # \"Description\" if title is blank\n # \"Title - Description\" if neither are blank\n if !photo[\"title\"].nil? && !photo[\"title\"].empty?\n entity.caption = photo[\"title\"].strip\n else\n entity.caption = \"\"\n end\n if !photo[\"description\"].nil? && !photo[\"description\"].empty?\n if entity.caption == \"\"\n entity.caption += photo[\"description\"]\n else\n entity.caption += \" - \" + photo[\"description\"]\n end\n end\n\n entity.interestingness = interestingness_counter\n interestingness_counter -= interestingness_step\n entity.radius_distance = (Geocoder::Calculations.distance_between(source_latlng, photo_latlng) * 1000)\n\n entity.username = photo[\"pathalias\"]\n entity.real_name = photo[\"ownername\"]\n entity.posted_at = Time.parse(photo[\"datetaken\"])\n\n entity.data = photo\n\n fk_entities << entity\n end\n\n return fk_entities\n end",
"title": ""
},
{
"docid": "9845b665a654e1bdcf11e57eab28467f",
"score": "0.55802745",
"text": "def get_tags\n config = YAML.load_file(\"config/flickr.yml\")\n @api_key = config['key']\n @user = config['user']\n\n @doc = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.tags.getListUser&api_key=#{@api_key}&user_id=#{@user}\"))\n \n flickr_tags =[]\n \n @doc.xpath(\"/rsp/who/tags/tag\").each do |node|\n flickr_tags.push(\"<li id=\\\"#{node.text}\\\"><a href=\\\"/photogallery?tag=#{node.text}\\\">#{node.text}</a></li>\")\n end\n \n return flickr_tags\n end",
"title": ""
},
{
"docid": "66e5c6cc14d72ea0e9fc24d62a660323",
"score": "0.55552214",
"text": "def photos\n return Flikr::Photos.new.search(params)\n end",
"title": ""
},
{
"docid": "73c99e47649c245f734cd11bb91fc0e4",
"score": "0.55519277",
"text": "def gallery\n @layout = params[:layout] && params[:layout].to_s || 'masonry'\n page = params[:page] && params[:page].to_i || 20\n page_size = params[:page_size] && params[:page_size].to_i || 12\n @flickr = FlickrClient.new.fetch(page: page, page_size: page_size)\n respond_to do |format|\n format.html\n format.json do\n render json: @flickr\n end\n end\n end",
"title": ""
},
{
"docid": "868b8a8c855094092d39701e759d422f",
"score": "0.5548865",
"text": "def crawl_flickr(group_id = '74191472@N00')\n return unless group_id\n\n key = '86c115028094a06ed5cd19cfe72e8f8b'\n (1..1000).each do |page|\n api = \"https://api.flickr.com/services/rest/?api_key=#{key}&method=flickr.photos.search&page=#{page}&per_page=10&content_type=1&group_id=#{group_id}\"\n puts api\n begin\n response = URI.parse(api).open\n rescue # random 502 bad gateway from Flickr\n sleep(5)\n response = URI.parse(api).open\n end\n doc = REXML::Document.new(response.read)\n pages = doc.root.elements['photos'].attributes['pages']\n puts \"#{page} of #{pages}\"\n doc.elements.each('//rsp/photos/photo') do |photo|\n $stdout.flush\n photo_url = \"https://www.flickr.com/photos/#{photo.attributes['owner']}/#{photo.attributes['id']}/\"\n @photo = Photo.new(url: photo_url)\n @photo.populate\n @photo.match\n @photo.save\n end\n break if page.to_i >= pages.to_i\n end\n end",
"title": ""
},
{
"docid": "00575c9ef9fcb041d09b0d3abe5c6093",
"score": "0.55474114",
"text": "def get_list(auth_token, nsid='', extras=[], per_page=100, page=1)\n method = 'flickr.favorites.getList'\n api_sig = _get_api_sig(\n {\n 'method' => method,\n 'auth_token' => config['token'],\n 'user_id' => nsid,\n 'extras' => extras.join(','),\n 'per_page' => per_page,\n 'page' => page\n }\n )\n data = _do_get(method,\n {\n 'api_sig' => api_sig,\n 'auth_token' => config['token'],\n 'user_id' => nsid,\n 'extras' => extras.join(','),\n 'per_page' => per_page,\n 'page' => page\n }\n )\n doc = Document.new(data)\n photos = []\n doc.elements.each('rsp/photos/photo') { |photo|\n photos << {\n 'id' => photo.attributes['id'],\n 'owner' => photo.attributes['owner'],\n 'ispublic' => photo.attributes['ispublic'],\n 'isfamily' => photo.attributes['isfamily'],\n 'isfriend' => photo.attributes['isfriend'],\n 'title' => photo.attributes['title'],\n 'license' => photo.attributes['license'],\n 'owner_name' => photo.attributes['ownername'],\n 'date_taken' => photo.attributes['datetaken'],\n 'date_upload' => photo.attributes['dateupload']\n }\n }\n return photos\n end",
"title": ""
},
{
"docid": "00575c9ef9fcb041d09b0d3abe5c6093",
"score": "0.55474114",
"text": "def get_list(auth_token, nsid='', extras=[], per_page=100, page=1)\n method = 'flickr.favorites.getList'\n api_sig = _get_api_sig(\n {\n 'method' => method,\n 'auth_token' => config['token'],\n 'user_id' => nsid,\n 'extras' => extras.join(','),\n 'per_page' => per_page,\n 'page' => page\n }\n )\n data = _do_get(method,\n {\n 'api_sig' => api_sig,\n 'auth_token' => config['token'],\n 'user_id' => nsid,\n 'extras' => extras.join(','),\n 'per_page' => per_page,\n 'page' => page\n }\n )\n doc = Document.new(data)\n photos = []\n doc.elements.each('rsp/photos/photo') { |photo|\n photos << {\n 'id' => photo.attributes['id'],\n 'owner' => photo.attributes['owner'],\n 'ispublic' => photo.attributes['ispublic'],\n 'isfamily' => photo.attributes['isfamily'],\n 'isfriend' => photo.attributes['isfriend'],\n 'title' => photo.attributes['title'],\n 'license' => photo.attributes['license'],\n 'owner_name' => photo.attributes['ownername'],\n 'date_taken' => photo.attributes['datetaken'],\n 'date_upload' => photo.attributes['dateupload']\n }\n }\n return photos\n end",
"title": ""
},
{
"docid": "db81d100d9f1d9c3d818fe80eb14dc44",
"score": "0.5545748",
"text": "def getTree\n #render :text => generateTree\n end",
"title": ""
},
{
"docid": "02feef8bc010231f43ac5f9ccd2f414b",
"score": "0.5544345",
"text": "def rest__debug_get_project_trees\n ServiceModule.get_project_trees(model_handle)\n rest_ok_response\n end",
"title": ""
},
{
"docid": "89814bbcb3d15d6743f1ac0aa7a703ad",
"score": "0.5543869",
"text": "def getInfo\n info = @client.photosets_getInfo('photosets_id'=>@id)['photoset']\n @owner = User.new(info['owner'])\n @primary = info['primary']\n @photos = info['photos']\n @title = info['title']\n @description = info['description']\n @url = \"http://www.flickr.com/photos/#{@owner.getInfo.username}/sets/#{@id}/\"\n self\n end",
"title": ""
},
{
"docid": "741456c913647e836d519ccb4070717c",
"score": "0.5536474",
"text": "def tree\n return @tree if @tree\n path = \"repos/#{owner}/#{name}/git/trees/master\"\n response = json_get(path, :params => {:recursive => true} )\n @tree = response[:tree]\n end",
"title": ""
},
{
"docid": "7d49cd256209f0156fb8ce844a4bb212",
"score": "0.5529024",
"text": "def crawl_flickr(group_id='74191472@N00')\n return if !group_id\n key = \"86c115028094a06ed5cd19cfe72e8f8b\"\n (1..1000).each do |page|\n q_url = \"https://api.flickr.com/services/rest/?api_key=#{key}&method=flickr.photos.search&page=#{page.to_s}&per_page=10&content_type=1&group_id=#{group_id}\"\n puts q_url\n begin\n response = open(q_url)\n rescue # random 502 bad gateway from Flickr\n sleep(5)\n response = open(q_url)\n end\n doc = REXML::Document.new(response.read)\n pages = doc.root.elements['photos'].attributes['pages']\n puts \"#{page} of #{pages}\"\n doc.elements.each('//rsp/photos/photo') do |photo|\n $stdout.flush\n photo_url = \"https://www.flickr.com/photos/#{photo.attributes['owner']}/#{photo.attributes['id']}/\"\n @photo = Photo.new(url: photo_url)\n @photo.populate\n @photo.match\n @photo.save\n end\n break if page.to_i >= pages.to_i\n end\n end",
"title": ""
},
{
"docid": "22a3f90ca61a7af615731143d007f42d",
"score": "0.5508866",
"text": "def getPhotos(photosetid, page)\n\tphotoset = flickr.photosets.getPhotos(:photoset_id => photosetid, :privacy_filter => PRIVACY_FILTER, :media => MEDIA, :page => page)\nend",
"title": ""
},
{
"docid": "79012b4edd4b1c82668d68e1053b5e2a",
"score": "0.54997516",
"text": "def find_all\n rsp = @fotolia.remote_call('getGalleries', @fotolia.language.id)\n\n rsp.collect{|g| Fotolia::Gallery.new(@fotolia, g)}\n end",
"title": ""
},
{
"docid": "141ae1338c0af7dfcd968899effc38fa",
"score": "0.54921365",
"text": "def getInfo\n info = @client.photosets_getInfo('photoset_id'=>@id)['photoset']\n @owner = User.new(info['owner'], nil, nil, nil, @api_key)\n @primary = info['primary']\n @photos = info['photos']\n @title = info['title']\n @description = info['description']\n @url = \"http://www.flickr.com/photos/#{@owner.getInfo.username}/sets/#{@id}/\"\n self\n end",
"title": ""
},
{
"docid": "dddbee552d39e53279a8073dc891f823",
"score": "0.548499",
"text": "def tree(project, options={})\n get(\"/projects/#{project}/repository/tree\", query: options)\n end",
"title": ""
},
{
"docid": "9546ed630cf4b6f1d90bfd811c8b3739",
"score": "0.5448638",
"text": "def ObtFotos(filtro, numero)\n\t\t$Search = flickr.photos.search(:tags => filtro, :per_page => numero, :page => 1\n\tend\n\t\n\t#Funcion para ingresar los datos en una variable\n\tdef IngreInfo()\n\t\tfor foto in $Search do\n\t\t\tinfo = flickr.photos.getInfo(:photo_id => foto.id)\n\t\t\t$Fotografia.push(info.title)\n\t\t\t$Fotografia.push(FlickRaw.url_q(info))\n\t\t\t$Lista.push($Fotografia)\n\t\t\t$Fotografia = []\n\t\tend\n\t\t$Tamaño = $Lista.length\n\tend\n\t\n\t#Funcion para obtener las informacion de las fotos\n\tdef ObtInfo()\n\t\tfor foto in $Lista do\n\t\t\tputs \"Numero \" + $Contador.to_s\n\t\t\t$Contador = $Contador + 1\n\t\t\tputs \"Titulo : \" + foto[0]\n\t\t\tputs \"Url: \" + foto[1]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1f061ab7101960a40c7b23f869f0ca32",
"score": "0.54472315",
"text": "def tree\n @tree ||= Tree.new(@client, @version)\n end",
"title": ""
},
{
"docid": "90224bf0cd79ab594a218cb4082a8ffe",
"score": "0.5446729",
"text": "def index\n @entitys =Entity.all\n ret= get_tree @entitys\n render :json => {:successful=>true, :total=> (ret.blank?)? 0:1 , :data=> @ret }\n end",
"title": ""
},
{
"docid": "84e0c4be8107c022ccf624044fd88406",
"score": "0.5436136",
"text": "def show_tree\n all_roots=Category.roots\n @root=all_roots.all(:conditions=>[\"master_map_id=?\",session[:current_image]])\n \n end",
"title": ""
},
{
"docid": "3fd56edd39c6942b87ee243dd8f04cbc",
"score": "0.5433544",
"text": "def nodes\n get 'nodes'\n end",
"title": ""
},
{
"docid": "9dc823803d8ab09df4a626fa6fbf6661",
"score": "0.5430045",
"text": "def retreive_flickr_photos\n return [] if params[:flickr_photos].nil?\n\n flickr = get_net_flickr\n photos = []\n params[:flickr_photos].reject {|i| i.empty?}.uniq.each do |photo_id|\n if fp = FlickrPhoto.find_by_flickr_native_photo_id(photo_id)\n photos << fp \n else\n fp = flickr.photos.get_info(photo_id)\n photos << FlickrPhoto.new_from_net_flickr(fp)\n end\n end\n photos\n end",
"title": ""
},
{
"docid": "654fabe89a427a6a5d6f1e2d5c10ee3f",
"score": "0.54247284",
"text": "def show_json\n Tumblr.fetch_json\nend",
"title": ""
},
{
"docid": "18c5824e17b23300265390f92b1b44cd",
"score": "0.5413478",
"text": "def show_tree\n Log.add_info(request, params.inspect)\n\n get_tree\n end",
"title": ""
},
{
"docid": "95b6ec40ce72877aa50d947e6dc2cea3",
"score": "0.5411328",
"text": "def extract_children(category_response, searchIndex)\n # log = Logger.new('../log/debug.log')\n browse_categories = []\n category_response.response.browse_nodes.each{|top_browse_nodes|\n parentId = top_browse_nodes.browse_node_id\n parentName = top_browse_nodes.name\n # log.debug \"\\n Top Browse Node Name: \" + top_browse_nodes.name.to_s + \"\\n\"\n #Since the calls are dynamic, i need to handle the noMethodError because children is not always a method that's part of the top_browse_nodes object\n begin\n top_browse_nodes.children.each{|child|\n puts \"\\n >>>>>>Child Name: \" + child.name.to_s + \"\\n\"\n browseNodeId = child.browse_node_id\n name = child.name\n category = Category.new\n category.name = name\n category.description = name + \" \" + browseNodeId\n category.vendorCategoryId = browseNodeId\n category.vendor = \"Amazon\"\n category.parentCategoryId = parentId\n category.searchIndex = searchIndex\n \n #puts \"\\n IN CATEGORY OBJECT SEARCHINDEX: \" + category.searchIndex + \" \\n\\n\"\n \n category.parentCategoryName = parentName\n category.operation = \"BrowseNodeLookup\"\n browse_categories.push(category)\n }\n rescue NoMethodError\n next\n end\n }\n browse_categories\n end",
"title": ""
},
{
"docid": "317e5c1fbf61b92f0acfba8d14472ae2",
"score": "0.540346",
"text": "def index\n @flickr_photos = FlickrPhoto.all\n end",
"title": ""
},
{
"docid": "af29ec5e3c87a680eb25b921efdbe9e6",
"score": "0.5397278",
"text": "def photos_request(method, params={}, list_node=\"photos\")\n photos = request(method, params)\n PhotoCollection.new(photos, @api_key, list_node)\n end",
"title": ""
},
{
"docid": "f6c46efec3899a6fd4369fbaea7398d2",
"score": "0.53901523",
"text": "def find(*args)\n path = \"galleryphotos\"\n Rdigg.fetch(path, @@type, args)\n end",
"title": ""
},
{
"docid": "aadf7b08fd26f7dc927ee43e812575d3",
"score": "0.5388065",
"text": "def tree\n @media_object = MediaObject.find(params[:id])\n authorize! :inspect, @media_object\n\n respond_to do |format|\n format.html {\n render 'tree', :layout => !request.xhr?\n }\n format.json {\n result = { @media_object.id => {} }\n @media_object.indexed_master_files.each do |mf|\n result[@media_object.id][mf.id] = mf.derivatives.collect(&:id)\n end\n render :json => result\n }\n end\n end",
"title": ""
},
{
"docid": "98e45968f1000ed4c6e9c3c4bf14b19d",
"score": "0.53842",
"text": "def get_tree\n @api.get_account_tree(id, 'simple')['tree']['folder']\n end",
"title": ""
},
{
"docid": "4a590f294c98940f7e6dd8b47883dad5",
"score": "0.5379679",
"text": "def search\n #the API key \n flickr = Flickr.new 'b715a2a59427bb1bbc91683af31877f5'\n \n begin\n render :partial => \"photo\", :collection => flickr.photos(:tags => params[:tags], \n :license => params[:commercial_use], :per_page => '8', :sort => \"interestingness-desc\")\n rescue\n render :partial => \"no_photo\"\n end\n end",
"title": ""
},
{
"docid": "45f370b668b18b5cd28e79e7e39a0933",
"score": "0.536665",
"text": "def public_photos(options = {})\n options.merge!({:user_id => self.nsid, :extras => \"license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media\"})\n\n rsp = @flickr.send_request('flickr.people.getPublicPhotos', options)\n\n returning Flickr::Photos::PhotoResponse.new(:page => rsp.photos[:page].to_i,\n :pages => rsp.photos[:pages].to_i,\n :per_page => rsp.photos[:perpage].to_i,\n :total => rsp.photos[:total].to_i,\n :photos => [],\n :api => self,\n :method => 'public_photos',\n :options => options) do |photos|\n rsp.photos.photo.each do |photo|\n attributes = {:id => photo[:id], \n :owner => photo[:owner], \n :secret => photo[:secret], \n :server => photo[:server], \n :farm => photo[:farm], \n :title => photo[:title], \n :is_public => photo[:ispublic], \n :is_friend => photo[:isfriend], \n :is_family => photo[:isfamily],\n :license_id => photo[:license].to_i,\n :uploaded_at => (Time.at(photo[:dateupload].to_i) rescue nil),\n :taken_at => (Time.parse(photo[:datetaken]) rescue nil),\n :owner_name => photo[:ownername],\n :icon_server => photo[:icon_server],\n :original_format => photo[:originalformat],\n :updated_at => (Time.at(photo[:lastupdate].to_i) rescue nil),\n :geo => photo[:geo],\n :tags => photo[:tags],\n :machine_tags => photo[:machine_tags],\n :o_dims => photo[:o_dims],\n :views => photo[:views].to_i,\n :media => photo[:media]}\n\n photos << Flickr::Photos::Photo.new(@flickr, attributes)\n end if rsp.photos.photo\n end\n end",
"title": ""
},
{
"docid": "a6a13dcf8cf4ce83cdef5b35e328fc77",
"score": "0.53362775",
"text": "def get_albums\n \t json = call_api(\"#{base_url}\", {})\n\n \t return json[\"data\"]\n \tend",
"title": ""
},
{
"docid": "780a9c2186e1c140d98dab4d2ca5ab5b",
"score": "0.5330734",
"text": "def pictures\n render json: @collection.pictures\n end",
"title": ""
},
{
"docid": "e32ca8075bfe71b01c9b0c96e5743e20",
"score": "0.5325592",
"text": "def get_photo_sets()\n\t####\n\t# Get list of all photosets - in an array\n\tphotosets = flickr.photosets.getList\n\n\t####\n\t# List each photoset title\n\n\t#photoset_titles = []\n\t#photosets.each do |current_set|\n\t#\tphotoset_titles << current_set[\"title\"]\n\t#end\n\n\t#if @debug.eql? 1 then puts photoset_titles.inspect end\n\n\treturn photosets\n\nend",
"title": ""
},
{
"docid": "e32ca8075bfe71b01c9b0c96e5743e20",
"score": "0.5325592",
"text": "def get_photo_sets()\n\t####\n\t# Get list of all photosets - in an array\n\tphotosets = flickr.photosets.getList\n\n\t####\n\t# List each photoset title\n\n\t#photoset_titles = []\n\t#photosets.each do |current_set|\n\t#\tphotoset_titles << current_set[\"title\"]\n\t#end\n\n\t#if @debug.eql? 1 then puts photoset_titles.inspect end\n\n\treturn photosets\n\nend",
"title": ""
},
{
"docid": "501fcb016ff1110da7b3eb176a1a135f",
"score": "0.53168154",
"text": "def get_from_reddit\n\n\n\n url = 'http://reddit.com/top.json'\n response = RestClient.get(url)\n result = JSON.parse(response)\n \n posts.each do |post|\n parsed [\"title\", \"subreddit\"]\n end\n\n #{post[\"url_title\"].capitalize} - #{post[\"url\"]}\"\n parsed [\"data\"][\"children\"].each do |reddit| puts [\"data\"][\"title\"] end\n\n parsed [\"data\"][\"children\"].map do |reddit| \n\n story = { title:reddit[\"data\"][\"title\"], category:reddit[\"data\"][\"title\"] \n\n calculates_upvotes(story)\n story\n\n end\n\n\n\n\nend",
"title": ""
},
{
"docid": "2159546a117c6618000f59dc766b5d89",
"score": "0.53144413",
"text": "def test_echo\n r = @f.call(\"flickr.test.echo\")\n assert(r.ok?, \"response should be ok\")\n assert_equal(r[\"method\"][\"_content\"], \"flickr.test.echo\", \"method name should echo\")\n end",
"title": ""
},
{
"docid": "7ac645d99eeec2d464674ea6d60f2c01",
"score": "0.53094304",
"text": "def tree\n @mediaobject = MediaObject.find(params[:id])\n authorize! :inspect, @mediaobject\n\n respond_to do |format|\n format.html { \n render 'tree', :layout => !request.xhr?\n }\n format.json { \n result = { @mediaobject.pid => {} }\n @mediaobject.parts_with_order.each do |mf|\n result[@mediaobject.pid][mf.pid] = mf.derivatives.collect(&:pid)\n end\n render :json => result \n }\n end\n end",
"title": ""
},
{
"docid": "3233e0c4bab7a666f6df4e307e067438",
"score": "0.5308638",
"text": "def recent\n photos_request('photos.getRecent')\n end",
"title": ""
},
{
"docid": "8cd826720b79d299f4add972ac2a8fb6",
"score": "0.5298696",
"text": "def get_tags\n config = YAML.load_file(\"config/flickr.yml\")\n @api_key = config['key']\n @user = config['user']\n\n @doc = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.tags.getListUser&api_key=#{@api_key}&user_id=#{@user}\"))\n \n flickr_tags =[]\n \n @doc.xpath(\"/rsp/who/tags/tag\").each do |node|\n if !node.text.match(/\\d+/).nil?\n flickr_tags.push(\"<li id=\\\"#{node.text}\\\"><a href=\\\"/photos/#{node.text}\\\">#{node.text}</a></li>\")\n end\n end\n \n return flickr_tags\n end",
"title": ""
},
{
"docid": "3b5c3fbdd3b711c5464f900e96339fb2",
"score": "0.5292964",
"text": "def get_metadata(cloud_file)\n connexion = Box.client(BASE_URL)\n sign_connexion(connexion)\n if cloud_file.is_dir.nil? || cloud_file.is_dir == \"true\"\n cloud_file.is_dir = true\n elsif cloud_file.is_dir == \"false\"\n cloud_file.is_dir = false\n end\n resource = cloud_file.is_dir ? \"folders\" : \"files\"\n id = cloud_file.id || '0'\n\n response = connexion.get \"#{resource}/#{id}\"\n response = Box.format_metadata(response)\n\n tree_cache(response)\n end",
"title": ""
},
{
"docid": "88029401e53fab822ad1cff2e8c397ec",
"score": "0.5292431",
"text": "def getRoadTree\n\tDRb.start_service\n\treturn DRbObject.new_with_uri(SERVER_URI)\t\nend",
"title": ""
},
{
"docid": "48c042c37b1906c6679bbbf2f84f0679",
"score": "0.52917945",
"text": "def photos\n @flickr = get_net_flickr\n @flickr.auth.token = @user.flickr_identity.token\n params[:limit] ||= 10\n params[:page] ||= 1\n unless params[:q]\n @photos = @flickr.photos.get_public_photos(\n @user.flickr_identity.flickr_user_id, \n {'per_page' => params[:limit], 'page' => params[:page]})\n else\n # Try to look up a photo id\n if params[:q].to_i != 0 && params[:q].to_i > 10000\n @photos = [@flickr.photos.get_info(params[:q])].compact\n else\n @photos = @flickr.photos.search({\n 'user_id' => @user.flickr_identity.flickr_user_id, \n 'text' => \"#{params[:q]}\",\n 'per_page' => params[:limit],\n 'page' => params[:page]}).map do |fp|\n FlickrPhoto.new_from_net_flickr(fp)\n end\n end\n end\n respond_to do |format|\n format.html\n format.js do\n @i = params[:i] || 1\n render\n end\n format.json { render :json => @photos.to_json }\n end\n end",
"title": ""
},
{
"docid": "e3e3575d4ffad0952ea9c1c9128c8a77",
"score": "0.52916557",
"text": "def get_from_reddit\n response = RestClient.get(\"http://reddit.com/top.json\")\n parsed_response = JSON.load(response)\n parsed_response[\"data\"][\"children\"].map do |reddit|\n story = { title: reddit[\"data\"][\"title\"], category: reddit[\"data\"][\"subreddit\"] }\n calculate_upvotes(story)\n story\n end\nend",
"title": ""
},
{
"docid": "f7e3ddae6dce68e2110d6f92954e68b9",
"score": "0.5291424",
"text": "def get_photos\n\t\turi = URI(\"https://www.flickr.com/services/rest/\")\n\t\tparams = { \tmethod: 'flickr.photos.search',\n\t\t\t\t\tapi_key: ENV[\"PUBLIC_KEY\"],\n\t\t\t\t\ttext: self.terms,\n\t\t\t\t\tformat: 'json',\n\t\t\t\t\tprivacy_filter: 1,\n\t\t\t\t\tsafe_search: 1,\n\t\t\t\t\tcontent_type: 1,\n\t\t\t\t\tper_page: 12\n\t\t\t\t}\n\t\turi.query = URI.encode_www_form(params)\n\t\t@res = Net::HTTP.get_response(uri)\n\n\t\t# Flickr API returns an oddly formatted JSON object with a \n\t\t#weird precursor and closing ')', remove it.\n\t\tbody = @res.body.gsub(\"jsonFlickrApi(\", '')\n\t\tbody = JSON.parse(body[0, body.length-1])\n\n\t\t# Make sure the the photos are present and there are no errors.\n\t\tif body['code']\n\t\t\tself.error = body['code']\n\t\telse\n\t\t\tself.images = []\n\t\t\tbody['photos']['photo'].each do |p|\n\t\t\t\turl = \"https://farm#{p['farm']}.staticflickr.com/#{p['server']}/#{p['id']}_#{p['secret']}_q.jpg\"\n\t\t\t\timages << url\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "748f4a4f5d3055511561af1db5d8cb86",
"score": "0.5286468",
"text": "def index\n @nodes = @account.nodes.hash_tree\n # puts @nodes.to_json\n # render :json => @nodes\n end",
"title": ""
},
{
"docid": "f6afafbd5e1e69b448346f87c6788675",
"score": "0.52851367",
"text": "def get_recent(options = {})\n options.merge!({:extras => \"license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media\"})\n\n rsp = @flickr.send_request('flickr.photos.getRecent', options)\n\n returning PhotoResponse.new(:page => rsp.photos[:page].to_i,\n :pages => rsp.photos[:pages].to_i,\n :per_page => rsp.photos[:perpage].to_i,\n :total => rsp.photos[:total].to_i,\n :photos => [], :api => self,\n :method => 'flickr.photos.getRecent',\n :options => options) do |photos|\n rsp.photos.photo.each do |photo|\n attributes = create_attributes(photo)\n\n photos << Photo.new(@flickr, attributes)\n end if rsp.photos.photo\n end\n end",
"title": ""
},
{
"docid": "506c55ef1310bb4aa4d3f7e292c56c60",
"score": "0.52850866",
"text": "def listAlbums(data)\n\nend",
"title": ""
},
{
"docid": "52102a5c1acf7bba470c0d849cf2defe",
"score": "0.52727544",
"text": "def tree()\n @tree\n end",
"title": ""
},
{
"docid": "db7514bc8e6e8c572f5781d2be0fae2e",
"score": "0.5267463",
"text": "def fetch_make_model_tree\n fetch(\"makeModelTree\",\"node\")\n end",
"title": ""
},
{
"docid": "49c78b1c88aa0f9e0982fddac04badb9",
"score": "0.52652574",
"text": "def get_all_photos(userid)\n\n\tall_photos = [] \n\t\n\t####\n\t# Note that this only gives 100 photos at a time. We can change that\n\t# to a maximum of 500 per page. We have \n\t# to iterate through every 'page' of photos that flickr has for us, \n\t# each time increasing the page number. I wonder how I can get the maximum\n\t# number of pages. \n\n\t####\n\t# set this to a non empty array with nothing in it.. :-D \n\tcurrent_page_photos = [\"empty\"] \n\n\t####\n\t# our current page of photos\n\tpage = 0 \n\t\n\n\t####\n\t# While the current page has more than 0 pictures on it, essentially\n\twhile current_page_photos.length > 0 \t\n\t\tif @debug.eql? 1 then puts \"DEBUG: Page #{page}\" end \n\t\tpage = page + 1\n\t\tcurrent_page_photos = flickr.photos.search(:user_id => userid, :per_page => '500', :page => page) \n\n\t\t####\n\t\t# Add those photos to the list of previously aquired photos. \n\t\tall_photos << current_page_photos\n\tend \t\t\n\t\n\tif @debug.eql? 1 then puts all_photos.inspect end \n\n\t#####\n\t# It would be cool if we could generate a data structure that included the TAGS as keys, pointing the pic that\n\t# used that tag. Since most of our tags will be unique, this will work. If a tag DOES repeat\n\t# (in a non-sha tag, for example) then we can just have an array of photos that the tag applies to. \n\t# this is a little backwards, but i think it will work. Do it here, before returning all_photos.\n\n\n\t#\n\t#\n\t####\n\treturn all_photos\nend",
"title": ""
},
{
"docid": "30b86588305ea4eec9f81f911440e9d9",
"score": "0.52648467",
"text": "def obtener_fotos(filtro, numero)\n\t\t$Fotos = flickr.photos.search(:tags => filtro, :per_page => numero, :page => 1)\n\tend",
"title": ""
},
{
"docid": "7a9b9a77fa4d02d90238d00bd6eff6d4",
"score": "0.5262705",
"text": "def get_album_images(hash)\n response = make_request(\"GET\", \"album/#{hash}/images\")\n return response\nend",
"title": ""
},
{
"docid": "74906a3e0e2a5fb08d3ae0731d4ea932",
"score": "0.5260537",
"text": "def get_all_photos(userid)\n\n\tall_photos = [] \n\t\n\t####\n\t# Note that this only gives 100 photos at a time. We can change that\n\t# to a maximum of 500 per page. We have \n\t# to iterate through every 'page' of photos that flickr has for us, \n\t# each time increasing the page number. I wonder how I can get the maximum\n\t# number of pages. \n\n\t####\n\t# set this to a non empty array with nothing in it.. :-D \n\tcurrent_page_photos = [\"empty\"] \n\n\t####\n\t# our current page of photos\n\tpage = 0 \n\t\n\n\t####\n\t# While the current page has more than 0 pictures on it, essentially\n\twhile current_page_photos.length > 0 \t\n\t\tif @debug.eql? 1 then puts \"DEBUG: Page #{page}\" end \n\t\tpage = page + 1\n\t\tcurrent_page_photos = flickr.photos.search(:user_id => userid, :per_page => '500', :page => page) \n\t\tif @debug.eql? 1 then puts \"DEBUG: current_page_photos = #{current_page_photos.inspect}\" end \n\t\tif @debug.eql? 1 then puts \"DEBUG: current_page_photos.length = #{current_page_photos.length}\" end \n\n\t\t####\n\t\t# Add those photos to the list of previously aquired photos. \n\t\tall_photos << current_page_photos\n\tend \t\t\n\t\n\tif @debug.eql? 1 then puts all_photos.inspect end \n\n\t#####\n\t# It would be cool if we could generate a data structure that included the TAGS as keys, pointing the pic that\n\t# used that tag. Since most of our tags will be unique, this will work. If a tag DOES repeat\n\t# (in a non-sha tag, for example) then we can just have an array of photos that the tag applies to. \n\t# this is a little backwards, but i think it will work. Do it here, before returning all_photos.\n\n\n\t#\n\t#\n\t####\n\treturn all_photos\nend",
"title": ""
},
{
"docid": "4d5772c8e68edf12a90a05ebc7c9f087",
"score": "0.52564305",
"text": "def query\n self.class.pearlist(:justme => @resource[:name].split('/').pop)\n end",
"title": ""
},
{
"docid": "34745e11a467275143003a00c4fc7a50",
"score": "0.5254739",
"text": "def get_pictures\n response = RestClient.get(@url)\n parsed_response = JSON.parse(response)\n\n parsed_response[\"data\"][\"children\"].map do |post|\n photo = post['data']['thumbnail'] \n @posts << {photo: photo}\n end\n end",
"title": ""
},
{
"docid": "0a0c864d6b73a7b6b9c605f6b18c0945",
"score": "0.5252363",
"text": "def get_photo_list(config, options)\n begin\n log.debug{\"inside #{get_method}\"}\n remaining_photos = options[:maxphotos]\n fetched_photos = 0\n available_photos = 1\n on_page = 0\n complete_photo_list = Array.new\n\n #fetch all the photos at once unless the requested number is greater than\n #the limit set by flicker - if so we will make multiple 'page' calls to flickr\n per_page_photo_count = options[:maxphotos] > FLICKR_PER_PAGE_LIMIT ? FLICKR_PER_PAGE_LIMIT : options[:maxphotos]\n\n # find the real flickr user identifier not their username\n # use the one specified on the command line options not in\n # the credentials, they can be the same but don't need to be\n log.debug('checking the user name')\n if !options[:getfaves]\n flickr_user = flickr.people.findByUsername( :username => options[:username] )\n # override options username b/c flickr may have differnet case rules but finds it\n # we need it for cleaning up files later on\n options[:username] = flickr_user.username\n end\n\n # don't get any more photos than the user asked for or try to get more than are available\n # we assume that there is at least one to allow the loop to run the first time and avoid\n # extra calls to flickr\n log.debug('getting the photo list')\n while fetched_photos < options[:maxphotos] && available_photos > fetched_photos\n on_page += 1\n if options[:getfaves] == true\n photo_list = flickr.favorites.getList(:api_key => config[:api_key], :token => config[:oauth_access_token], \\\n :user_id => config[:nsid], :page => on_page, :per_page => per_page_photo_count, \\\n :sort => 'date-posted-desc', :extras => \"date_upload,date_taken,owner_name\" )\n else\n photo_list = flickr.photos.search(:api_key => config[:api_key], :sort => 'date-posted-desc', \\\n :user_id => flickr_user.nsid, :page => on_page, :per_page => per_page_photo_count, \\\n :tags => options[:tags], :extras => \"date_upload,date_taken,owner_name\" )\n end\n log.debug{'have the photo list now'}\n log.debug{\"photo list = \"}\n log.debug{photo_list.marshal_dump}\n\n fetched_photos += photo_list.length\n available_photos = photo_list.total.to_i\n remaining_photos = (options[:maxphotos] - fetched_photos)\n\n # combine the fetched results into one big list to hand back\n # FlickRaw::ResponseList\n # http://hanklords.github.com/flickraw/FlickRaw/ResponseList.html\n # for some reason ResponseList does not show up in the object index of rdoc on GitHub\n # as of this writing 12/24/2012\n complete_photo_list += photo_list.to_a\n\n # reset the per_page_photo_count if we only need a partial page\n # as per above, per_page_photo count is set to the max allowed by\n # flickr - as long as that is greater than the remaining photos we\n # stick with it - this keeps the number of calls to flickr to the minimum\n per_page_photo_count = remaining_photos > per_page_photo_count ? per_page_photo_count : remaining_photos\n\n end\n rescue Exception => ex\n log.info(ex)\n exit\n end\n\n log.debug{\"complete photo list\"}\n log.debug{complete_photo_list}\n log.debug{\"exiting #{get_method}\"}\n return complete_photo_list, options\n end",
"title": ""
},
{
"docid": "a1d153282ee26948dbab95f022a8d8e1",
"score": "0.52489555",
"text": "def linodeList\n \tmake_request this_method\n end",
"title": ""
},
{
"docid": "edd5b5f3033d03f81f73b1159c64a4c6",
"score": "0.5242512",
"text": "def fetch\n path = @parent.build_request_path(@params)\n method = @parent.method_for(:find)\n @parent.request(@params.merge(:_method => method, :_path => path)) do |parsed_data, response|\n @parent.new_collection(parsed_data)\n end\n end",
"title": ""
},
{
"docid": "69a903437ec231403d9de45d4f46604a",
"score": "0.5235246",
"text": "def all\n @tree = Fiddle.tree( Fiddle.all )\n render :index\n end",
"title": ""
},
{
"docid": "8f67047de8988938cf56cb7474b82d7c",
"score": "0.5230728",
"text": "def __getobj__\n photos\n end",
"title": ""
},
{
"docid": "f0d59a689097613736bc4adc838a075b",
"score": "0.5230182",
"text": "def index\n @flickr_photos = FlickrPhoto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @flickr_photos }\n end\n end",
"title": ""
},
{
"docid": "59f6f3fa45998a4a70a3b18c1390249a",
"score": "0.52283925",
"text": "def objectify(tree, parent: nil)\n if tree['results']\n type = tree['__metadata']&.[]('type') || tree['results'][0]&.[]('__metadata')&.[]('type') || ''\n pattern, klass = COLLECTION_MAP.any? { |pattern,| pattern.match(type) }\n klass ||= :Collection\n RestfulSharePoint.const_get(klass).new(connection: self, parent: parent, collection: tree['results'])\n elsif tree['__metadata']\n type = tree['__metadata']['type']\n raise \"Object type not specified. #{tree.inspect}\" unless type\n pattern, klass = OBJECT_MAP.find { |pattern,| pattern.match(type) }\n klass ? RestfulSharePoint.const_get(klass).new(connection: self, parent: parent, properties: tree) : tree\n else\n tree\n end\n end",
"title": ""
},
{
"docid": "57ca62d22e3401c207a6982b1698a081",
"score": "0.5227064",
"text": "def show_tree\n @root=Category.roots\n end",
"title": ""
},
{
"docid": "d5348dd1b6a175630141a20d678c7eeb",
"score": "0.5223422",
"text": "def getPeopleOnCloud\n query = PFQuery.queryWithClassName('Person')\n data = query.findObjects\n result = data\n result\n end",
"title": ""
},
{
"docid": "05af767394265f61c43370bf0129ce56",
"score": "0.52220786",
"text": "def galleries\n \n end",
"title": ""
},
{
"docid": "3d2e15be7656a56b3ada872ce74f5878",
"score": "0.52076155",
"text": "def repository_finder; end",
"title": ""
},
{
"docid": "203c23558193a43c6cdd38b4a70ab3fa",
"score": "0.5204816",
"text": "def initialize(response)\n # Nokogiri::XML(me).xpath(\"/app:service/app:workspace/app:collection[@id='album-list']/@href\").text\n collention = Fotki.xml_to_hash(response)['service']['workspace']['collection'].map{ |i| { i['id'] => i['href'] }}.inject(:merge)\n @album = collention['album-list']\n @photo = collention['photo-list']\n @tag = collention['tag-list']\n end",
"title": ""
},
{
"docid": "191c03a3d6efddb11909ede4367be80c",
"score": "0.51988864",
"text": "def getPhotos()\n\t@photos = flickr.photos.search(:user_id => @authObj.getUserID())\n\n\t@photo_id = []\n\n\t\t @photos.each do |p| \n\t\t @photo_id.push p.id\n\t\t end\n\n\t return @photo_id \n\tend",
"title": ""
},
{
"docid": "8583f7809d0f7143ba111b7e607c49c3",
"score": "0.5197359",
"text": "def parsed_tree; end",
"title": ""
},
{
"docid": "8dcbb4cc870607ea2a289fd3a17606f7",
"score": "0.5194873",
"text": "def show_uri_request\n gather_details\n build_tree\n end",
"title": ""
},
{
"docid": "7894d18198bca80ce47b5b30d5287921",
"score": "0.51933604",
"text": "def parsed_service_document\n repository.parsed_service_document\n end",
"title": ""
},
{
"docid": "b5b9d13060ff006c43a34582e696c4b9",
"score": "0.51922524",
"text": "def show\n @flickr_search = FlickrSearch.find(params[:id], :order => \"search_parameter DESC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @flickr_search }\n end\n end",
"title": ""
},
{
"docid": "0e65b54ce58e3a72a9f1b297158b8250",
"score": "0.5189219",
"text": "def fetch_entries\n logger.info \"#{SERVICE_NAME}: Fetching the most recent photos by #{self.flickr_user_name}\"\n photo_entries = []\n doc = Hpricot.XML(open(\"http://api.flickr.com/services/feeds/photos_public.gne?id=#{self.flickr_user_id}&lang=en-us&format=rss_200\"))\n (doc/'item').each do |item|\n photo_entries << parse_entry(item)\n end\n \n logger.info \"#{SERVICE_NAME}: Fetching the most recent favorite photos of #{self.flickr_user_name}\"\n faved_entries = []\n doc = Hpricot.XML(open(\"http://api.flickr.com/services/feeds/photos_faves.gne?nsid=#{self.flickr_user_id}&lang=en-us&format=rss_200\"))\n (doc/'item').each do |item|\n faved_entries << parse_entry(item)\n end\n\n return photo_entries.reject { |e| e.nil? }, faved_entries.reject { |e| e.nil? }\n rescue Timeout::Error => tme\n logger.warn \"#{SERVICE_NAME}: Error fetching posts (timeout error): #{tme}\"\n return [], []\n rescue => e\n logger.warn \"#{SERVICE_NAME}: Error fetching posts: #{e.backtrace}\"\n return [], []\n end",
"title": ""
},
{
"docid": "4f5226d379d53780395d10d421bcb4aa",
"score": "0.5187524",
"text": "def elfinder\n h, r = ElFinder::Connector.new(\n :root => File.join(Rails.public_path, 'system', 'open_gallery'),\n :url => '/system/elfinder',\n :perms => {\n 'forbidden' => {:read => false, :write => false, :rm => false},\n /README/ => {:write => false},\n /pjkh\\.png$/ => {:write => false, :rm => false},\n },\n :extractors => {\n 'application/zip' => ['unzip', '-qq', '-o'],\n 'application/x-gzip' => ['tar', '-xzf'],\n },\n :archivers => {\n 'application/zip' => ['.zip', 'zip', '-qr9'],\n 'application/x-gzip' => ['.tgz', 'tar', '-czf'],\n },\n :thumbs => true\n ).run(params)\n\n headers.merge!(h)\n render (r.empty? ? {:nothing => true} : {:text => r.to_json}), :layout => false\n end",
"title": ""
},
{
"docid": "ee6b91adbba27cc70aecf07fad4dadf8",
"score": "0.5183899",
"text": "def get_tags\n @client.get_tags(flickr_user_id)\n end",
"title": ""
},
{
"docid": "b234472430047b679183233a73bc11d4",
"score": "0.51829934",
"text": "def parse(url)\n url = \"http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&photo_id=#{self.class.extract_id url}&api_key=#{@api_key}\"\n response = self.class.get(url)['rsp']\n unless response['err']\n yield load(response['photo'])\n else\n raise InvalidFlickrResponse\n end\n end",
"title": ""
}
] |
6b64f50598bcfd7a6b2e511ccd046c1d
|
PUT /affiliates/1 PUT /affiliates/1.xml
|
[
{
"docid": "848af50439b1866854675e44220e9259",
"score": "0.6661035",
"text": "def update\n @affiliate = Affiliate.find(params[:id])\n\n respond_to do |format|\n if @affiliate.update_attributes(params[:affiliate])\n format.html { redirect_to(@affiliate, :notice => 'Affiliate was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a96bc28f8ffa7cb0373cec4732a24c92",
"score": "0.67252666",
"text": "def update\n @affiliate = Affiliate.find(params[:id])\n respond_to do |format|\n if @affiliate.update_attributes(params[:affiliate])\n flash[:notice] = 'Affiliate was successfully updated.'\n format.html { redirect_to(affiliates_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7862469ab591f9c9d35e92e12576d10",
"score": "0.66103035",
"text": "def update\n @affiliate = Affiliate.find(params[:id])\n\n respond_to do |format|\n if @affiliate.update_attributes(params[:affiliate])\n flash[:notice] = 'Affiliate was successfully updated.'\n format.html { redirect_to([:admin, @affiliate]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d4fdcdff4482235692c928226fe9343",
"score": "0.64023817",
"text": "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"title": ""
},
{
"docid": "f94b01610c9dccbe9cfe334b26f1645f",
"score": "0.63705665",
"text": "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"title": ""
},
{
"docid": "f94b01610c9dccbe9cfe334b26f1645f",
"score": "0.63705665",
"text": "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"title": ""
},
{
"docid": "c113c8dda4e4b2f7e6b906325b182bf7",
"score": "0.6355749",
"text": "def update\n @affiliate = Affiliate.find(params[:id])\n\n respond_to do |format|\n if @affiliate.update_attributes(params[:affiliate])\n format.html { redirect_to @affiliate, notice: 'Affiliate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aabfbf9e8bb9f039c23c1b6d6b731748",
"score": "0.63110536",
"text": "def update\n @affiliation = Affiliation.find(params[:id])\n\n respond_to do |format|\n if @affiliation.update_attributes(params[:affiliation])\n format.html { redirect_to(@affiliation, :notice => 'Affiliation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f59ece601c87e0343ed8560d89e2122b",
"score": "0.61328864",
"text": "def update\n respond_to do |format|\n if @affiliate.update(affiliate_params)\n format.html { redirect_to @affiliate, notice: 'Affiliate was successfully updated.' }\n format.json { render :show, status: :ok, location: @affiliate }\n else\n format.html { render :edit }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f59ece601c87e0343ed8560d89e2122b",
"score": "0.61328864",
"text": "def update\n respond_to do |format|\n if @affiliate.update(affiliate_params)\n format.html { redirect_to @affiliate, notice: 'Affiliate was successfully updated.' }\n format.json { render :show, status: :ok, location: @affiliate }\n else\n format.html { render :edit }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faa3b6ccef2f9e4d5b7fb69cdc356d44",
"score": "0.60856384",
"text": "def update_affiliate\n begin\n\n affiliate_id = params[:user][:affiliate_id].to_i\n if affiliate_id == NIL_RECORD.id\n @user.affiliate = nil\n @user.save!\n return\n end\n\n @user.affiliate = Affiliate.find(affiliate_id)\n @user.save!\n rescue ActiveRecord::RecordNotFound => e\n flash[:error] = t('affiliate.not_found')\n render :nothing => true\n end\n\n end",
"title": ""
},
{
"docid": "7def59cedbd3782b06141a4e05c4965a",
"score": "0.60848504",
"text": "def edit_affiliate\n @affiliates = Affiliate.all\n @affiliates.unshift OpenStruct.new(:id => -1, :affiliate_key => I18n.t('global.none'))\n end",
"title": ""
},
{
"docid": "f657678811e74d96548b9ce92822b285",
"score": "0.6055857",
"text": "def update\n @affiliation ||= Affiliation.find(params[:id])\n\n respond_to do |format|\n if @affiliation.update_attributes(params[:affiliation])\n flash[:notice] = 'Affiliation was successfully updated.'\n format.html { redirect_to(:controller => :locations, :action => :show, :id => @affiliation.location.slug) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "138f2643ccc74dd519c7b6ef4cc2b6f4",
"score": "0.604197",
"text": "def set_affiliation\n @affiliation = Affiliation.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0327e43e5adce892ac92063383ec709",
"score": "0.5978639",
"text": "def create\n @affiliate = Affiliate.new(params[:affiliate])\n\n respond_to do |format|\n if @affiliate.save\n flash[:notice] = 'Affiliate was successfully created.'\n format.html { redirect_to(@affiliate) }\n format.xml { render :xml => @affiliate, :status => :created, :location => @affiliate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eee8e5d81fa29be24ff16c53c3d72c76",
"score": "0.5974639",
"text": "def create\n @affiliate = Affiliate.new(params[:affiliate])\n\n respond_to do |format|\n if @affiliate.save\n format.html { redirect_to(@affiliate, :notice => 'Affiliate was successfully created.') }\n format.xml { render :xml => @affiliate, :status => :created, :location => @affiliate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eee8e5d81fa29be24ff16c53c3d72c76",
"score": "0.5974639",
"text": "def create\n @affiliate = Affiliate.new(params[:affiliate])\n\n respond_to do |format|\n if @affiliate.save\n format.html { redirect_to(@affiliate, :notice => 'Affiliate was successfully created.') }\n format.xml { render :xml => @affiliate, :status => :created, :location => @affiliate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "842865f1b7bdb6dabf6effbbd2d892c9",
"score": "0.59576386",
"text": "def update\n @affiliation = Affiliation.find(params[:id])\n\n respond_to do |format|\n if @affiliation.update_attributes(params[:affiliation])\n format.html { redirect_to @affiliation, notice: 'Affiliation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79a6936e5dfb3032b59ded639306b96b",
"score": "0.5876434",
"text": "def set_affiliation\n @affiliation = Affiliation.find(affiliation_params[:id])\n end",
"title": ""
},
{
"docid": "68605a1472aa3ed1beae803a382a1ec6",
"score": "0.5854032",
"text": "def set_affiliate_id\n set_affiliate_id_from_params || set_affiliate_id_from_session\n end",
"title": ""
},
{
"docid": "4b7f38184c109d504131e096e131e2eb",
"score": "0.5798675",
"text": "def update\n @affiliate_account = Affiliate::Account.find(params[:id])\n\n respond_to do |format|\n if @affiliate_account.update_attributes(params[:affiliate_account])\n format.html { redirect_to @affiliate_account, notice: 'Account was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiliate_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dfae6b72896944912694a6c764018d8",
"score": "0.5717724",
"text": "def update\n @affiliate_link = AffiliateLink.find(params[:id])\n\n respond_to do |format|\n if @affiliate_link.update_attributes(params[:affiliate_link])\n flash[:notice] = 'AffiliateLink was successfully updated.'\n format.html { redirect_to(@affiliate_link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliate_link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "519cb9fa18a8afdc267b327658d7169c",
"score": "0.56814265",
"text": "def destroy\n @affiliate = Affiliate.find(params[:id])\n @affiliate.destroy\n\n respond_to do |format|\n format.html { redirect_to(affiliates_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "519cb9fa18a8afdc267b327658d7169c",
"score": "0.56814265",
"text": "def destroy\n @affiliate = Affiliate.find(params[:id])\n @affiliate.destroy\n\n respond_to do |format|\n format.html { redirect_to(affiliates_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "be83039ceff2016d49e7f49cfa22e8f6",
"score": "0.5646859",
"text": "def update\n respond_to do |format|\n if @affiliation.update(affiliation_params)\n format.html { redirect_to @affiliation, notice: 'Affiliation was successfully updated.' }\n format.json { render :show, status: :ok, location: @affiliation }\n else\n format.html { render :edit }\n format.json { render json: @affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93ae81378a4db45ea677355fc36febc7",
"score": "0.56274605",
"text": "def create\n @affiliate = Affiliate.new(affiliate_params)\n\n respond_to do |format|\n if @affiliate.save\n format.html { redirect_to @affiliate, notice: 'Affiliate was successfully created.' }\n format.json { render :show, status: :created, location: @affiliate }\n else\n format.html { render :new }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93ae81378a4db45ea677355fc36febc7",
"score": "0.56274605",
"text": "def create\n @affiliate = Affiliate.new(affiliate_params)\n\n respond_to do |format|\n if @affiliate.save\n format.html { redirect_to @affiliate, notice: 'Affiliate was successfully created.' }\n format.json { render :show, status: :created, location: @affiliate }\n else\n format.html { render :new }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc6d989e47b8b758a8ec8034edba8ab2",
"score": "0.5625628",
"text": "def create\n @affiliation = Affiliation.new(params[:affiliation])\n\n respond_to do |format|\n if @affiliation.save\n format.html { redirect_to(@affiliation, :notice => 'Affiliation was successfully created.') }\n format.xml { render :xml => @affiliation, :status => :created, :location => @affiliation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9453eb7c642303e41baf57b5ffb881b",
"score": "0.56196636",
"text": "def set_affiliate_person\n @affiliate_person = AffiliatePerson.find(params[:id])\n end",
"title": ""
},
{
"docid": "9a296e3b809c900fb6985805b14cc929",
"score": "0.5587484",
"text": "def index\n @affiliates = Affiliate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @affiliates }\n end\n end",
"title": ""
},
{
"docid": "be90984360b8ba7014d50d0e76308d69",
"score": "0.5585867",
"text": "def destroy\n @affiliate = Affiliate.find(params[:id])\n @affiliate.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_affiliates_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "68de8e5e40c67254238b23e9ec9bdc6b",
"score": "0.55807096",
"text": "def update\n @agent_affiliation = AgentAffiliation.find(params[:id])\n\n respond_to do |format|\n if @agent_affiliation.update_attributes(params[:agent_affiliation])\n flash[:notice] = 'AgentAffiliation was successfully updated.'\n format.html { redirect_to(\n polymorphic_url([:admin, @affiliable, :agent_affiliations])) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "d7ff35f7506b7d66199d2b12422de228",
"score": "0.5494328",
"text": "def set_affiliateproduct\n @affiliateproduct = Affiliateproduct.find(params[:id])\n end",
"title": ""
},
{
"docid": "30ac77c110c1e082524af0ed3bc18d7d",
"score": "0.5491233",
"text": "def update\n @associate = Associate.find(params[:id])\n\n respond_to do |format|\n if @associate.update_attributes(params[:associate])\n format.html { redirect_to(@associate, :notice => 'Associate was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @associate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9befce453483ca4920c8f1c62a831a6c",
"score": "0.5490888",
"text": "def update!\n !! api_request(:put, \"/subscribers/#{self.customer_id}.xml\", :body => self.to_xml(:exclude => [:customer_id]))\n end",
"title": ""
},
{
"docid": "b784dfee7548e24196eba577333543e4",
"score": "0.54867345",
"text": "def show\n @affiliates = Affiliate.all\n @affiliate = Affiliate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "b784dfee7548e24196eba577333543e4",
"score": "0.54867345",
"text": "def show\n @affiliates = Affiliate.all\n @affiliate = Affiliate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "ac5fd27bc46814889723bd887370909d",
"score": "0.5478667",
"text": "def create\n @affiliate = Affiliate.new(params[:affiliate])\n\n\t\tunless params[:send_activation]\n\t\t\[email protected]_activation = true\n\t\tend\n\n respond_to do |format|\n if @affiliate.save\n\n\t\t\t\tif params[:approved]\n\t\t\t\t\[email protected]!\n\t\t\t\tend\n\n flash[:notice] = 'Affiliate was successfully created.'\n format.html { redirect_to([:admin, @affiliate]) }\n format.xml { render :xml => @affiliate, :status => :created, :location => @affiliate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4665942df9b4bb2b84d3fac80fefec8f",
"score": "0.5466334",
"text": "def show\n @affiliate = Affiliates.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "d3b8589576fb84f578848f7b90164c0b",
"score": "0.5451864",
"text": "def set_affiliate_agency\n @affiliate_agency = Affiliate::Agency.find(params[:id])\n end",
"title": ""
},
{
"docid": "ac32069a3960a3c33dee0202202a79c8",
"score": "0.5427513",
"text": "def index\n\t\tstore_location\n\n @affiliates = Affiliate.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @affiliates }\n end\n end",
"title": ""
},
{
"docid": "dcebdacde2e8c4d19419d0590440b841",
"score": "0.54260224",
"text": "def test_AAH_put\n Help.empty\n rdf = Help.handle\n rdf.post( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_02.json\" ))\n rdf.put( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_03.json\" ))\n assert( true )\n end",
"title": ""
},
{
"docid": "d849c2bc448d5ce0df573d1ab918e8f7",
"score": "0.5399544",
"text": "def put(url, options={}, header={})\n body = options[:body]\n access_token.put(url, body, {'Content-Type' => 'application/xml' })\n end",
"title": ""
},
{
"docid": "c7c69404a41d663b3b9175e60a98b0f1",
"score": "0.5392692",
"text": "def index\n @affiliates = Affiliate.all\n end",
"title": ""
},
{
"docid": "c7c69404a41d663b3b9175e60a98b0f1",
"score": "0.5392692",
"text": "def index\n @affiliates = Affiliate.all\n end",
"title": ""
},
{
"docid": "15c88015e9d85bd0dff7ef1a49a5ae15",
"score": "0.53730553",
"text": "def update\n @affiliate = Affiliate.find(params[:id])\n @user = @affiliate.user\n if @user.update_attributes(params[:user])\n flash[:notice] = \"El anunciante #{@affiliate.full_name} fue actualizado con éxito\"\n redirect_to [:admin, @affiliate]\n else\n flash.now[:error] = \"Hubo un error al intentar actualizar el anuncianate\"\n render action: :edit\n end\n end",
"title": ""
},
{
"docid": "2eeaced42d83a4c8ee5999bc6617e68b",
"score": "0.5372223",
"text": "def update\n respond_to do |format|\n if @po_affiliation.update(po_affiliation_params)\n format.html { redirect_to @po_affiliation, notice: 'Po affiliation was successfully updated.' }\n format.json { render :show, status: :ok, location: @po_affiliation }\n else\n format.html { render :edit }\n format.json { render json: @po_affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f1485d26294a4e6c2b3a19acb8486b2",
"score": "0.5371209",
"text": "def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5357189",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "f9f186126b25463a3526fe372d3706d8",
"score": "0.53560436",
"text": "def update\n respond_to do |format|\n if @affiliate_agency.update(affiliate_agency_params)\n format.html { redirect_to @affiliate_agency, notice: 'Agency was successfully updated.' }\n format.json { render :show, status: :ok, location: @affiliate_agency }\n else\n format.html { render :edit }\n format.json { render json: @affiliate_agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05a67010b7950192211400b677c0ae05",
"score": "0.5355745",
"text": "def destroy\n @affiliation = Affiliation.find(params[:id])\n @affiliation.destroy\n\n respond_to do |format|\n format.html { redirect_to(affiliations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2e3831d0bcaeb4507403060f08e64265",
"score": "0.5352155",
"text": "def set_person_affiliation\n @person_affiliation = PersonAffiliation.find(params[:id])\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.534649",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "d0a4aff8cee316cc9101170ad80b8354",
"score": "0.5345236",
"text": "def create\n @affiliation = Affiliation.new(params[:affiliation])\n\n respond_to do |format|\n if @affiliation.save\n flash[:notice] = 'Affiliation was successfully created.'\n format.html { redirect_to(:controller => :locations, :action => :show, :id => @affiliation.location.slug) }\n format.xml { render :xml => @affiliation, :status => :created, :location => @affiliation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.5333929",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.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.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "2a883e27d7c2ac9dc7142cf4483f6815",
"score": "0.5332109",
"text": "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"title": ""
},
{
"docid": "ce9e5d301d48408af4731e2d3896f4aa",
"score": "0.5309507",
"text": "def new\n @affiliate = Affiliate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "ce9e5d301d48408af4731e2d3896f4aa",
"score": "0.5309507",
"text": "def new\n @affiliate = Affiliate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "ce9e5d301d48408af4731e2d3896f4aa",
"score": "0.5309507",
"text": "def new\n @affiliate = Affiliate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "ce9e5d301d48408af4731e2d3896f4aa",
"score": "0.5309507",
"text": "def new\n @affiliate = Affiliate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @affiliate }\n end\n end",
"title": ""
},
{
"docid": "1be44c3e0ba097e5e9e3383b5907538c",
"score": "0.52969587",
"text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "f81b4218bd91be735d0858cc2e57580d",
"score": "0.5296435",
"text": "def update_user( api, user )\n\n \n connection_config = YAML::load_file( 'alma.yml' )\n\n update_url = 'https://' + connection_config['url_base'] + '/almaws/v1/users/' + user.primary_id\n api_uri = URI( update_url )\n\n \n request = Net::HTTP::Put.new( api_uri ) \n \n request.body = user.to_xml\n request.content_type = 'application/xml' \n \n \n response = api.call( api_uri, request )\n \n # this is too verbose for even debug, uncomment only when really needed...\n #@log.debug( user.to_xml )\n \n if response.code.to_i >= 400 and response.code.to_i < 600\n \n \n @log.info(\"Got an error response (#{response.code}) on api call for #{user.eppn} (#{user.primary_id})\")\n @log.debug(\"Error updating #{user.eppn} (#{user.primary_id})\" + response.body )\n end\nend",
"title": ""
},
{
"docid": "91340fa309a659aca431cf67a310232d",
"score": "0.5283323",
"text": "def index\n @affiliates = Affiliate.paginate(:page => params[:page], :order => \"id desc\")\n @affiliate = Affiliate.find_by_user_id(current_user)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @affiliates }\n end\n end",
"title": ""
},
{
"docid": "cc4532686bb4096e11cf5c4f9e2cf400",
"score": "0.5280325",
"text": "def index\n @affiliations = Affiliation.all\n end",
"title": ""
},
{
"docid": "c652acfa8eee1eadd640cc7ef38c0798",
"score": "0.52803177",
"text": "def set_po_affiliation\n @po_affiliation = PoAffiliation.find(params[:id])\n end",
"title": ""
},
{
"docid": "a62b791e91946179823521a4d9d1624d",
"score": "0.52785546",
"text": "def update\n @attribution = Attribution.find(params[:id])\n\n respond_to do |format|\n if @attribution.update_attributes(params[:attribution])\n flash[:notice] = 'Attribution was successfully updated.'\n format.html { redirect_to(@attribution) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attribution.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94f9e4dd13938b5c4defacd60e820c57",
"score": "0.52700853",
"text": "def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end",
"title": ""
},
{
"docid": "4ef8cb106785c9727f9fdf7fc0accf36",
"score": "0.52615374",
"text": "def edit\n @affiliate = Affiliate.find(params[:id])\n @user = @affiliate.user\n end",
"title": ""
},
{
"docid": "ff245cb5b50022e4086050fdc9615c6f",
"score": "0.52494866",
"text": "def update\n @affiliate_campaign = Affiliate::Campaign.find(params[:id])\n\n respond_to do |format|\n if @affiliate_campaign.update_attributes(params[:affiliate_campaign])\n format.html { redirect_to @affiliate_campaign, notice: 'Campaign was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiliate_campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2c1b0709fefba1c017a2361ffea603a",
"score": "0.52406657",
"text": "def index\n @affiliations = Affiliation.find(:all)\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @affiliations }\n end\n end",
"title": ""
},
{
"docid": "0545e72f77999acb4e190ae985176f93",
"score": "0.52301013",
"text": "def create_affiliate\n if request.post?\n logger.info params.to_yaml\n \n # build the primary affiliate data\n @affiliate = Affiliate.new\n @affiliate.first_name = params[:FirstName]\n @affiliate.last_name = params[:LastName]\n @affiliate.email = params[:Email]\n @affiliate.affiliate_code = params[:Id]\n \n if @affiliate.valid?\n # build contact method associations\n @address = @affiliate.addresses.build(\n :street => params[:StreetAddress1],\n :unit => params[:StreetAddress2],\n :city => params[:City],\n :state => params[:State],\n :zip => params[:PostalCode],\n :category => params[:Address1Type].to_s.downcase\n )\n @affiliate.addresses << @address if @address.valid?\n \n 5.times do |i|\n unless params[\"Phone#{i}\"].blank?\n @phone_number = @affiliate.phone_numbers.build(\n :data => params[\"Phone#{i}\"],\n :category => params[\"Phone#{i}Type\"].to_s.downcase\n )\n @affiliate.phone_numbers << @phone_number if @phone_number.valid?\n end\n end\n \n unless params[:Website].blank?\n @affiliate.websites << @affiliate.websites.build(:data => params[:Website])\n end\n\n @affiliate.save\n end\n \n render :nothing => true, :status => 200\n end\n \n # renders instructions by default\n end",
"title": ""
},
{
"docid": "db9e1733c829f03a4fd7c976c3498f44",
"score": "0.5228708",
"text": "def update_audience(id, name, active)\n put(\"audiences/#{id}\", { :name => name, :active => active })\n end",
"title": ""
},
{
"docid": "2ea6b5ffa913e928cf8b98c4f32962ed",
"score": "0.5221734",
"text": "def update_anchors(bib, docxml, _id)\n docid = bib&.at(ns(\"./docidentifier\"))&.text\n docxml.xpath(\"//xmlns:eref[@citeas = '#{docid}']\").each do |e|\n e.at(ns(\".//locality[@type = 'anchor']\")).nil? or next\n update_anchors1(e, docid)\n end\nend",
"title": ""
},
{
"docid": "797edf69897946c085532162e213977a",
"score": "0.52213174",
"text": "def create\n @affiliate = Affiliate.new(params[:affiliate])\n #default isfaculty = 0; assumption is affiliate candidate was entered first\n @affiliate.isfaculty = 0\n\n respond_to do |format|\n if @affiliate.save\n format.html { redirect_to @affiliate, notice: 'Success! New record created.' }\n format.json { render json: @affiliate, status: :created, location: @affiliate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @affiliate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19327171fbe510d9af8de4722e60fd0c",
"score": "0.52129495",
"text": "def update\n respond_to do |format|\n if @person_affiliation.update(person_affiliation_params)\n format.html { redirect_to @person_affiliation, notice: \"Person affiliation was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person_affiliation }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person_affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ca157709090ee05eb67985e18ca05bf",
"score": "0.51914394",
"text": "def update_axion(id, options={})\n self.class.put(\"/axions/#{id}.json?apikey=#{apikey}\", :query => { :axion => options }, :body => {})\n end",
"title": ""
},
{
"docid": "a7db28fcfcf3750adffec1ebdb585f3c",
"score": "0.51800346",
"text": "def show\n @affiliation = Affiliation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @affiliation }\n end\n end",
"title": ""
},
{
"docid": "1196c21347affa2a44fc6d644ec90a9c",
"score": "0.51790905",
"text": "def update_article(article)\n xml = get_xml\n\n article.abstract = xml.css('abstract').text\n\n xml.css('contrib[contrib-type=author]').each do |node|\n first_name, middle_name = node.css('given-names').text.split(' ')\n article.add_author(\n first_name,\n middle_name,\n node.css('surname').text\n )\n end\n\n article.save\n end",
"title": ""
},
{
"docid": "94126e673a60d0bcf0500518ac2d2e31",
"score": "0.5175442",
"text": "def update_authorship!(saving=false)\n url = \"https://#{Settings::ARXIV_HOST}/a/#{author_identifier}.atom2\"\n doc = Nokogiri(open(url))\n doc.css('entry id').each do |el|\n uid = el.text.match(/arxiv.org\\/abs\\/(.+)/)[1]\n uid = Arxiv.strip_version(uid)\n unless authorships.where(paper_uid: uid).exists?\n logger.info \"New paper published by #{username}: arxiv/#{uid}\".light_green\n authorships.create(paper_uid: uid)\n end\n end\n\n self.papers_count = Authorship.where(user_id: id).count\n self.save! unless saving\n end",
"title": ""
},
{
"docid": "75257bcacbc16f7963754f7d8ca9fb70",
"score": "0.5158832",
"text": "def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n \n \n format.xml \n else\n \n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.5158147",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.5147113",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
},
{
"docid": "9a1b241e950b8bd691b04d15837c4b01",
"score": "0.51402664",
"text": "def list\n @affiliates = Affiliate.all(:order => 'name_abbr')\n \n respond_to do |format|\n format.html # list.html.erb\n format.xml { render :xml => @affiliates }\n end\n end",
"title": ""
},
{
"docid": "ffc4f9a93f853243b69cadd4e685527e",
"score": "0.5139161",
"text": "def affiliate_params\n params.require(:affiliate).permit(:name, :address1, :address2, :city, :state, :zipcode, :pastor, :denomination, :website)\n end",
"title": ""
},
{
"docid": "a63fbd56e4beb4348f4690cd56af5ae8",
"score": "0.51356643",
"text": "def update\n @advertise = Advertise.find(params[:id])\n\n respond_to do |format|\n if @advertise.update_attributes(params[:advertise])\n format.html { redirect_to(@advertise, :notice => 'Advertise was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @advertise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a418d7c9df8724abf13ac1b833c3c89",
"score": "0.5132008",
"text": "def handle_affiliation(attrs:)\n return attrs unless attrs.present? && attrs[:affiliation].present?\n return attrs unless attrs[:affiliation][:id].present?\n\n affiliation = AffiliationSelection::HashToAffiliationService.to_affiliation(\n hash: attrs[:affiliation], allow_create: true\n )\n # Save the affiliation if it is new\n affiliation.save if affiliation.present? && affiliation.new_record?\n\n # reattach the affiliation_id but with the Affiliation id instead of the hash\n attrs.delete(:affiliation)\n attrs[:affiliation_id] = affiliation.id\n attrs\n end",
"title": ""
},
{
"docid": "7c6d791fd8114f34111d09c27e4c996a",
"score": "0.5127415",
"text": "def destroy\n @affiliate = Affiliate.find(params[:id])\n @affiliate.destroy\n\n respond_to do |format|\n format.html { redirect_to affiliates_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.5117365",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.5106364",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "95aef3efca5861bf0e9d7de5b47f27c2",
"score": "0.5103075",
"text": "def update\n @affair = Affair.find(params[:id])\n\n respond_to do |format|\n if @affair.update_attributes(params[:affair])\n format.html { redirect_to(@affair, :notice => 'Affair was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affair.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "943d6b430464bd8d278080fa8b580509",
"score": "0.5101462",
"text": "def update\n @affiliate_setting = AffiliateSetting.find(params[:id])\n\n respond_to do |format|\n if @affiliate_setting.update_attributes(params[:affiliate_setting])\n flash[:notice] = 'AffiliateSetting was successfully updated.'\n format.html { redirect_to([:admin, @affiliate_setting]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliate_setting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4029c783be0ce2754ff1516aa71cd29",
"score": "0.5091653",
"text": "def update\n @amazon = Amazon.find(params[:id])\n\n respond_to do |format|\n if @amazon.update_attributes(params[:amazon])\n format.html { redirect_to(@amazon, :notice => 'Amazon was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @amazon.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ceb1b004ed37f2f836604bfcd74dac89",
"score": "0.5078794",
"text": "def update\n @sponsor = Sponsor.find(params[:id])\n respond_to do |format|\n if @sponsor.update_attributes(params[:sponsor])\n format.html {redirect_to sponsor_url(@sponsor)}\n format.xml {render :nothing => true}\n else\n format.html {render :action => \"edit\"}\n format.xml {render :xml => @sponsor.errors.to_xml}\n end\n end\n end",
"title": ""
},
{
"docid": "61eab0bfb03ff7dbe61d1c68771509a0",
"score": "0.5078331",
"text": "def affiliation_params\n params.require(:affiliation).permit(:collection_id, :feature_id, :perspective_id, :descendants, :skip_update)\n end",
"title": ""
},
{
"docid": "e7073012cb7cb0a12c8bd5eaac430729",
"score": "0.50777745",
"text": "def new\n @affiliation = Affiliation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @affiliation }\n end\n end",
"title": ""
},
{
"docid": "2cd4ff55edff7dadf6e4a89cb4d202a0",
"score": "0.5073851",
"text": "def affiliation_id=(affil_id)\n affiliations.clear\n self.affiliation_ids = affil_id\n end",
"title": ""
},
{
"docid": "7cb48baa228af6182bd28760ad870fe7",
"score": "0.50675315",
"text": "def affiliation_id=(affil_id)\n self.affiliation_ids = affil_id\n end",
"title": ""
},
{
"docid": "6a29370c88a258efbb27eedf1bf05294",
"score": "0.5066143",
"text": "def update\n @affiliation = Affiliation.find(params[:id])\n @medium = @affiliation.medium if @medium.nil?\n respond_to do |format|\n if @affiliation.update_attributes(affiliation_params)\n flash[:notice] = ts('edit.successful', :what => Affiliation.model_name.human.capitalize)\n format.html { redirect_to edit_medium_url(@medium, :anchor => 'affiliations') }\n format.xml { head :ok }\n else\n @sponsors = Sponsor.order('title')\n @organizations = Organization.order('title')\n @projects = Project.order('title')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @affiliation.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "a21658e8869b48b877bfbe57de8fb717",
"score": "0.5058563",
"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.put(\n url,\n { Contact: { email: \"[email protected]\" } } )\n \nend",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.5057289",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
}
] |
bb9e132c289b079e9131515082f9b0ba
|
Check on allowing to updating guardian information
|
[
{
"docid": "4cbcb043f8e5b09afd08a6b0ff8fb770",
"score": "0.713705",
"text": "def allow_update_guardian?\r\n return true if guardian_updated_at.nil?\r\n\r\n guardian_updated_at.utc < (DateTime.now - 30.minutes).utc\r\n end",
"title": ""
}
] |
[
{
"docid": "a8bb8acd2d12de3a6b3dfa24fc354554",
"score": "0.8253872",
"text": "def guardian_update\r\n guardian_update! if allow_update_guardian?\r\n end",
"title": ""
},
{
"docid": "df75545bc5e461d65bdb24ac5b687c2e",
"score": "0.698843",
"text": "def guardian_verify!\r\n return false if guardian_name.blank?\r\n\r\n if self.new_record?\r\n self.guardian_token_confirmed_at = DateTime.now\r\n else\r\n self.touch :guardian_token_confirmed_at\r\n end\r\n\r\n self.class.where('id != ? AND guardian_name = ?', id, guardian_name).update_all :guardian_name => nil\r\n\r\n true\r\n end",
"title": ""
},
{
"docid": "69c84dd3da2c10ca1060b6577c86665d",
"score": "0.66198564",
"text": "def update\n @household = Household.find(params[:id])\n authorize! :update, @household\n \n #Ziv Piper was coding here\n respond_to do |format|\n if @household.update_attributes(params[:household])\n guardian [email protected]\n format.html { redirect_to guardian_path(guardian) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @household.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a8cc2d7b4474bca2b72244ef8a2667b",
"score": "0.64928323",
"text": "def glacis_safeguard()\n dalmania(correspondentship, askr)\n chard_dachshund?()\n end",
"title": ""
},
{
"docid": "02eebe78434d11b15a06626e60444577",
"score": "0.6469751",
"text": "def check_self_update\n if @current_user.specialist || @current_user.persona == 'admin' || @user.id == @current_user.id\n update\n else\n render json: {errors: ResponseHelper::BAD_TOKEN}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "c42ec4d66a8a1698bd2f6ea92ae03b02",
"score": "0.64564127",
"text": "def privileged_change?\n update? && admin_or_coord?\n end",
"title": ""
},
{
"docid": "b2b4d323cba516f0d48a3d3c8c5a0ce9",
"score": "0.64535105",
"text": "def check_for_mutated_access!\n return if @access.nil?\n return unless @access.changed?\n @gapi.update! access: @access.to_gapi\n patch_gapi! :access\n end",
"title": ""
},
{
"docid": "c98368b8ebdc5a8f0a13927e6d9b67cc",
"score": "0.6428156",
"text": "def update?\n user.admin? || record.plant.plot.garden.user == user\n end",
"title": ""
},
{
"docid": "46673b1dbc6f6b6481229949a22d54cd",
"score": "0.6340645",
"text": "def update?\n @current_user.permission('BidQuotation', :clerk)\n end",
"title": ""
},
{
"docid": "cf24f81737c27573ecf9a28f60b13475",
"score": "0.6293496",
"text": "def update?\n @current_user.permission('Hub', :clerk)\n end",
"title": ""
},
{
"docid": "89e3e969387e160efc26adce53d930db",
"score": "0.6283626",
"text": "def update?\n if @user.can?(Pirep, :update)\n true\n elsif (@record.pilot == @user) && @record.status.editable?\n true\n end\n end",
"title": ""
},
{
"docid": "d44e26e3c346367327023e74ea95c0ea",
"score": "0.6269051",
"text": "def update?\n @current_user.permission('FrameworkTender', :clerk) \n end",
"title": ""
},
{
"docid": "da7291c4b8973fb375a066936ae610fb",
"score": "0.6253743",
"text": "def update?\n @current_user.permission('Adjustment', :clerk)\n end",
"title": ""
},
{
"docid": "03322821929da4d080ada9c5119982e5",
"score": "0.6238823",
"text": "def guardian_verify\r\n guardian_with_correct_status? ? guardian_verify! : false\r\n end",
"title": ""
},
{
"docid": "cf6e79aa6dd1e8309ddd623aa529ee2b",
"score": "0.6212696",
"text": "def update\n authorize! :update, Guardian\n respond_to do |format|\n if @guardian.update(guardian_params)\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { render :show, status: :ok, location: @guardian }\n else\n format.html { render :edit }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea741bf29f276f786a1067e19bc806b1",
"score": "0.61956924",
"text": "def can_update?() false end",
"title": ""
},
{
"docid": "ea741bf29f276f786a1067e19bc806b1",
"score": "0.61956924",
"text": "def can_update?() false end",
"title": ""
},
{
"docid": "70ae73bfe537d62c8b52f58fdfad0533",
"score": "0.6189561",
"text": "def update? ; admin? || lab_chief? || lab_worker? || same_user? ; end",
"title": ""
},
{
"docid": "13bc5fc4721cfb963c2ebd3bcb6ec7fa",
"score": "0.61887497",
"text": "def check_updated_permissions\n\t\tif self.permission_changed?\n\t\t\tSingleCellMailer.share_notification(self.study.user, self).deliver_now\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d6073aeaa835bd856132ad496b2beed9",
"score": "0.6181871",
"text": "def update?\n @current_user.permission('CommoditySource', :clerk)\n end",
"title": ""
},
{
"docid": "250cb6cdf4b11ef3c2cc7a2be3c937da",
"score": "0.6157859",
"text": "def check_updated_permissions\n\t\tif self.permission_changed?\n\t\t\tSingleCellMailer.share_annotation_notification(self.user_annotation.user, self).deliver_now\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a269cd26ab323cf6a2a172a314fbe7fe",
"score": "0.61409235",
"text": "def confirm_optin\n if params[:accepted].blank?\n redirect_to optin_guardian_path(@guardian)\n return;\n end\n accepted = @guardian.accepted = (params[:accepted].to_i == 1)\n\n auditlogger.info \"IP address #{request.ip} marked id\\##{@guardian.id} email:#{@guardian.email} as accepted=#{@guardian.accepted}\"\n @guardian.update_confirmation!\n\n if(accepted) \n redirect_to edit_guardian_path(@guardian)\n else\n @guardian.reset_authentication_token!\n reset_session\n redirect_to '/'\n end\n\n @guardian.save!\n end",
"title": ""
},
{
"docid": "59fb58ccc37bb8ac5eb75e63dee97876",
"score": "0.612431",
"text": "def update?\n record == user.tester\n # raise\n end",
"title": ""
},
{
"docid": "eefd72ffc5f306ff70143263c2b31c7b",
"score": "0.6080307",
"text": "def update?\n check_if_admin?\n end",
"title": ""
},
{
"docid": "ccaec1bfddde047a91c4e66cbb275839",
"score": "0.6062773",
"text": "def needs_info_change_email?\n (phone_changed? || avatar_changed? || security_question_id_changed? || security_answer_changed?) && persisted?\n end",
"title": ""
},
{
"docid": "57ec17e4055effcccff9de0bdb220948",
"score": "0.6042008",
"text": "def update?\n @current_user.permission('Delivery', :clerk)\n end",
"title": ""
},
{
"docid": "b2bf5e6013897fe453f81a64c1e617f8",
"score": "0.6027891",
"text": "def update?\n user_is_owner_or_admin?\n # - record: the restaurant passed to the `authorize` method in controller\n # - user: the `current_user` signed in with Devise.\n end",
"title": ""
},
{
"docid": "3af31c6216e7aa82d8a1ea08f817d5d2",
"score": "0.6027546",
"text": "def update?\n user.admin? || (user.is_valid? && client.owner?(user))\n end",
"title": ""
},
{
"docid": "c34c0896ee155ea0f8f311d0183dbeb6",
"score": "0.6021255",
"text": "def update?\n @current_user.permission('Contribution', :clerk)\n end",
"title": ""
},
{
"docid": "fd1e22ec78d1b01c19c6b2d38c151d16",
"score": "0.6020782",
"text": "def update?\n # if its the owner he can update\n # if user == record.user\n # true\n # else\n # false\n # end\n is_owner?\n end",
"title": ""
},
{
"docid": "e7e4129741e3ac79606f04fe221860de",
"score": "0.60071087",
"text": "def update?\n @current_user.permission('Project', :clerk)\n end",
"title": ""
},
{
"docid": "cd77de48ec4369fe7d479b1c4722fa34",
"score": "0.6004971",
"text": "def authorise_update\n authorize! :update, UserAgreement\n end",
"title": ""
},
{
"docid": "fca14c4dcdc43f2e5668412de6004de1",
"score": "0.60013807",
"text": "def check_owner \n set_school\n unless @school.user == @current_user\n render json: {\"message\": \"You can only update schools you created\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "53cf1ece5a4ed7a72ac8d1003522d659",
"score": "0.59977835",
"text": "def update?\n # overlords can only update their own planets\n user && ((record.user == user) || user.admin?)\n end",
"title": ""
},
{
"docid": "ad9580b215368a9d80bce41e55b29650",
"score": "0.5993498",
"text": "def update\n respond_to do |format|\n if @household.update(household_params)\n if logged_in? and current_user.role? :guardian\n format.html { redirect_to home_path, notice: 'Household was successfully updated.' }\n else\n format.html { redirect_to @household, notice: 'Household was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea9ca5d9d2e322007f205e3185c44808",
"score": "0.5980099",
"text": "def update?\n user.try(:admin?) || record.has_manager?(user)\n end",
"title": ""
},
{
"docid": "8160e3dec73429608a9286c11b686b8e",
"score": "0.59784925",
"text": "def check_update_permission\n return if owner? || @article.is_public_editable\n redirect_to articles_url\n end",
"title": ""
},
{
"docid": "278ab62f3d51a7c574743c7d5ff5042d",
"score": "0.5978374",
"text": "def check\n return performModify(false)\n end",
"title": ""
},
{
"docid": "d3cb304a594c91f6a7242a251a226b5e",
"score": "0.5973831",
"text": "def update\n @households = logged_in? ? current_user.role == \"admin\" ? Household.alph_by_guard : current_user.role == \"guardian\" ? Household.for_guard(current_user.guardian.id) : [] : []\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "196a5e56d79397edeab4cbc62ee012ae",
"score": "0.59465307",
"text": "def update?\n user.admin? || (user.is_valid? && (team.unowned? || team.owner?(user)))\n end",
"title": ""
},
{
"docid": "4d4f27c6687e8416f65227b8e0592b28",
"score": "0.5945724",
"text": "def cant_change_if_locked\n if self.locked? && (self.goals_a_changed? || self.goals_b_changed? || self.penalty_goals_a_changed? || self.penalty_goals_b_changed?)\n errors.add_to_base(\"Aposta trancada, não pode mais ser alterada.\")\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "e00ef00f30bd08264b1f1ab6b6b86ce1",
"score": "0.59403175",
"text": "def guardian_with_correct_status?\r\n return true if guardian_verified?\r\n return false if guardian_token.nil?\r\n\r\n guardian_token == self.guardian&.get_bungie_account({}, {:cached => false})&.bungieNetUser&.statusText\r\n end",
"title": ""
},
{
"docid": "6c0347ff89fca818cccf48b0441789ea",
"score": "0.59400594",
"text": "def update?\n @current_user.permission('Gift Certificate', :clerk)\n end",
"title": ""
},
{
"docid": "ea250d905a16fcdc9fa5dedf54e40435",
"score": "0.592675",
"text": "def update?\n user_is_owner_or_admin\n end",
"title": ""
},
{
"docid": "dd6f7732e55269e16c663cb9d4171477",
"score": "0.5924446",
"text": "def permitted?; end",
"title": ""
},
{
"docid": "f27cc465248dc2ff5c6a8ead45f0f0c4",
"score": "0.5919098",
"text": "def update\n respond_to do |format|\n if @guardian.update(guardian_params)\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f27cc465248dc2ff5c6a8ead45f0f0c4",
"score": "0.5919098",
"text": "def update\n respond_to do |format|\n if @guardian.update(guardian_params)\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b174e3d5878f1ece9be1818f70b19909",
"score": "0.59185386",
"text": "def update\n respond_to do |format|\n if @guardian_detail.update(guardian_detail_params)\n format.html { redirect_to admins_guardian_detail_path(@guardian_detail), notice: 'Guardian detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @guardian_detail }\n else\n format.html { render :edit }\n format.json { render json: @guardian_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b1922e04a1407aaacf0a38639de0de3",
"score": "0.5910931",
"text": "def update?\n # record.user == user # only the creator can update a deal\n # user_is_owner?\n # user_is_owner_or_admin?\n # user_is_admin?\n\n user.try(:admin?) || record.has_manager?(user)\n # user.try(:admin?) || record.roles.exists?(user_id: user, role: 'manager')\n end",
"title": ""
},
{
"docid": "8b4138fafeaeddfc96d764262715947c",
"score": "0.5903674",
"text": "def update\n if current_user.id != @house.contact_information_for_listing_realtor\n respond_to do |format|\n format.html { redirect_to houses_url , notice: 'No access to update this house!' }\n end\n else\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "226e40660dc2cd4277a0ef6b51c28642",
"score": "0.5903422",
"text": "def update?\n owner_or_admin?\n end",
"title": ""
},
{
"docid": "85b36a589195390afa7b1fc880c3aeab",
"score": "0.59033424",
"text": "def passport_update_required?\n self.profile.state != self.passport.state || self.current_state != self.passport.state || self.profile.name != self.passport.full_name\n end",
"title": ""
},
{
"docid": "d6beb455b68b5289893f655463664fee",
"score": "0.58993566",
"text": "def update?\n user.admin? || user == record\n end",
"title": ""
},
{
"docid": "31e7c32b243c587b86907b951c17b734",
"score": "0.5895159",
"text": "def update?\n user_is_owner_or_admin?\n end",
"title": ""
},
{
"docid": "c60f0e94165904bd4284319bf3f255cc",
"score": "0.5889238",
"text": "def update?\n # can update if I am the owner\n user_is_owner_or_admin?\n end",
"title": ""
},
{
"docid": "592f1eb0c62dfa8149479894fbf2c5ac",
"score": "0.5871825",
"text": "def guard_checkout\n true\n end",
"title": ""
},
{
"docid": "f7c04c7b7dbe8884ab7093b25f4b0201",
"score": "0.58666074",
"text": "def update_safeness\n # Start by getting the count of moderators that have marked the\n # photo as safe and unsafe\n approval_count = self.moderators.count(:conditions => {:status => 'safe'})\n disapproval_count = self.moderators.count(:conditions => {:status => 'unsafe'})\n # set this on the object now as it's a valid value\n self.approval_count = approval_count\n\n # get the moderator entry for the owner, if there is one\n # (owner doesn't always moderate their own photos)\n cm = @current_moderator\n set_moderator(self.user)\n owner_moderator = @current_moderator\n @current_moderator = cm\n\n puts \"owner moderator is #{owner_moderator.inspect}\"\n # If the owner has moderated their own image and marked it unsafe\n # then delete straight away\n if owner_moderator and owner_moderator.status == 'unsafe'\n self.update_status( 'deleted' )\n # If too many people have marked the image as unsafe then delete it\n elsif disapproval_count >= MIN_APPROVALS\n self.update_status( 'deleted' )\n # If enough people have marked the image as safe then make it available\n elsif self.status != 'available' and self.approval_count >= self.approval_needed\n self.update_status( 'available' )\n # Otherwise just save the approval count and do nothing else\n else\n # This largely here to fix a bug where any photo moderated by its owner \n # got deleted. So if a photo was moderated by its owner and has\n # deleted status then we update its status to moderation.\n if owner_moderator and self.status == 'deleted'\n self.update_status( 'moderation' )\n else\n puts \"Should be saving the approval count here: #{self.approval_count}\"\n self.save!\n end\n end\n end",
"title": ""
},
{
"docid": "3182fa8658d3534b4f0e3d432ce5eeaf",
"score": "0.5865891",
"text": "def update?\n user.admin? || record.user == user\n end",
"title": ""
},
{
"docid": "9920089244c436d735e4c580d036d6f8",
"score": "0.58658034",
"text": "def update?\n owner_admin\n # user == record.user || user.admin\n end",
"title": ""
},
{
"docid": "f7ec31732ad781adc57bff9a8b45572b",
"score": "0.5865416",
"text": "def edit\n @student = Student.shod(params[:student_id])\n @guard = @student.guardians.shod(params[:id])\n authorize! :update, @student\n end",
"title": ""
},
{
"docid": "15a1049d275e62fbd04c8784295193ea",
"score": "0.58636016",
"text": "def allow_change_by_request?\n private_asset_members.present? || (work.oral_history_content && !work.oral_history_content.available_by_request_off?)\n end",
"title": ""
},
{
"docid": "3289c3df2268d56d46883bc3c72ec76c",
"score": "0.58609974",
"text": "def update?\n user_is_owner?\n end",
"title": ""
},
{
"docid": "76e11fbbb95ce43038a8fbfda0f16077",
"score": "0.58582264",
"text": "def update?\n check_rank_and_admin\n end",
"title": ""
},
{
"docid": "76e11fbbb95ce43038a8fbfda0f16077",
"score": "0.58582264",
"text": "def update?\n check_rank_and_admin\n end",
"title": ""
},
{
"docid": "49d0f203b3040d8244f0a78b6413dd19",
"score": "0.585177",
"text": "def can_update?\n !is_valid?\n end",
"title": ""
},
{
"docid": "f244320e187b0ab489c36d7473e2b4ae",
"score": "0.5851742",
"text": "def cant_change_if_locked\n if self.locked? && self.answer_changed?\n errors.add_to_base(\"Aposta Bônus trancada, não pode mais ser alterada.\")\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "70cbef2401b33946ea176367dcbf30d6",
"score": "0.584671",
"text": "def check_permission\n unless helpers.am_i_owner?\n flash[:notice] = \"You are not permitted to make changes!\"\n redirect_to @event\n end\n end",
"title": ""
},
{
"docid": "294600b78bb5ad2c2770ac48e8ef29c6",
"score": "0.58460456",
"text": "def update?\n user_is_owner_or_admin?\n end",
"title": ""
},
{
"docid": "f3e4d03c88fa1f11452dbfc6c0254c11",
"score": "0.5843958",
"text": "def update?\n is_user_owner_or_admin?\n end",
"title": ""
},
{
"docid": "35e25cdf92ec334272e851796199366e",
"score": "0.5835857",
"text": "def update_authorized?(record=nil)\n current_user.is_admin?\n end",
"title": ""
},
{
"docid": "0f51082c58f1100f83eb50734a7e6051",
"score": "0.5831236",
"text": "def allowed_to_update\n @event.host == @current_user\n end",
"title": ""
},
{
"docid": "dd86d51cb87b211953280f7673c2cee1",
"score": "0.58293545",
"text": "def update\n respond_to do |format|\n if @guardian.update(guardian_params)\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { render :show, status: :ok, location: @guardian }\n else\n format.html { render :edit }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "064d9062ff693f3787cb2a1df6a1f52b",
"score": "0.5826983",
"text": "def check_sinergy_change\n $game_party.update_sinergy_turn\n end",
"title": ""
},
{
"docid": "064d9062ff693f3787cb2a1df6a1f52b",
"score": "0.5826983",
"text": "def check_sinergy_change\n $game_party.update_sinergy_turn\n end",
"title": ""
},
{
"docid": "0ba9c310481f309b5fea2e2c203b195b",
"score": "0.5816085",
"text": "def user_can_change_info?\n @user_to_modify = User.find_by(id:params[:id])\n @user_now = User.find_by(username: params[:current_user])\n\n if !@user_now\n return false\n end\n\n if (@user_to_modify.username != params[:current_user]) && (@user_now.role_id != 2)\n false\n else\n @user_to_modify\n end\n end",
"title": ""
},
{
"docid": "006c18d1ae65b10c586dcabe67a4c332",
"score": "0.58101726",
"text": "def update_tracked_fields!(request)\n params = request.filtered_parameters\n\n is_interact_with_tip = params['controller'] =~ /cards/ && %w(show create update destroy).include?(params['action'])\n is_sign_in = params['controller'] =~ /sessions|registrations/ && %w(create).include?(params['action'])\n\n should_update = is_sign_in || is_interact_with_tip ? true : false\n\n return unless should_update\n\n super(request)\n end",
"title": ""
},
{
"docid": "d1ddc335be3188ac2db50d6be4c99342",
"score": "0.58057773",
"text": "def update?\n user_is_admin?\n end",
"title": ""
},
{
"docid": "3570ad16e900e565abd3664036322bae",
"score": "0.5805502",
"text": "def verify_edit_or_admin\n verify_edit(true)\n end",
"title": ""
},
{
"docid": "3570ad16e900e565abd3664036322bae",
"score": "0.5805502",
"text": "def verify_edit_or_admin\n verify_edit(true)\n end",
"title": ""
},
{
"docid": "10383f3556c70f1d58ce8ade9d80053e",
"score": "0.5802765",
"text": "def update?\n user_is_owner? || user_is_admin?\n end",
"title": ""
},
{
"docid": "e144eca4d9554ef77683914df4dc3c7a",
"score": "0.58011365",
"text": "def verify_approve_fab_house_privs\n\n begin\n \n unless @logged_in_user.is_a_role_member?(Role.get_npp_role.name)\n flash['notice'] = 'Access to approve Fab Houses not allowed'\n redirect_to(:controller => 'tracker', :action => \"index\")\n end\n rescue\n flash['notice'] = 'Update not allowed - Must belong to New Product Planner group'\n redirect_to(:controller => 'tracker', :action => \"index\")\n end\n end",
"title": ""
},
{
"docid": "4d96d2856d229fa7db782f64ffe488c8",
"score": "0.5782551",
"text": "def update?\n record.awaiting_decisions? && edit?\n end",
"title": ""
},
{
"docid": "4ba83c5334b37bc9e2bf2e4e8bd7242d",
"score": "0.57798296",
"text": "def update?\n user.admin? || created_by_freelancer?\n end",
"title": ""
},
{
"docid": "36da1576c5e0115b296ee95b8f807848",
"score": "0.5779194",
"text": "def forbid_update?(*args)\n false\n end",
"title": ""
},
{
"docid": "1d329de4d659913e5624a83902856383",
"score": "0.57791907",
"text": "def christian_ministry_verify_update\n is_unverify = params[:commit] == I18n.t('views.common.un_verify')\n\n candidate_id = params[:id]\n event_key = ChristianMinistry.event_key\n @candidate = Candidate.find(candidate_id)\n candidate_event = @candidate.get_candidate_event(event_key)\n\n return admin_unverified_private(@candidate, candidate_event) if is_unverify\n\n @candidate = Candidate.find(params[:id])\n\n render_called = event_with_picture_update_private(ChristianMinistry, admin_verified: true)\n\n render :christian_ministry_verify unless render_called\n end",
"title": ""
},
{
"docid": "a8c31cfbdae0ae8b02afa4579e2bbdb4",
"score": "0.5778558",
"text": "def allows_modification?\n Dor::StateService.new(pid).allows_modification?\n end",
"title": ""
},
{
"docid": "14c4a061fbe0566640f75235670b8534",
"score": "0.57718223",
"text": "def update\n\n guardian_auth_params_exist = guardian_params[:guardian_auth_attributes]\n\n respond_to do |format|\n if @guardian.update(guardian_params.except(:guardian_auth_attributes))\n if guardian_auth_params_exist\n if !guardian_params[:guardian_auth_attributes][:email].blank?\n\n if @guardian.guardian_auth\n @guardian.guardian_auth.email = guardian_params[:guardian_auth_attributes][:email]\n @guardian.guardian_auth.save\n else\n\n new_guardian_auth = GuardianAuth.create!(:email => guardian_params[:guardian_auth_attributes][:email])\n new_guardian_auth.guardian = @guardian\n end\n end\n end\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { render :show, status: :ok, location: @guardian }\n else\n format.html { render :edit }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "503301e9affd9cc3681420022f102d98",
"score": "0.5771356",
"text": "def ensure_slot_before_update\n canceled = RegistrationStatus.where(\"name = ? OR name = ?\", \"I need a replacement! (NOT allowed 48 hrs or less)\", \"Signed up but did not attend\")\n if(canceled.exists?(registration_status_id_was))\n if(event.filled?)\n errors.add(:registration_status, \"Event is filled\")\n end\n end\n end",
"title": ""
},
{
"docid": "54b36903efbf62337aa0ac863521fef9",
"score": "0.5766252",
"text": "def may_change?(person)\n person.is_admin ||\n organizer?(person) ||\n group.leader?(person)\n end",
"title": ""
},
{
"docid": "96b31e05a2b0a99af122d717c94bd797",
"score": "0.57635206",
"text": "def authorized_for_rep_update(updater, representative)\n\t\treturn true if representative.belongs_to?(updater) || has_clearance?(updater, 'administrator')\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "f136bbbf1ceee6705493f30625a3e694",
"score": "0.57597107",
"text": "def granted?\n deg_status == 9\n end",
"title": ""
},
{
"docid": "ede93eacf718c1dff4356fae505f7618",
"score": "0.57579064",
"text": "def validate_changes_on_locked_entry\n if locked && !(changed.include?(\"status\"))\n errors.add_to_base(\"Editing of locked time entries is not allowed\")\n return false\n end\n end",
"title": ""
},
{
"docid": "597ca8419871af6628cd7104653a431d",
"score": "0.5755097",
"text": "def edit_bank_field\n authorize! :update, @bank_field\n end",
"title": ""
},
{
"docid": "1a66e45fa9bb098989dc1c79b35db39b",
"score": "0.5753325",
"text": "def update?\n # the edit here refers to the edit in material_shared_policy\n # that edit lets any admin, project_admin, or material_admin to edit the material\n # admins and material_admins makes sense in this case. project_admins require access\n # so they can update project and project cohorts of materials they aren't the owner of\n # and are not part of their project yet\n # This is needed when there are multiple authors on a project. An non project admin\n # author creates the material. Then the project admins needs to find it and mark\n # configure the advanced configuration options. Otherwise a portal admin needs to\n # get involved.\n edit? || owner?\n end",
"title": ""
},
{
"docid": "423ff54964438ed8519f0be4291541d7",
"score": "0.57519054",
"text": "def update\n raise \"Not permitted\"\n end",
"title": ""
},
{
"docid": "a56f291afe96c1e1f99c83b1c19ff142",
"score": "0.5745717",
"text": "def complete_edit_that_has_no_charge\n @registration.save!\n clear_edit_session\n if current_user\n redirect_to user_registrations_path(current_user)\n elsif current_agency_user\n redirect_to registrations_path\n else\n render_access_denied\n end\n end",
"title": ""
},
{
"docid": "298af1354785ee4bba3a3cce20bce130",
"score": "0.57377684",
"text": "def update?\n owner_or_collaborator? || admin?\n end",
"title": ""
},
{
"docid": "298af1354785ee4bba3a3cce20bce130",
"score": "0.57377684",
"text": "def update?\n owner_or_collaborator? || admin?\n end",
"title": ""
},
{
"docid": "85425d335ab4dfb26a027e7802851f09",
"score": "0.57375985",
"text": "def update\n @guardian = Guardian.find(params[:id])\n\n respond_to do |format|\n if @guardian.update_attributes(params[:guardian])\n format.html { redirect_to @guardian, notice: 'Guardian was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guardian.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e97e0beb297bd97c75ad2f59edaee76e",
"score": "0.57374233",
"text": "def check_dangerous_save_points\n Logger.info 'controllo i punti di salvataggio pericolosi'\n if $game_map.map_id == 144 #pigwarts P2\n $game_map.setup(412)\n $game_player.moveto(3, 7)\n $game_player.refresh\n end\n end",
"title": ""
}
] |
e5e193ba19ae0677a4d06f82db3c4fab
|
returns action as symbol
|
[
{
"docid": "d63f4f3155fe6688355b5b1b849dbcdc",
"score": "0.8072751",
"text": "def action\n self[:action].to_sym if self[:action]\n end",
"title": ""
}
] |
[
{
"docid": "b4a6c6f100bdfa2369b94b342f4f2d7a",
"score": "0.81268543",
"text": "def action\n \treturn self[:action].to_sym\n \n end",
"title": ""
},
{
"docid": "ff40e72dd237f424e8265e6423e4b2eb",
"score": "0.8120674",
"text": "def action_str(sym)\n\t\t\tact = InvertedActionMap[sym]\n\t\t\tunless act\n\t\t\t\traise \"Unknown action '#{sym}'\"\n\t\t\tend\n\t\t\treturn act\n\t\tend",
"title": ""
},
{
"docid": "09bed2278a9d232ff044645225a0a08e",
"score": "0.8035781",
"text": "def action\n action_name.to_sym\n end",
"title": ""
},
{
"docid": "b6479f3e4dd088741641953c388524d7",
"score": "0.7834501",
"text": "def get_action_name\n return @action\n end",
"title": ""
},
{
"docid": "9646d4fe5095a520facb506dfdbc9cb7",
"score": "0.775844",
"text": "def action_name\n @action.to_s.upcase\n end",
"title": ""
},
{
"docid": "fc8fe05b67e2f575495ee4a1b796ec93",
"score": "0.7730949",
"text": "def action\n Actions[ self[:action] ]\n end",
"title": ""
},
{
"docid": "b913b47765026881e279980a586ffa75",
"score": "0.7526866",
"text": "def action_name\n return @action_name\n end",
"title": ""
},
{
"docid": "28cc012340e862c67d024e49a66ac1c3",
"score": "0.7466353",
"text": "def base_action(action)\n \"#{action}\".tap { |result|\n result.delete_suffix!(CURRENT_ACTION_SUFFIX)\n result.delete_suffix!(SELECT_ACTION_SUFFIX)\n }.to_sym\n end",
"title": ""
},
{
"docid": "546ccaae559fac77a3368ec8b8ced8a8",
"score": "0.74307686",
"text": "def xlate_action()\n return ACTION_XLATES[@action] if (ACTION_XLATES.has_key?(@action))\n return(@action.to_s) \n end",
"title": ""
},
{
"docid": "765d492f168a6011312814b70b184713",
"score": "0.74048173",
"text": "def action_type_symbol\n case action_type.titleize\n when \"Standard Action\"\n \"fa-star\"\n when \"Move Action\"\n \"fa-arrows\"\n when \"Minor Action\"\n \"fa-sun-o\"\n when \"Free Action\"\n \"fa-star-o\"\n when \"Immediate Interrupt\"\n \"fa-fighter-jet\"\n when \"Immediate Reaction\"\n \"fa-fighter-jet\"\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "4c920db76f515309ea557014ca715591",
"score": "0.7331635",
"text": "def menu_action(action)\n if menu_action?(action)\n action.to_sym\n else\n \"#{action}#{SELECT_ACTION_SUFFIX}\".to_sym\n end\n end",
"title": ""
},
{
"docid": "09f04fc9633abb1626d8fa61b20cca85",
"score": "0.73209876",
"text": "def _find_action_name(action_name); end",
"title": ""
},
{
"docid": "38bed49f318097857c7fe13b1109bf82",
"score": "0.73056096",
"text": "def action(str)\n\t\t\tact = ActionMap[str]\n\t\t\tunless act\n\t\t\t\traise \"Unknown action '#{str}'\"\n\t\t\tend\n\t\t\treturn act\n\t\tend",
"title": ""
},
{
"docid": "481be8fe3613ea5ffe36e7e333691158",
"score": "0.72487086",
"text": "def action\n ACTIONS[self.action_id]\n end",
"title": ""
},
{
"docid": "d305f33239c69bed1a68b26adba6976c",
"score": "0.713405",
"text": "def action_name; end",
"title": ""
},
{
"docid": "35a5add9ceff206640ee650d4fec4c75",
"score": "0.71323574",
"text": "def get_action\n return @controller&.action_name&.to_sym\n end",
"title": ""
},
{
"docid": "058783d1f3531c48cf89b9d27623e9af",
"score": "0.70678246",
"text": "def action\n @attributes[:action]\n end",
"title": ""
},
{
"docid": "058783d1f3531c48cf89b9d27623e9af",
"score": "0.70678246",
"text": "def action\n @attributes[:action]\n end",
"title": ""
},
{
"docid": "e291dc517e1aee853c4be20204e4453b",
"score": "0.7040041",
"text": "def subject_from_sym(action)\n @@Subjects[action.to_sym]\n end",
"title": ""
},
{
"docid": "521ba428e4031b0a9e4ab65325c76a52",
"score": "0.7036104",
"text": "def action(name)\n actions.find { |action| action.name == name }\n end",
"title": ""
},
{
"docid": "13917e2f892e8786e013bb59c420d6db",
"score": "0.703094",
"text": "def get_action(options)\r\n action = options[:action]\r\n\r\n action\r\n end",
"title": ""
},
{
"docid": "e87371f5a718ad3f79d75f9a081b0470",
"score": "0.70295125",
"text": "def get_action_name( txn, *args )\n\t\tself.log.debug \"Fetching the intended action name from txn = %p, args = %p\" % [ txn, args ]\n\n\t\tname = args.shift\n\t\tname = nil if name.to_s.empty?\n\t\tname ||= @signature.default_action or\n\t\t\traise Arrow::AppletError, \"Missing default handler\"\n\n\t\tif (( action = self.map_to_valid_action(name) ))\n\t\t\tself.log.debug \" found what looks like a valid action (%p)\" % [ action ]\n\t\t\treturn action.to_sym, *args\n\t\telse\n\t\t\tself.log.debug \" didn't find a valid action; returning :action_missing\"\n\t\t\treturn :action_missing, name, *args\n\t\tend\n\tend",
"title": ""
},
{
"docid": "43b0e16ce9a4f0685a25c61849bba511",
"score": "0.6983408",
"text": "def action\n _action_obj.to_h\n end",
"title": ""
},
{
"docid": "f2dea338a71aa90fbd7b2771685e5b3e",
"score": "0.6915429",
"text": "def rendered_action_name\n\t\t@rendered_action || params[:action]\n\tend",
"title": ""
},
{
"docid": "c639918225cda1eb6749706d47d1f5f1",
"score": "0.6903583",
"text": "def method_for_action(action_name); end",
"title": ""
},
{
"docid": "715834860df85fe84bd8d0b80b39bf11",
"score": "0.6888825",
"text": "def to_proc\n @action\n end",
"title": ""
},
{
"docid": "f7db088bbeae1e373e909fa1c3298b60",
"score": "0.6864212",
"text": "def atom_to_action(e)\n if number? e || @@consts.include?(e)\n @const\n else\n @identifier\n end\n end",
"title": ""
},
{
"docid": "454490497d1574a1aa63bea593c1bfd8",
"score": "0.68578655",
"text": "def get_formatted_action_name\n params[:action].gsub('_','-')\n end",
"title": ""
},
{
"docid": "8681b3e6083a213e229676eb88c736bf",
"score": "0.68455774",
"text": "def action(sym, ops = {})\n\t \tops[:icon] ||= sym\n\t \tops[:title] ||= sym.to_s.humanize\n\t \tif ops[:icon].is_a?(String)\n\t \t\tadd_icon sym => ops[:icon]\n\t \t\tops[:icon] = sym\n\t \tend\n @actions[sym] = ops\n\t end",
"title": ""
},
{
"docid": "d73432aa70ff22301dcbc0f427b433d5",
"score": "0.6796044",
"text": "def translated_action_name(action)\n case action\n when :update\n :edit\n when :create\n :new\n else\n action\n end\n end",
"title": ""
},
{
"docid": "bed35cea84ef2b7a3afef27f7e4cf1ff",
"score": "0.6782203",
"text": "def tool_action_text(tool_action)\n tool_action\n end",
"title": ""
},
{
"docid": "9fe9e89b9353248e4a968b43498f0e36",
"score": "0.676097",
"text": "def action(name)\n action_method = \"action_#{name}\"\n return Actions.send(action_method) if Actions.respond_to?(action_method)\n nil\n end",
"title": ""
},
{
"docid": "d5e81740e5dd38fad014fadf2c2c6440",
"score": "0.672251",
"text": "def action\n @action ||= calculate_action\n end",
"title": ""
},
{
"docid": "ffa3ed09d5d9931b8b7290d4509b04cd",
"score": "0.6706098",
"text": "def lookup_action\n action = template.controller.action_name\n return unless action\n action = action.to_sym\n ACTIONS[action] || action\n end",
"title": ""
},
{
"docid": "f92d60e1207d874e0dbcacb6856f7b25",
"score": "0.6659236",
"text": "def to_s\n ACTIONS.keys.map do |action|\n send(action.to_sym)\n end.join('')\n end",
"title": ""
},
{
"docid": "4cc1d79379fd60633638e18678c630f4",
"score": "0.6621944",
"text": "def action a\n text a.name\n mnemonic a.mnemonic unless a.mnemonic.nil?\n command { a.call }\n end",
"title": ""
},
{
"docid": "4cc1d79379fd60633638e18678c630f4",
"score": "0.6621944",
"text": "def action a\n text a.name\n mnemonic a.mnemonic unless a.mnemonic.nil?\n command { a.call }\n end",
"title": ""
},
{
"docid": "4faa857ad39e325873bc938799817738",
"score": "0.6598112",
"text": "def [](key)\n actions[key.to_sym]\n end",
"title": ""
},
{
"docid": "4302fc4c2560ba5f1f6dd6fba5420425",
"score": "0.65628546",
"text": "def action(name)\n\t\t\t\t# Attrmpt to get the action method from the Action class if it \n\t\t\t\t# exists, otherwise return nil to show that we don't support the\n\t\t\t\t# given action\n\t\t\t\taction_method = \"action_#{name}\"\n\t\t\t\treturn Action.send(action_method) if Action.respond_to?(action_method)\n\t\t\t\tnil\n\t\t\tend",
"title": ""
},
{
"docid": "1279d9107ecb305a059000a13c49c139",
"score": "0.6517255",
"text": "def current_action\n @action\n end",
"title": ""
},
{
"docid": "54b9b0c00ecbf527bba3d14ddf0d5d29",
"score": "0.65032685",
"text": "def action\n self.params[:action]\n end",
"title": ""
},
{
"docid": "245423ef3d97d572676becf15bce3115",
"score": "0.6502955",
"text": "def resource_action_command\n ACTION_COMMANDS[action_name.to_sym]\n end",
"title": ""
},
{
"docid": "b0e412f46951ea7ece0dc481ed33a996",
"score": "0.6490016",
"text": "def action\n @params['action'] || @params[:action]\n end",
"title": ""
},
{
"docid": "e5d8c2827a24ce207d1ef5a3ee1b29e3",
"score": "0.6482116",
"text": "def action(name)\n # Attempt to get the action method from the Action class if it\n # exists, otherwise return nil to show that we don't support the\n # given action.\n action_method = \"action_#{name}\"\n return Action.send(action_method) if Action.respond_to?(action_method)\n nil\n end",
"title": ""
},
{
"docid": "9b2d0bdd3afe41913d79837bc14bf58d",
"score": "0.64805365",
"text": "def actionName _args\n \"actionName _args;\" \n end",
"title": ""
},
{
"docid": "9a5d322b9150e3123126e2c02a0b255f",
"score": "0.6438559",
"text": "def action_name=(value)\n @action_name = value\n end",
"title": ""
},
{
"docid": "6f5adeb7955a76a9168baa5042b829ec",
"score": "0.64384604",
"text": "def acquire_action\n case @event['action']\n when 'create'\n 'error'\n when 'resolve'\n 'success'\n end\n end",
"title": ""
},
{
"docid": "790fbbb85b5c47554a3c7b0985155b7a",
"score": "0.64106774",
"text": "def find_action_method( txn, action, *args )\n\t\tself.log.debug \"Mapping %s( %p ) to an action\" % [ action, args ]\n\t\treturn self.method( \"#{action}_action\" )\n\tend",
"title": ""
},
{
"docid": "8cfd4911a09a9a01c3bb34818556ced9",
"score": "0.6405762",
"text": "def get_action(action, args, text = nil)\n\t\t\twhile (alias_action = @aliases[action])\n\t\t\t\taction = alias_action[:action]\n\t\t\t\targs = alias_action[:args].map do |a|\n\t\t\t\t\ta.gsub(/\\$\\{(\\d+)(\\*q?)?\\}/) do |match|\n\t\t\t\t\t\t# expand ${1} to args[0], ${2} to args[1], etc.\n\t\t\t\t\t\t# expand ${4*} to \"#{args[4]} #{args[5]} ...\"\n\t\t\t\t\t\t# expand ${4*q} to \"\\\"#{args[4]}\\\" \\\"#{args[5]}\\\" ...\"\n\t\t\t\t\t\tidx = $1.to_i-1\n\t\t\t\t\t\tif $2 == nil\n\t\t\t\t\t\t\targs[idx] || ''\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trange = args[idx..-1]\n\t\t\t\t\t\t\trange = range.map { |arg| '\"'+arg.gsub('\"', '\"\"')+'\"' } if $2 == '*q'\n\t\t\t\t\t\t\trange.join(' ')\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\ttext = ([action] + args.map { |a| '\"'+a.gsub('\"', '\"\"')+'\"' }).join(' ') unless text\n\t\t\tfile = @variables['__FILE__']\n\t\t\tline = @variables['__LINE__']\n\n\t\t\tAction.new(self, action, args, text, file, line)\n\t\tend",
"title": ""
},
{
"docid": "011dc53aadbcd98818f80aa896eb4590",
"score": "0.6402174",
"text": "def action_synonym(name=self.action_name)\n case \"#{name}\"\n when /new/, /create/ then \"start new\".t\n when /open_rewarded/ then \"open rewarded\".t\n when /open/ then \"need attention\".t\n when /index/ then \"overview\".t\n else \"#{name}\".gsub(/_/, '').t\n end\n end",
"title": ""
},
{
"docid": "0581be0d7cd811354cec3ff1044b448e",
"score": "0.63991445",
"text": "def actionNom\n\t\treturn \"Je sais rien faire :C\"\n\tend",
"title": ""
},
{
"docid": "69e41863d3936e16011b2d04d1997ebf",
"score": "0.6397624",
"text": "def action\n args.first\n end",
"title": ""
},
{
"docid": "a7023eaceac3e5a1f11aecd4303bc424",
"score": "0.6390514",
"text": "def action\n ::HubEdos::Common::Reference::Descriptor.new(@data['action']) if @data['action']\n end",
"title": ""
},
{
"docid": "588df3fcd7af57c36b511eb8b3942bad",
"score": "0.6359262",
"text": "def _call_action(action)\n send(action)\n end",
"title": ""
},
{
"docid": "b61b79e6ac4087821f54e3d6cfd9a966",
"score": "0.6336765",
"text": "def actions() ; info[:actions] ; end",
"title": ""
},
{
"docid": "b61b79e6ac4087821f54e3d6cfd9a966",
"score": "0.6336765",
"text": "def actions() ; info[:actions] ; end",
"title": ""
},
{
"docid": "64c98f9a1353ca22c1df08c52f55b08f",
"score": "0.63348734",
"text": "def action_type\n @rule_details.actions[0].type\n end",
"title": ""
},
{
"docid": "cf9f56296081e140a5ca66058769985b",
"score": "0.6316414",
"text": "def action=(value)\n self[:action] = value.to_s if value\n end",
"title": ""
},
{
"docid": "cf9f56296081e140a5ca66058769985b",
"score": "0.6316414",
"text": "def action=(value)\n self[:action] = value.to_s if value\n end",
"title": ""
},
{
"docid": "c7d4ff9dd35b8064b860fcdc9dc678d3",
"score": "0.6307888",
"text": "def number_to_action(number)\n code = number.to_i.to_s(26).tr('0-9a-q', 'a-z')\n \"action_#{code}\"\nend",
"title": ""
},
{
"docid": "962748c3ee56739c157a40a0abf6638a",
"score": "0.6300265",
"text": "def action_strs\n @action_strs ||= user_data_as_array('action')\n @action_strs\n end",
"title": ""
},
{
"docid": "032aaed667b51d6e5c53e2c1c04e67f5",
"score": "0.62819177",
"text": "def human_action_name(action, options = {})\n defaults = lookup_ancestors.map do |klass|\n :\"#{self.i18n_scope}.actions.#{klass.model_name.i18n_key}.#{action}\"\n end\n \n defaults << :\"actions.#{action}\"\n defaults << options.delete(:default) if options[:default]\n defaults << action.to_s.humanize\n \n options.reverse_merge! :default => defaults\n I18n.translate(defaults.shift, options)\n end",
"title": ""
},
{
"docid": "5d967c8d1d5dd64c07b8d7987ece7173",
"score": "0.62545323",
"text": "def action\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 5)\n return_value = ActionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal22 = nil\n string_literal24 = nil\n __ACTION26__ = nil\n action_scope_name23 = nil\n id25 = nil\n\n tree_for_char_literal22 = nil\n tree_for_string_literal24 = nil\n tree_for_ACTION26 = nil\n stream_AT = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token AT\")\n stream_T__73 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__73\")\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ACTION\")\n stream_action_scope_name = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule action_scope_name\")\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule id\")\n begin\n # at line 127:4: '@' ( action_scope_name '::' )? id ACTION\n char_literal22 = match(AT, TOKENS_FOLLOWING_AT_IN_action_584) \n if @state.backtracking == 0\n stream_AT.add(char_literal22)\n end\n # at line 127:8: ( action_scope_name '::' )?\n alt_11 = 2\n case look_11 = @input.peek(1)\n when TOKEN_REF then look_11_1 = @input.peek(2)\n\n if (look_11_1 == T__73) \n alt_11 = 1\n end\n when RULE_REF then look_11_2 = @input.peek(2)\n\n if (look_11_2 == T__73) \n alt_11 = 1\n end\n when T__67, T__68 then alt_11 = 1\n end\n case alt_11\n when 1\n # at line 127:9: action_scope_name '::'\n @state.following.push(TOKENS_FOLLOWING_action_scope_name_IN_action_587)\n action_scope_name23 = action_scope_name\n @state.following.pop\n if @state.backtracking == 0\n stream_action_scope_name.add(action_scope_name23.tree)\n end\n string_literal24 = match(T__73, TOKENS_FOLLOWING_T__73_IN_action_589) \n if @state.backtracking == 0\n stream_T__73.add(string_literal24)\n end\n\n end\n @state.following.push(TOKENS_FOLLOWING_id_IN_action_593)\n id25 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id25.tree)\n end\n __ACTION26__ = match(ACTION, TOKENS_FOLLOWING_ACTION_IN_action_595) \n if @state.backtracking == 0\n stream_ACTION.add(__ACTION26__)\n end\n # AST Rewrite\n # elements: ACTION, id, action_scope_name, AT\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\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 # 127:44: -> ^( '@' ( action_scope_name )? id ACTION )\n # at line 127:47: ^( '@' ( action_scope_name )? id ACTION )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_AT.next_node, root_1)\n\n # at line 127:53: ( action_scope_name )?\n if stream_action_scope_name.has_next?\n @adaptor.add_child(root_1, stream_action_scope_name.next_tree)\n\n end\n\n stream_action_scope_name.reset();\n @adaptor.add_child(root_1, stream_id.next_tree)\n @adaptor.add_child(root_1, stream_ACTION.next_node)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 5)\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "24f87ec7ce4115212d20b36b999c6154",
"score": "0.6252426",
"text": "def method_for_action(action_name)\n if action_method?(action_name)\n action_name\n elsif respond_to?(:action_missing, true)\n \"_handle_action_missing\"\n end\n end",
"title": ""
},
{
"docid": "9a3e5401ace8285507af9a396ce26baa",
"score": "0.62510026",
"text": "def action\n @action ||= flow.execute\n end",
"title": ""
},
{
"docid": "e58288e9bd2dfdd752cbf60a9965ea1b",
"score": "0.6230888",
"text": "def action\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n return_value = ActionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal22 = nil\n string_literal24 = nil\n __ACTION26__ = nil\n action_scope_name23 = nil\n id25 = nil\n\n tree_for_char_literal22 = nil\n tree_for_string_literal24 = nil\n tree_for_ACTION26 = nil\n stream_AT = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token AT\" )\n stream_T__73 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__73\" )\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ACTION\" )\n stream_action_scope_name = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule action_scope_name\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n begin\n # at line 118:4: '@' ( action_scope_name '::' )? id ACTION\n char_literal22 = match( AT, TOKENS_FOLLOWING_AT_IN_action_579 )\n if @state.backtracking == 0\n stream_AT.add( char_literal22 )\n end\n # at line 118:8: ( action_scope_name '::' )?\n alt_11 = 2\n case look_11 = @input.peek( 1 )\n when TOKEN_REF then look_11_1 = @input.peek( 2 )\n\n if ( look_11_1 == T__73 )\n alt_11 = 1\n end\n when RULE_REF then look_11_2 = @input.peek( 2 )\n\n if ( look_11_2 == T__73 )\n alt_11 = 1\n end\n when T__67, T__68 then alt_11 = 1\n end\n case alt_11\n when 1\n # at line 118:9: action_scope_name '::'\n @state.following.push( TOKENS_FOLLOWING_action_scope_name_IN_action_582 )\n action_scope_name23 = action_scope_name\n @state.following.pop\n if @state.backtracking == 0\n stream_action_scope_name.add( action_scope_name23.tree )\n end\n string_literal24 = match( T__73, TOKENS_FOLLOWING_T__73_IN_action_584 )\n if @state.backtracking == 0\n stream_T__73.add( string_literal24 )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_id_IN_action_588 )\n id25 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id25.tree )\n end\n __ACTION26__ = match( ACTION, TOKENS_FOLLOWING_ACTION_IN_action_590 )\n if @state.backtracking == 0\n stream_ACTION.add( __ACTION26__ )\n end\n # AST Rewrite\n # elements: action_scope_name, ACTION, id, AT\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\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 # 118:44: -> ^( '@' ( action_scope_name )? id ACTION )\n # at line 118:47: ^( '@' ( action_scope_name )? id ACTION )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_AT.next_node, root_1 )\n\n # at line 118:53: ( action_scope_name )?\n if stream_action_scope_name.has_next?\n @adaptor.add_child( root_1, stream_action_scope_name.next_tree )\n\n end\n\n stream_action_scope_name.reset();\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_ACTION.next_node )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "ae9c18a89b14cbe503290c6c3158e154",
"score": "0.6196583",
"text": "def action_name\n name = self.request.route_obj.instance_variable_get('@named').to_s\n name.gsub!(/^#{controller_name}_?/, '')\n name = 'index' if name == ''\n name\n end",
"title": ""
},
{
"docid": "f6518d9a667268b3e4b2d0225d22a977",
"score": "0.6190294",
"text": "def issue_action\n request.request_parameters['action']\n end",
"title": ""
},
{
"docid": "b086483941102a9de1c26a439cfc0478",
"score": "0.61888427",
"text": "def action_to_name(v = nil)\n v ||= request_parameters\n v = v[:action] || v['action'] if v.is_a?(Hash)\n if v.is_a?(String) || v.is_a?(Symbol)\n v.to_s.strip.underscore\n else\n # noinspection RailsParamDefResolve\n v.try(:action_name)\n end\n end",
"title": ""
},
{
"docid": "0c6ed1ad1000c6caa4273b6babe4a974",
"score": "0.6172785",
"text": "def symbol\n # prefer a code display value since the state name may not be unique between modules\n if [email protected]? && [email protected]?\n @codes.first.display.gsub(/\\s+/, '_').downcase.to_sym\n else\n @name.gsub(/\\s+/, '_').downcase.to_sym\n end\n end",
"title": ""
},
{
"docid": "0c6ed1ad1000c6caa4273b6babe4a974",
"score": "0.6172785",
"text": "def symbol\n # prefer a code display value since the state name may not be unique between modules\n if [email protected]? && [email protected]?\n @codes.first.display.gsub(/\\s+/, '_').downcase.to_sym\n else\n @name.gsub(/\\s+/, '_').downcase.to_sym\n end\n end",
"title": ""
},
{
"docid": "6fb514231787af6a40fc9380468cacdd",
"score": "0.6170192",
"text": "def input(applied_action_as_symbol_or_string = :inspect)\r\n gets.send(applied_action_as_symbol_or_string)\r\nend",
"title": ""
},
{
"docid": "e99cbfd637a8da27c2b2e60d1caadf3b",
"score": "0.61679006",
"text": "def current_action\n params[:action]\n end",
"title": ""
},
{
"docid": "67a53f58fc28680ed5515f61c5736ef0",
"score": "0.6160662",
"text": "def action_name\n self.class.name.gsub(/Parameters/, '').underscore.to_sym\n end",
"title": ""
},
{
"docid": "2eabafafc8b60f91610962cd9efc38e1",
"score": "0.61592317",
"text": "def apphelp_action_name( action, use_default = false )\n options = use_default ? { :default => action.to_s.humanize } : {}\n t( \"uk.org.pond.canvass.action_names.#{ action }\", options )\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6152185",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6152185",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6150659",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "d2f23ff4a4b8dffdfda32ffde6144030",
"score": "0.6150403",
"text": "def action=(action)\n if !VALID_ACTIONS.include?(action.to_s.upcase)\n raise ArgumentError, \"Action must be one of #{VALID_ACTIONS.join(', ')}\"\n end\n @action = action.downcase.to_sym\n end",
"title": ""
},
{
"docid": "3d110fe08f211ff797760e342d43deb1",
"score": "0.6148391",
"text": "def get_action(str)\n puts \"Received '#{str.strip}'\" unless @quiet\n ['f','c','r'].choice\n end",
"title": ""
},
{
"docid": "2f729c4b631bb9460906c9ee1ab88b47",
"score": "0.61392033",
"text": "def action\n driver.action\n end",
"title": ""
},
{
"docid": "0ea890e5b7946daeb3ee8ba127383cfd",
"score": "0.61199766",
"text": "def expression_to_action(e)\n if atom? e\n atom_to_action e\n else\n list_to_action e\n end\n end",
"title": ""
},
{
"docid": "b60164aef7815600c722edc9dd617ffc",
"score": "0.6114423",
"text": "def action(name)\n nil\n end",
"title": ""
},
{
"docid": "6ad80b750cb448e1df60865146743033",
"score": "0.6103862",
"text": "def inspect\n \"<Action type:'#{@data[:type]}' subtype:'#{@data[:subtype]}' actor:'#{@data[:actor]}' target:'#{@data[:target]}' damage:#{@data[:damage]} ability:'#{@data[:ability_name]}' light:#{@data[:light]} format:#{@data[:format]}>\"\n end",
"title": ""
},
{
"docid": "b01315845e5a34949dad5d74ee851092",
"score": "0.6103048",
"text": "def action!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n type = ACTION\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 141:10: 'action'\n match( \"action\" )\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__, 10 )\n\n end",
"title": ""
},
{
"docid": "ad9430082e37248d632872615a90057c",
"score": "0.60967684",
"text": "def list_to_action(e)\n if atom? e\n if e == :quote\n @quote\n elsif e == :lambda\n @lambda\n elsif e == :cond\n @cond\n end\n else\n @application # -> will become a function\n end \n end",
"title": ""
},
{
"docid": "0037bd801b858795732ba8ca9c18c3ce",
"score": "0.6089535",
"text": "def available_action?(action_name); end",
"title": ""
},
{
"docid": "8d86ca419e5ccf2f559f993c4cd38847",
"score": "0.6087455",
"text": "def resource_action(resource)\n resource.action if resource.respond_to?(:action)\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.60819334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.60819334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.60819334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.60819334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.60819334",
"text": "def action; end",
"title": ""
},
{
"docid": "3ab04898a77a28dac34ff5b7d9314279",
"score": "0.608105",
"text": "def translate_action(action)\n case action\n when :index then nil # we don't want to do extra action authorization for dashboard\n when :list then :index\n when :delete, :bulk_delete, :bulk_destroy then :destroy\n else action\n end\n end",
"title": ""
},
{
"docid": "9ab861ad6cb52777abbde2ab61db99c3",
"score": "0.60799503",
"text": "def query_action\n @attributes[:query_action]\n end",
"title": ""
},
{
"docid": "352c15748947eb9b460e46ba9ac61e36",
"score": "0.6058341",
"text": "def action_name(action, i18n, name)\n i18n == true ? I18n.t(\"breadcrumbs.actions.#{action}\", :name => name) : \"#{action.titlecase} #{name}\"\n end",
"title": ""
},
{
"docid": "5ff1dd694bf6846d67719d1a79b43a7c",
"score": "0.6054355",
"text": "def find_action_by_name(name)\n actions.find { |act| act.name == name }\n end",
"title": ""
},
{
"docid": "f3e6b929feacdc8c015bb3251a710e56",
"score": "0.60452473",
"text": "def method_for_action(action_name)\n if action_method?(action_name) then action_name\n elsif respond_to?(:action_missing, true) then \"_handle_action_missing\"\n end\n end",
"title": ""
},
{
"docid": "75d7191a6ee70f8802a40c26b4423df0",
"score": "0.60425395",
"text": "def get_action(name)\n @actions ||= {}\n result = @actions[name.to_sym]\n if result.nil?\n if self.is_a?(Class) and superclass.respond_to?(:get_action)\n found = superclass.get_action(name)\n elsif self.class.respond_to?(:get_action)\n found = self.class.get_action(name)\n end\n\n if found then\n # This is not the nicest way to make action equivalent to the Ruby\n # Method object, rather than UnboundMethod, but it will do for now,\n # and we only have to make this change in *one* place. --daniel 2011-04-12\n result = @actions[name.to_sym] = found.__dup_and_rebind_to(self)\n end\n end\n return result\n end",
"title": ""
}
] |
0d87994ba71c3e2ecbdd597841b51a46
|
private API. Exposed for use by unit tests
|
[
{
"docid": "225237210a2a7f8f8cde476e5d005cc7",
"score": "0.0",
"text": "def team_name_in_teams? (a_teams, a_team_name)\n a_teams.has_key?(a_team_name.to_sym)\n end",
"title": ""
}
] |
[
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.79383147",
"text": "def private; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.65613467",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.65613467",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.65613467",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.65613467",
"text": "def specie; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.6503311",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.6503311",
"text": "def spec; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6384776",
"text": "def internal; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.63809437",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.63809437",
"text": "def implementation; end",
"title": ""
},
{
"docid": "530e65cba197567f73b8125444ac33cc",
"score": "0.62634",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2",
"score": "0.61772543",
"text": "def weber; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.6152191",
"text": "def probers; end",
"title": ""
},
{
"docid": "3103349d09f884a9193b8c4ac184a666",
"score": "0.6112027",
"text": "def wrapper; end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.61048055",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.60286576",
"text": "def schubert; end",
"title": ""
},
{
"docid": "9fbec9b2bcd97ad59997b3cbc61b2258",
"score": "0.59782815",
"text": "def handle; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5964559",
"text": "def run; end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.5950211",
"text": "def executor; end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.5950211",
"text": "def executor; end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.5950211",
"text": "def executor; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5920977",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5920977",
"text": "def custom; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.58791316",
"text": "def setup; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.58566207",
"text": "def call; end",
"title": ""
},
{
"docid": "8f30017d276b5452bcea06ff2233286c",
"score": "0.5853861",
"text": "def driver; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.582694",
"text": "def strategy; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5786934",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5786934",
"text": "def isolated; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.57772565",
"text": "def used?; end",
"title": ""
},
{
"docid": "cf2231631bc862eb0c98d89194d62a88",
"score": "0.5771935",
"text": "def identify; end",
"title": ""
},
{
"docid": "4ea6f5c11a3bc16e2394d273e748b292",
"score": "0.5746723",
"text": "def internal?; end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.5740463",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "b61a4ba68f80637b0607ef5e33968e0b",
"score": "0.5710712",
"text": "def pausable; end",
"title": ""
},
{
"docid": "b4151c446130d8bada93b3f12a97c3e7",
"score": "0.5705493",
"text": "def self_test; end",
"title": ""
},
{
"docid": "b4151c446130d8bada93b3f12a97c3e7",
"score": "0.5705493",
"text": "def self_test; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.57043123",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.57043123",
"text": "def operations; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.56992394",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.56992394",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.56992394",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.56992394",
"text": "def init; end",
"title": ""
},
{
"docid": "1a6186064d8218f9aa0c8b82bcc4fdae",
"score": "0.56900066",
"text": "def __dummy_test__\n end",
"title": ""
},
{
"docid": "9d841b89340438a2d53048b8b0959e75",
"score": "0.5682626",
"text": "def sitemaps; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.56767833",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.56767833",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.56767833",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.56767833",
"text": "def from; end",
"title": ""
},
{
"docid": "ccfe4044a5371ef1ee52c0eaecd344fc",
"score": "0.5669108",
"text": "def called_from; end",
"title": ""
},
{
"docid": "ccfe4044a5371ef1ee52c0eaecd344fc",
"score": "0.5669108",
"text": "def called_from; end",
"title": ""
},
{
"docid": "9c9a8c6758c99c7b6f1104ce967e0fe7",
"score": "0.5662512",
"text": "def get_actual\n end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.56624055",
"text": "def context; end",
"title": ""
}
] |
8c574926ba86b0d590f2b573d734c942
|
Reset all configurations to defaults.
|
[
{
"docid": "086351c1bcf449e2a310705a33045e4f",
"score": "0.0",
"text": "def reset\n @registry = {}\n @logging = false\n @line_item_limit = 1000\n end",
"title": ""
}
] |
[
{
"docid": "1bfafcd5bfa8335843ef138ddd671aa0",
"score": "0.846698",
"text": "def reset_config\n config.reset_to_defaults\n end",
"title": ""
},
{
"docid": "77fc777e88b45380dba0129c7739e285",
"score": "0.8239483",
"text": "def reset\n @config = empty_config\n end",
"title": ""
},
{
"docid": "22a3209cc7d52786d21c618c5ff4e833",
"score": "0.82084125",
"text": "def reset\n CONFIGURATION_DEFAULTS.each { |k, v| send(\"#{k}=\", v) }\n self\n end",
"title": ""
},
{
"docid": "ec6c08f5a3da361f96082b21e8bf52a7",
"score": "0.81588084",
"text": "def reset!\n configure do |c|\n DEFAULTS.each { |k, v| c.send(\"#{k}=\", v) }\n end\n end",
"title": ""
},
{
"docid": "5762158d147a190151dab9811305b7c7",
"score": "0.80851984",
"text": "def reset!\n tap { set_defaults }\n end",
"title": ""
},
{
"docid": "c53dd83ef08581d87df7daae3e5d4592",
"score": "0.79931754",
"text": "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end",
"title": ""
},
{
"docid": "c53dd83ef08581d87df7daae3e5d4592",
"score": "0.79931754",
"text": "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end",
"title": ""
},
{
"docid": "23865ac518806e0b5cbad1ab23880366",
"score": "0.795852",
"text": "def reset!\n @defaults.each do |k, v|\n instance_variable_set(k, v)\n end\n end",
"title": ""
},
{
"docid": "874c74d9fc545c132a91bd94403fac88",
"score": "0.7838846",
"text": "def reset\n configure({})\n end",
"title": ""
},
{
"docid": "51bd776e799c7c61ff033dda559547d1",
"score": "0.78136045",
"text": "def reset_defaults; end",
"title": ""
},
{
"docid": "9bd4b84004573c6b19c84c8c1e66e2ca",
"score": "0.7782891",
"text": "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end",
"title": ""
},
{
"docid": "f34b4f9163022246fdd746ed5d29089e",
"score": "0.7731974",
"text": "def reset_to_defaults\n @config_stack = [ EnvironmentSource.new, DefaultSource.new ]\n reset_cache\n end",
"title": ""
},
{
"docid": "c8c58cc71825ef514eaca00f28b922fd",
"score": "0.76822734",
"text": "def reset\n reset_config\n reset_driver\n end",
"title": ""
},
{
"docid": "7504072e91224ee4f60121941418e5d7",
"score": "0.7644079",
"text": "def reset\n Configuration.new\n end",
"title": ""
},
{
"docid": "8b3a50274ab610188a9a4b50ba0a8c85",
"score": "0.76383185",
"text": "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end",
"title": ""
},
{
"docid": "fc5f7de7cea89322e9dfa89f9f2774ce",
"score": "0.7620144",
"text": "def reset_defaults_and_overrides\n default.clear\n override.clear\n end",
"title": ""
},
{
"docid": "88e164e991a7bcc94a39a294c82dde9b",
"score": "0.7603264",
"text": "def reset\n self.configuration = Configuration.new\n end",
"title": ""
},
{
"docid": "dfeae341532e332e7d1a2a9e0c6b8af8",
"score": "0.7595221",
"text": "def reset!\n @options = defaults\n end",
"title": ""
},
{
"docid": "dfeae341532e332e7d1a2a9e0c6b8af8",
"score": "0.7595221",
"text": "def reset!\n @options = defaults\n end",
"title": ""
},
{
"docid": "bc10403c21b37829104040d2d9a48268",
"score": "0.7578822",
"text": "def reset\n @config = Config.new\n end",
"title": ""
},
{
"docid": "5b43274f651102c6f292c4e2d7503da5",
"score": "0.75546634",
"text": "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end",
"title": ""
},
{
"docid": "a909e0b9e831f4b38a9da3f5a2603f0e",
"score": "0.7551157",
"text": "def reset\n @config = nil\n end",
"title": ""
},
{
"docid": "6cd7445924303fca655fa0f5f512b1ce",
"score": "0.75479263",
"text": "def reset\n @configuration = Configuration.new\n end",
"title": ""
},
{
"docid": "8e2a4b77f79c1914b0f510181192c56c",
"score": "0.75257975",
"text": "def reset\n keys.each do |key|\n instance_variable_set(:\"@#{key}\", defaults[key])\n self\n end\n end",
"title": ""
},
{
"docid": "d9c10280e2033c6230b1d6ee9a89f407",
"score": "0.75250113",
"text": "def reset_config\n\t\t\t@config = {}\n\t\tend",
"title": ""
},
{
"docid": "99f6c91a0e72d738c8b75f575cd806db",
"score": "0.7504045",
"text": "def reset\n @config = {}\n write_config\n end",
"title": ""
},
{
"docid": "c2c64b0b3e15f05b3a575951c6871000",
"score": "0.74818105",
"text": "def reset!\n @config = Configuration.new\n end",
"title": ""
},
{
"docid": "c5d6f600ca12be258d36dbd46105c5d0",
"score": "0.7453658",
"text": "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end",
"title": ""
},
{
"docid": "c5d6f600ca12be258d36dbd46105c5d0",
"score": "0.7453658",
"text": "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end",
"title": ""
},
{
"docid": "ef90839ea55b360f19020a8f4ea6ce27",
"score": "0.74171746",
"text": "def reset\n set(default_preferences)\n end",
"title": ""
},
{
"docid": "5b14759528d0f7a74953ab66371927b9",
"score": "0.74121183",
"text": "def reset_configuration\n @configuration = nil\n end",
"title": ""
},
{
"docid": "c2a624f3cb92c98c4eb35fa7bca59544",
"score": "0.7358776",
"text": "def reset_all\n clear_commands\n reset_colors\n @app_info = nil\n @app_exe = nil\n @verbose_parameters = true\n @@default_method = nil\n @@class_cache = {}\n end",
"title": ""
},
{
"docid": "1c0ca9b03361a5a3a6c69674f42c1043",
"score": "0.73549306",
"text": "def reset(scope = :all)\n configuration.reset(scope)\n end",
"title": ""
},
{
"docid": "b059e6e4bfc01cd20713ab62a08bc70c",
"score": "0.7256001",
"text": "def reset!\n self.configuration = Configuration.new\n end",
"title": ""
},
{
"docid": "de16dbfceb3b55dc670accd11f8b9201",
"score": "0.72536445",
"text": "def reset\n self.api_key = DEFAULT_API_KEY\n self.user_agent = DEFAULT_USER_AGENT\n self.search_query_defaults = DEFAULT_SEARCH_SETTINGS\n self\n end",
"title": ""
},
{
"docid": "81d628a45374fdcc72e510d56e507eb9",
"score": "0.7229424",
"text": "def reset\n self.user_agent = DEFAULT_USER_AGENT\n self.environment = DEFAULT_ENVIRONMENT\n self.api_version = DEFAULT_API_VERSION\n self.server_url = DEFAULT_SERVER_URL\n self.client_name = DEFAULT_CLIENT_NAME\n self.client_key = DEFAULT_CLIENT_KEY\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.middleware = DEFAULT_MIDDLEWARE\n self.accept = DEFAULT_ACCEPT\n self\n end",
"title": ""
},
{
"docid": "578147f2d57db0d98994582cda1e92cc",
"score": "0.71494335",
"text": "def reset!\n self.api_key \t = DEFAULT_API_KEY\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "b2a4d8555b53701654eee6fda72677f4",
"score": "0.71366113",
"text": "def reset_conf(&block)\n reset_conf_sub\n yield\n\n # reset again to go back to default setting later. Otherwise,\n # above setting is kept later.\n reset_conf_sub\n end",
"title": ""
},
{
"docid": "f8edce819a3c47d14fda0b0bcad69c5d",
"score": "0.7121311",
"text": "def reset!\n @orm = @namespace = @source = @setting_class = nil\n self.config = nil\n self.raise_missing = nil\n self.report_missing = nil\n self.typecast_on_write = nil\n self.password_secret = nil\n end",
"title": ""
},
{
"docid": "8654c57a0a520a8569fa669256901965",
"score": "0.7121017",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n # self.response = DEFAULT_RESPONSE\n self.faraday_options = DEFAULT_FARADAY_OPTIONS\n self.login = DEFAULT_LOGIN\n self.pass = DEFAULT_PASS\n self\n end",
"title": ""
},
{
"docid": "c04addad842678ef536486f0db78125f",
"score": "0.71141154",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.authorize_endpoint = DEFAULT_AUTHORIZE_ENDPOINT\n self.token_endpoint = DEFAULT_TOKEN_ENDPOINT\n self.gateway = DEFAULT_GATEWAY\n self.access_token = DEFAULT_ACCESS_TOKEN\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "8a31e2729b9ca179b87df799dd83cff8",
"score": "0.7109437",
"text": "def reset\n self.request_headers = DEFAULT_REQUEST_HEADERS\n self.endpoint = DEFAULT_ENDPOINT\n self.monitoringdata_endpoint = DEFAULT_MONITORINGDATA_ENDPOINT\n self.applogs_endpoint = DEFAULT_APPLOGS_ENDPOINT\n self.apikey = DEFAULT_APIKEY\n end",
"title": ""
},
{
"docid": "32341fcca4798ca08ebcdd2b952d2c70",
"score": "0.7107838",
"text": "def clear\n reset_defaults\n self\n end",
"title": ""
},
{
"docid": "e2a9e0c12d169de17b84dfa713ef6c9e",
"score": "0.7092799",
"text": "def reset\n @config = nil\n @client = nil\n end",
"title": ""
},
{
"docid": "1779ec228f26023d3c5b59d4ad92d346",
"score": "0.7058606",
"text": "def reset(options={})\n options = {\n :clear => true\n }.merge(options)\n\n registry.each do |option|\n if option.respond_to?(:reset)\n option.reset\n end\n end\n\n config.clear if options[:clear]\n self\n end",
"title": ""
},
{
"docid": "82469e34521200f0a6bfee21aae62822",
"score": "0.70570225",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n end",
"title": ""
},
{
"docid": "8857d2fb700391d76b4a8ac39f7c354b",
"score": "0.70549494",
"text": "def reset\n @options = VALID_OPTIONS_KEYS.inject({}) do |opts, k|\n default_option = OnTheSnow::Config.const_get(\"DEFAULT_#{k.upcase}\")\n self.send(\"#{k}=\", default_option)\n opts[k.to_s] = default_option #unless default_option.nil?\n opts\n end\n self\n end",
"title": ""
},
{
"docid": "d622a5031b835f14ef2856eecbbb6baa",
"score": "0.7043637",
"text": "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end",
"title": ""
},
{
"docid": "db843b2ecb91cf29dd9178c21385ef78",
"score": "0.7042635",
"text": "def reset!\n DeskApi::Configuration.keys.each do |key|\n send(\"#{key}=\", DeskApi::Default.options[key])\n end\n self\n end",
"title": ""
},
{
"docid": "5c593c03431417e00b58795f0b347e3e",
"score": "0.702915",
"text": "def reset!\n reset_endpoints!\n reset_routes!\n reset_validations!\n end",
"title": ""
},
{
"docid": "1d19ee198a02110758b12b877fcff74c",
"score": "0.70286816",
"text": "def reset!\n @setting_objects = @setting_templates.map { |k, _| [k, []] }.to_h\n @settings.values.each(&:reset!)\n end",
"title": ""
},
{
"docid": "323daa598d0acb27a2bbb31889005d6c",
"score": "0.702817",
"text": "def reset\n providers.clear\n configured_providers.each { |k, v| self[k] = v }\n self.default = configured_default\n end",
"title": ""
},
{
"docid": "4e1113a1203cbd41ee5f67a7a772a61e",
"score": "0.7018244",
"text": "def reset\n self.time_step = DEFAULT_TIME_STEP\n self.availiable_days = DEFAULT_AVAILIABLE_DAYS\n self.availiable_steps = DEFAULT_AVAILIABLE_STEPS\n self.steps_day_shift = DEFAULT_STEPS_DAY_SHIFT\n end",
"title": ""
},
{
"docid": "afe57232e1b92c5e55a7b47f9f779575",
"score": "0.7017761",
"text": "def reset_defaults\n @city = nil\n @category_path = nil\n\n DEFAULTS.each do |k, v|\n var_name = \"@#{k}\".to_sym\n self.instance_variable_set(var_name, v)\n end\n end",
"title": ""
},
{
"docid": "ac0e2a64cf2e179fcacd9bee92d778a6",
"score": "0.7013239",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.user_login = DEFAULT_USER_LOGIN\n self.user_password = DEFAULT_USER_PASSWORD\n self.endpoint = DEFAULT_ENDPOINT\n self.format = DEFAULT_FORMAT\n self.proxy = DEFAULT_PROXY\n self.cookie = DEFAULT_COOKIE\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "9059c0774b2a31c21fc7876e69ba4f71",
"score": "0.7006014",
"text": "def reset!\n Whitehouse::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Whitehouse::Default.options[key])\n end\n self\n end",
"title": ""
},
{
"docid": "63b9e247a2120af556b72cc062aeffbf",
"score": "0.7005008",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "16502d07d1e9f42f04ba7c9afc619bea",
"score": "0.7001218",
"text": "def reset!\n self.api_username = DEFAULT_API_USERNAME\n self.api_key = DEFAULT_API_KEY\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.raise_errors = DEFAULT_RAISE_ERRORS\n self\n end",
"title": ""
},
{
"docid": "351e5b8f2c6c028eb50ed68e461bc5f6",
"score": "0.69997895",
"text": "def reset\n\t\t\tself.access_token = DEFAULT_ACCESS_TOKEN\n\t\t\tself.authorization_endpoint = DEFAULT_AUTHORIZATION_ENDPOINT\n\t\t\tself.client_id = DEFAULT_CLIENT_ID\n\t\t\tself.client_secret = DEFAULT_CLIENT_SECRET\n\t\t\tself.endpoint = DEFAULT_ENDPOINT\n\t\t\tself.proxy = DEFAULT_PROXY\n\t\t\tself.user_agent = DEFAULT_USER_AGENT\n\t\tend",
"title": ""
},
{
"docid": "9de49fb36d538235b1e4198b0cdcf4c7",
"score": "0.6981066",
"text": "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end",
"title": ""
},
{
"docid": "f0a962fe14fa64b220f4b01e46a755e6",
"score": "0.69630086",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.xauth_username = DEFAULT_XAUTH_USERNAME\n self.xauth_password = DEFAULT_XAUTH_PASSWORD\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.logger = DEFAULT_LOGGER\n self\n end",
"title": ""
},
{
"docid": "db0bf4c0e09452d6770633e80550a49f",
"score": "0.6962268",
"text": "def reset\n set Exchange::Configuration::DEFAULTS[key]\n end",
"title": ""
},
{
"docid": "fbe9f997c405fc45fe8d2beecba196fa",
"score": "0.69584316",
"text": "def reset!\n @options = Name.defaults.dup\n end",
"title": ""
},
{
"docid": "63620da6cccae4fd45b47e26d8b2e60e",
"score": "0.69541854",
"text": "def reset!\n @apps = {}\n @default_params = {}\n @basic_auth = nil\n end",
"title": ""
},
{
"docid": "2e5cf534e059378e0a2eb7eb1856f934",
"score": "0.6950831",
"text": "def set_defaults!\n __load_config( DEFAULTS )\n end",
"title": ""
},
{
"docid": "0019f0695061ac7a7e2b41eda6444713",
"score": "0.6935714",
"text": "def reset\n self.client_account = DEFAULT_CLIENT_ACCOUNT\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.user_agent = DEFAULT_USER_AGENT\n self.endpoint = DEFAULT_ENDPOINT\n self.adapter = DEFAULT_ADAPTER\n self.connection_type = DEFAULT_CONNECTION\n end",
"title": ""
},
{
"docid": "0d9645c9b70119e0ad3f958065c49ae0",
"score": "0.693501",
"text": "def reset\n self.api_key = DEFAULT_API_KEY\n self.api_version = DEFAULT_API_VERSION\n self.endpoint = DEFAULT_ENDPOINT\n self.adapter = DEFAULT_ADAPTER\n end",
"title": ""
},
{
"docid": "d3c25415a1c37a499b288f16b2f682f0",
"score": "0.6933445",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.organization = DEFAULT_ORGANIZATION\n self.endpoint = DEFAULT_ENDPOINT\n self.version = DEFAULT_VERSION\n self.path_prefix = DEFAULT_PATH_PREFIX\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self\n end",
"title": ""
},
{
"docid": "88cf1f060388c0cc8d374aba6944c84c",
"score": "0.69324285",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "2234ade31226c0d92b1f0f46ebed8f66",
"score": "0.69167715",
"text": "def reset\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.timeout = DEFAULT_TIMEOUT\n self.platform_credentials = DEFAULT_PLATFORM_CREDENTIALS\n self.disable_ssl_peer_verification = DEFAULT_DISABLE_SSL_PEER_VERIFICATION\n self\n end",
"title": ""
},
{
"docid": "c077cd1927f60fbfb2b5dc18dc64e890",
"score": "0.6911726",
"text": "def reset_default_fields\n self.cleared_default_fields.each do |k, v|\n self.send(\"#{k}=\", v)\n end\n end",
"title": ""
},
{
"docid": "16b59e30d3ca87c8c015a42e87386fe6",
"score": "0.6910788",
"text": "def reset!\n default_tags.clear\n adapters.clear\n groups.each_key { |group| singleton_class.send(:remove_method, group) if group && respond_to?(group) }\n @groups = nil\n metrics.each_key { |metric| singleton_class.send(:remove_method, metric) if respond_to?(metric) }\n @metrics = nil\n collectors.clear\n configurators.clear\n instance_variable_set(:@configured_by, nil)\n instance_variable_set(:@debug_was_enabled_by, nil)\n end",
"title": ""
},
{
"docid": "fd781338c8b1a729eba9399d8298880b",
"score": "0.6908638",
"text": "def reset\n @@config_instance = nil\n end",
"title": ""
},
{
"docid": "89d4cb87843c695a5e12a61c033d9ffb",
"score": "0.68950456",
"text": "def reset!\n @_store = {:default => Configatron::Store.new}\n end",
"title": ""
},
{
"docid": "50ea554ea76d626ac68c8026ec28de3d",
"score": "0.6890639",
"text": "def reset\n self.options = nil\n self.option_processors = nil\n end",
"title": ""
},
{
"docid": "082f38630e6c826eae8ae828e1a10d69",
"score": "0.686933",
"text": "def clear\n self.configuration = {}\n end",
"title": ""
},
{
"docid": "95551a499c55c18f6a4a9b7183e24dde",
"score": "0.68624395",
"text": "def reset\n self.tap do |c|\n c.base_uri = DEFAULT_BASE_URI\n c.endpoint = DEFAULT_END_POINT\n c.api_secret = DEFAULT_API_SECRET\n c.api_key = DEFAULT_API_KEY\n end\n end",
"title": ""
},
{
"docid": "fc2d14ff71309770caae88473df7dd17",
"score": "0.68578124",
"text": "def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"title": ""
},
{
"docid": "4bc48d1f3d376dcc2e56bbea0fa68b66",
"score": "0.68467075",
"text": "def reset\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.oauth_token = DEFAULT_OAUTH_TOKEN\n self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET\n self.blog_host = DEFAULT_BLOG_HOST\n self.debug = DEFAULT_DEBUG\n self\n end",
"title": ""
},
{
"docid": "60c7cb427d7e5adf119a1fbd73137335",
"score": "0.6835351",
"text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.endpoint = DEFAULT_ENDPOINT\n self.format = DEFAULT_FORMAT\n self.user_agent = DEFAULT_USER_AGENT\n self.faraday_options = DEFAULT_FARADAY_OPTIONS\n self.return_card_numbers = DEFAULT_RETURN_CARD_NUMBERS\n self\n end",
"title": ""
},
{
"docid": "0b597ed55eb8703ea3af783b7f1850a0",
"score": "0.68187076",
"text": "def reset\n self.company_id = DEFAULT_COMPANY_ID\n self.user_key = DEFAULT_USER_KEY\n self.secret_key = DEFAULT_SECRET_KEY\n self.endpoint = DEFAULT_ENDPOINT\n end",
"title": ""
},
{
"docid": "42b6fd2d87816d537db35269a89bf105",
"score": "0.68128544",
"text": "def reset_active_model_configurations!\n self.class.reset_active_model_configurations!\n end",
"title": ""
},
{
"docid": "e2a6b03de02f3835fa7ab1c093ac5b56",
"score": "0.6811186",
"text": "def reset\n # Empty, but subclasses will override this.\n end",
"title": ""
},
{
"docid": "cfc557784c127cb38362271abc0d5b6f",
"score": "0.6806587",
"text": "def reset\n self.mount_at = DEFAULT_MOUNT_AT\n self.dfly = DEFAULT_DFLY\n self.tabs = DEFAULT_TABS\n self.allowed_mime_types = DEFAULT_ALLOWED_MIME_TYPES\n self.icons = DEFAULT_ICONS\n self\n end",
"title": ""
},
{
"docid": "32aa3026cf308aa168efbef23bd34ff3",
"score": "0.6792019",
"text": "def delete_all\n @configuration = nil\n end",
"title": ""
},
{
"docid": "32aa3026cf308aa168efbef23bd34ff3",
"score": "0.6792019",
"text": "def delete_all\n @configuration = nil\n end",
"title": ""
},
{
"docid": "392aaa09c3d1885b9efb95e29badb3d8",
"score": "0.6786414",
"text": "def reset\n self.api_id = DEFAULT_API_ID\n self.url = DEFAULT_API_URL\n self.api_key = DEFAULT_API_KEY\n self.certificate_chain = DEFAULT_CERTIFICATE_CHAIN\n end",
"title": ""
},
{
"docid": "262b08ac87cbd4fb6c0fa888c9bb808f",
"score": "0.6777424",
"text": "def reset!\n Foxkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Foxkit::Default.options[key])\n end\n self\n end",
"title": ""
},
{
"docid": "8ea6208421bd2995908c957cbf2ea32d",
"score": "0.6772105",
"text": "def reset\n @git = nil\n @configuration = nil\n end",
"title": ""
},
{
"docid": "556cfaa5865eed9acfab7d8161428c66",
"score": "0.6760528",
"text": "def reset!\n Unleashed::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Unleashed::Default.options[key])\n end\n\n self\n end",
"title": ""
},
{
"docid": "b80a7bc33e20d11f972e41d53f0778fe",
"score": "0.67596895",
"text": "def reset\n initialize\n @log = nil\n @default_model = nil\n end",
"title": ""
},
{
"docid": "c7686167f2cdcefe6503e3ec8d7b0634",
"score": "0.6756086",
"text": "def reset\n self.endpoint = DEFAULT_ENDPOINT\n self.authmethod = DEFAULT_AUTH_METHOD\n self.apikey = DEFAULT_API_KEY\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.oauth_token = DEFAULT_OAUTH_TOKEN\n self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "15ab6f18ae2ee383d01447b9e69fed81",
"score": "0.6745041",
"text": "def reset_env\n clear_env\n set_env self.env_defaults\n end",
"title": ""
},
{
"docid": "25f54b8b27304db847b522e2a8d11b8a",
"score": "0.6737989",
"text": "def reset\n self.api_key = nil\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.platform_client_id = nil\n self.platform_client_secret = nil\n self\n end",
"title": ""
},
{
"docid": "0fde92164e674a3261dd845363495ae0",
"score": "0.6725831",
"text": "def reset\n @options = Marshal.load(@default)\nend",
"title": ""
},
{
"docid": "193f07fbed6b59676718bf78ac95283b",
"score": "0.672348",
"text": "def reset_options\n VALID_OPTIONS_KEYS.each do |key|\n send(\"#{key}=\", default_options[key])\n end\n end",
"title": ""
},
{
"docid": "8fd6fcb64b350f6849e09c1b835c569d",
"score": "0.6722867",
"text": "def reset\n\t\tself.clear\n\t\tme = self\n\t\t@default_values.each {|n,v| me[n] = v.is_a?(Class) ? nil : v}\n\tend",
"title": ""
},
{
"docid": "fa15eea98ff6c56be57ae3211fd91dd3",
"score": "0.669762",
"text": "def reset\n self.remote_host = DEFAULT_REMOTE_HOST\n self.remote_port = DEFAULT_REMOTE_PORT\n self.local_host = DEFAULT_LOCAL_HOST\n self.local_port = DEFAULT_LOCAL_PORT\n self.auto_connect = DEFAULT_AUTO_CONNECT\n self\n end",
"title": ""
},
{
"docid": "d12b0e144d0519232ff1712b9a659258",
"score": "0.6696899",
"text": "def reset!\n Gocdkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Gocdkit::Default.options[key])\n end\n self\n end",
"title": ""
},
{
"docid": "95329ad8c14fafe2b12fec1921c0f76c",
"score": "0.66865706",
"text": "def reset\n self.host = DEFAULT_HOST\n self.key = DEFAULT_KEY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end",
"title": ""
},
{
"docid": "6d5f9cb6aad718fb3d20d541117fc6c5",
"score": "0.66780645",
"text": "def reset!\n @options = {}\n end",
"title": ""
}
] |
787cda9a48338d0a776817b0456a75bf
|
draw? determines if there is a draw a draw occurs when the board is full and there are no winners
|
[
{
"docid": "05431893f2d1104d1d194d94b57f6377",
"score": "0.82630926",
"text": "def draw?(board)\n if full?(board) && !(won?(board))\n true\n else\n false\n end\nend",
"title": ""
}
] |
[
{
"docid": "7c26f0eed6b7b5edf7c25302774963d2",
"score": "0.8570771",
"text": "def draw?\n !board.include?(0) && winner.nil?\n end",
"title": ""
},
{
"docid": "40868cb9f0e33f296d08319e107def7d",
"score": "0.84652853",
"text": "def draw?\n @board.full? && !won?\n end",
"title": ""
},
{
"docid": "c6519ec764d861e30c38888c0c94f923",
"score": "0.84602374",
"text": "def draw?\n !won? && board.full?\n end",
"title": ""
},
{
"docid": "38d45b60d3a1dc340cd66ec7c205e3b5",
"score": "0.84578645",
"text": "def draw?\n @board.full? && !won?;\n end",
"title": ""
},
{
"docid": "0d6cca871cc0176f832f6ed4723021cc",
"score": "0.84537107",
"text": "def draw?\n @board.full? && !won?\n end",
"title": ""
},
{
"docid": "0d6cca871cc0176f832f6ed4723021cc",
"score": "0.84537107",
"text": "def draw?\n @board.full? && !won?\n end",
"title": ""
},
{
"docid": "52c65e93accd1eb190bfbe3c85b63558",
"score": "0.84451616",
"text": "def draw?(board)\n !won?(board) && full?(board)\n end",
"title": ""
},
{
"docid": "55b9a7cfc6b6de9b3870cba7a4767835",
"score": "0.84433496",
"text": "def draw? (board)\n if !won?(board) #returns true if no win\n if full?(board) #but board is full\n return true\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "2ed7f2001adbcf82658bb69fb8e06a70",
"score": "0.8412661",
"text": "def draw?(board)\n if (full?(board) == false)\n return false\n else\n if (won?(board) != false)\n return false\n else\n return true\n end\n end\n end",
"title": ""
},
{
"docid": "02195acd54ab46bf2f907af50aa6e52b",
"score": "0.84040356",
"text": "def draw?\n board.full? && self.won? == false\n end",
"title": ""
},
{
"docid": "2d75f6d6bebaf8b9633e86f6d0bf7d9b",
"score": "0.8403008",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n elsif !won?(board) && full?(board)\n return false\n elsif won?(board)\n return false\n end\n end",
"title": ""
},
{
"docid": "87ff74b540bad2f2b475b8dba32145dc",
"score": "0.8394177",
"text": "def draw?\n incomplete_board = !full?\n is_game_won = won?\n if incomplete_board == true\n return false\n elsif is_game_won.is_a?(Array)\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "1ea10ba7c7f8ae413de9c99c43dba4ce",
"score": "0.83814377",
"text": "def draw?\n # board is full, but not won\n if full? && !won?\n true\n # board is not full and not won\n elsif full? == false\n false\n # false for game won in first row or game won diagonally\n # elsif won?(board) == [0,1,2] || won?(board) == [0,4,8] || won?(board) == [2,4,6]\n # false\n end\n end",
"title": ""
},
{
"docid": "2811d13d19bf2bcec39e80c243f7df7f",
"score": "0.8372211",
"text": "def draw?(board)\n\tif won?(board) == nil && full?(board) == true\n\t\treturn true\n\tend\nend",
"title": ""
},
{
"docid": "cd1be75703986153138fc94effe5449d",
"score": "0.8362096",
"text": "def draw?\n self.board.full? && !self.won?\n end",
"title": ""
},
{
"docid": "537d9984fd7f957148b8ff51bb4b62f7",
"score": "0.83545357",
"text": "def draw?(board)\n\t if !won?(board) && full?(board)\n\t return true\n\t else\n\t return false\n\t end\nend",
"title": ""
},
{
"docid": "1e7d7c279778c9f1cae8c85289cdd7c8",
"score": "0.8347892",
"text": "def draw?\n if @board.include?(nil) \n return false\n elsif winner == false && @board.include?(nil) == false\n return true\n end\n end",
"title": ""
},
{
"docid": "c6d25b8515c7b22270374148db09ab9f",
"score": "0.8340121",
"text": "def draw?(board)\n board_complete = full?(board)\n board_won = won?(board)\n board_complete && !board_won ? true : false\nend",
"title": ""
},
{
"docid": "43da36eb8ba8daed225b6c18d92a0c0d",
"score": "0.83363557",
"text": "def draw? (board)\n isFull = full?(board)\n isWon = won?(board)\n (isFull && isWon == false)\nend",
"title": ""
},
{
"docid": "f9199313ee64ceaeaf83f7f12453ee4b",
"score": "0.8329495",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n elsif !won?(board) && !full?(board)\n return false\n else won?(board)\n return false\n end\n end",
"title": ""
},
{
"docid": "db557ecaaa042e2b008a22c8043dd6a0",
"score": "0.83037376",
"text": "def draw?(board)\n if (full?(board) == TRUE && won?(board) == FALSE)\n return TRUE\n else\n return FALSE\n end\nend",
"title": ""
},
{
"docid": "89f31ccc6d58d1c36fd55b44d6997c09",
"score": "0.82800066",
"text": "def draw?\n if self.won? == nil && self.board.full?\n true\n elsif self.won? != nil || !self.board.full?\n false\n end\n end",
"title": ""
},
{
"docid": "63e876e4dcabed85b45b6dab4ca2c271",
"score": "0.8271622",
"text": "def draw?(board)\n if not won?(board)\n return full?(board)\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "7a08333dfeda4d9288346be2efe19172",
"score": "0.82688093",
"text": "def draw?(board)\n return full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "165b80ee6ab93e3c57f3f87a14ae35df",
"score": "0.82658976",
"text": "def draw?(board)\r\n if full?(board) && !won?(board)\r\n true\r\n else\r\n false\r\n end\r\nend",
"title": ""
},
{
"docid": "140d1152ec5662fab3ae1d671f1d3df1",
"score": "0.82551485",
"text": "def draw?(board)\n return !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "c436d02efaa1a1fd35bb51088977b311",
"score": "0.8246555",
"text": "def draw?(board)\n #must be true for a draw, false for in progress,<<so use full? then && so that both sides must evauluate true and since it must be false for a won game >> !won?\n full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "1e3e869ba871d9f829b7f0b48af26a21",
"score": "0.82435066",
"text": "def draw?(board)\n if full?(board)\n if !won?(board)\n return true\n else\n return false\n end\n end\nend",
"title": ""
},
{
"docid": "228ad0ca572e6822c072ab0e6d1fb0f0",
"score": "0.8240043",
"text": "def draw?(board)\n if full?(board) && !won?(board) then return true\n end\nend",
"title": ""
},
{
"docid": "68758f59a80df800d9103d4b9732297b",
"score": "0.823838",
"text": "def draw? (board)\n if full?(board) == true\n !won?(board)\n end\nend",
"title": ""
},
{
"docid": "a64a551e274285680ea5a5fac3e07ebc",
"score": "0.823103",
"text": "def draw?(board)\n (full?(board)) && !(won?(board))\nend",
"title": ""
},
{
"docid": "3b65c6358d29c1f3dd780b9fc4b7de0b",
"score": "0.8223372",
"text": "def draw?(board)\n full?(board) && !(won?(board))\nend",
"title": ""
},
{
"docid": "8feb7b70b6e45ea6a21b4855658f4938",
"score": "0.8221888",
"text": "def draw?(board)\n (full?(board) && !won?(board)) ? true : false\nend",
"title": ""
},
{
"docid": "09ea4b047548c5ed28a63759e33900e4",
"score": "0.8216672",
"text": "def draw?(board)\n full = full?(board) == true\n won = won?(board) != false\n\n if ( !won && full )\n return true\n\n elsif ( !won && !full )\n return false\n\n elsif ( won )\n return false\n end\nend",
"title": ""
},
{
"docid": "e3e35e5950ee89c26647d96da508b6bd",
"score": "0.8215765",
"text": "def draw?(board)\n if won?(board)\n false\n elsif full?(board)\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "e3e35e5950ee89c26647d96da508b6bd",
"score": "0.8215765",
"text": "def draw?(board)\n if won?(board)\n false\n elsif full?(board)\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "3ebde0bbb6e3e133542a649c3103d1f1",
"score": "0.821436",
"text": "def draw?(board)\n if won?(board) || !full?(board)\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "64bf5eaa23fa854527c5800c1d7b47f4",
"score": "0.82141393",
"text": "def draw?(board)\n if (full?(board) && !won?(board))\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "89cbbe543218fc38dbfab7b7bf55dfdc",
"score": "0.82112277",
"text": "def draw?(board)\n if full?(board) && !(won?(board))\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "a45444613ba1dfc94c22f43ee1f7ed74",
"score": "0.820883",
"text": "def draw?(board)\n full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "a45444613ba1dfc94c22f43ee1f7ed74",
"score": "0.820883",
"text": "def draw?(board)\n full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "a45444613ba1dfc94c22f43ee1f7ed74",
"score": "0.820883",
"text": "def draw?(board)\n full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "a45444613ba1dfc94c22f43ee1f7ed74",
"score": "0.820883",
"text": "def draw?(board)\n full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "cd9c79beae6bcdbacdaa3abe8477fad2",
"score": "0.82072735",
"text": "def draw?(board)\n return full?(board) && !won?(board) ? true : false\nend",
"title": ""
},
{
"docid": "89abb716a915fc4d4be8028efab511ab",
"score": "0.8204688",
"text": "def draw?(board)\n if full?(board) && !won?(board)\n true\n elsif !(won?(board) && full?(board)) || won?(board)\n false\n end\nend",
"title": ""
},
{
"docid": "4e95ee4181f5c24e7078e07fe051cd41",
"score": "0.8201256",
"text": "def draw?(board)\n if (!full?(board) && !won?(board)) || won?(board)\n false\n elsif full?(board) == true\n true\n end\nend",
"title": ""
},
{
"docid": "db1246ea0174eace7b682370b988d490",
"score": "0.81983155",
"text": "def draw?(board)\n if won?(board) == nil && full?(board) == true\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "db1246ea0174eace7b682370b988d490",
"score": "0.81983155",
"text": "def draw?(board)\n if won?(board) == nil && full?(board) == true\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "d30413340e995e7d49682b7f92a4c100",
"score": "0.8191425",
"text": "def draw?(board)\n if won?(board)\n return false\n elsif !won?(board) && full?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "243d7900549fd0cfe12b8d10bbacaa79",
"score": "0.8187636",
"text": "def draw?(board)\n if full?(board) && !won?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "243d7900549fd0cfe12b8d10bbacaa79",
"score": "0.8187636",
"text": "def draw?(board)\n if full?(board) && !won?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "79d53e9bf8079626df9be9905b9df9ba",
"score": "0.81875235",
"text": "def draw?(board)\n full?(board) && !won?(board)\n #full?(board) && won?(board) == false\n #with ^^ didnt \"return true for draw\"\nend",
"title": ""
},
{
"docid": "f3c1a594d494cf17d32de112cd33480c",
"score": "0.8182421",
"text": "def draw?\n board.full_board?\n end",
"title": ""
},
{
"docid": "05a3b8ad528b83b00b03e3924a5526dd",
"score": "0.818108",
"text": "def draw?(board)\n if won?(board) == nil && full?(board) == true\n return true\n end\nend",
"title": ""
},
{
"docid": "920a47c12719ccb71a94e0a2273f574f",
"score": "0.8176723",
"text": "def draw?(board)\n if won?(board) == false && full?(board) == true\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "0b22fe4906cbdf94065cd70d89c5a64a",
"score": "0.817569",
"text": "def draw?(board)\n if full?(board) == true && won?(board) == false\n true\n end\nend",
"title": ""
},
{
"docid": "052334493e984d3718ca1f4f97c63d96",
"score": "0.8173321",
"text": "def draw?\n if not won?\n return full?\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "37a2a8cc44b0a189bc5926f1fa85c2ab",
"score": "0.8169268",
"text": "def draw?(board)\n if !won?(board) && full?(board) \n return true \n elsif !won?(board) && !full?(board) \n return false \n elsif won?(board) \n return false\n end\nend",
"title": ""
},
{
"docid": "1aa7e5da70b53d30960502adf84f88c6",
"score": "0.8167392",
"text": "def draw?(board)\n if !(won?(board)) && full?(board)\n return true\n end\nend",
"title": ""
},
{
"docid": "59756dd9ed35d55c4e3c2ab2d0779ffc",
"score": "0.8163665",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "e6dfda9b2fa8a265319f0610118cf175",
"score": "0.81633365",
"text": "def draw?(board)\n if won?(board) == false && full?(board) == true\n return true\n end\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "d4c600da42d93a72867ff31c7f51927c",
"score": "0.8160222",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "ca48e0ddbf6c14f12867224c2609d575",
"score": "0.8154084",
"text": "def draw?(board)\n !won?(board) && full?(board)\nend",
"title": ""
},
{
"docid": "0cc84bdb746ba8d3b16b72fe7bba7599",
"score": "0.8153707",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "0cc84bdb746ba8d3b16b72fe7bba7599",
"score": "0.8153707",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "0cc84bdb746ba8d3b16b72fe7bba7599",
"score": "0.8153707",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "15d11ffa85cba183432bb6850e651421",
"score": "0.81523746",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n elsif !won?(board) && !full?(board) || won?(board)\n return false\n end\nend",
"title": ""
},
{
"docid": "4834634a1911cf51393032f989dd2b9c",
"score": "0.814869",
"text": "def draw?(board)\n if won?(board)\n return false\n elsif full?(board)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "fb7b77ec6557b4c7386a1dcb0b534e94",
"score": "0.8145283",
"text": "def draw?(board)\n redundant = won?(board)\n if redundant\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "1e90515a674182cc053b1b6873fad4e7",
"score": "0.8143673",
"text": "def draw?(board)\n won = won?(board)\n full = full?(board)\n if won == false && full == true\n return true\n elsif won == false && full == false\n return false\n end\nend",
"title": ""
},
{
"docid": "a4ad9183736393f45bc08b2f6dd247ba",
"score": "0.81433386",
"text": "def draw?(board)\n won?(board) == nil && full?(board) == true\nend",
"title": ""
},
{
"docid": "ac96491ca66ee202f2b43457e986c3a1",
"score": "0.8142953",
"text": "def draw?(board)\n won?(board) == false && full?(board) == true ? true : false\nend",
"title": ""
},
{
"docid": "6b3b3ebd55104bce86647b4fd8ca95e4",
"score": "0.81395614",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n if !won?(board) && !full?(board) && won?(board)\n return false\n end\nend\nend",
"title": ""
},
{
"docid": "38c9e814c62d784eadc665adf029acea",
"score": "0.813857",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n end\nend",
"title": ""
},
{
"docid": "38c9e814c62d784eadc665adf029acea",
"score": "0.813857",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n end\nend",
"title": ""
},
{
"docid": "d59bea4de5022f7212e6f1892506f256",
"score": "0.81370646",
"text": "def draw?(board)\n if full?(board) && (won?(board) == false)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "3f8f9edb8d9c97834155808edf9d7f2a",
"score": "0.81326264",
"text": "def draw?(board)\n if won?(board) # BROKEN! If #won? returns an array, return false\n false\n elsif !won?(board) && full?(board) # Draw conditions: No win and full board\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "d0e95c14f736cae9af1bf959d07a4409",
"score": "0.81300485",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n end\nend",
"title": ""
},
{
"docid": "0e493b0417673f5649d90a2eea534f66",
"score": "0.81295925",
"text": "def draw?(board)\n if (!won?(board)) && (full?(board))\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "78c0072244af3126c8f75a2c294126d8",
"score": "0.8128006",
"text": "def draw?(board)\n if full?(board) == true && won?(board) == false\n return true\n end\nend",
"title": ""
},
{
"docid": "4ee0de721ef7d17b9e230b5a2e10e0ed",
"score": "0.8125742",
"text": "def draw?(board)\n if won?(board) != false || full?(board) == false\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "21bdcfc1b7e557c2237389b62e2fe330",
"score": "0.8119441",
"text": "def draw?(board)\nfull?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "9b6b9a8adcc28db4e1e7952d5099a951",
"score": "0.81184804",
"text": "def draw?(board)\n if !won?(board) && full?(board)\n return true\n elsif !won?(board) && !full?(board)\n return false\n else won?(board)\n return false\n end\nend",
"title": ""
},
{
"docid": "d39e3dc93906370405065b6e9bd637c7",
"score": "0.8102046",
"text": "def draw?\n winner.nil? && board.flatten.none? {|cell| cell == '.'}\n end",
"title": ""
},
{
"docid": "8fe5be304ec0c2f0f1075d3f68ef1db2",
"score": "0.80999",
"text": "def draw?(board)\n if won?(board) == nil && full?(board) == true\n return true\n end\n\nend",
"title": ""
},
{
"docid": "dcf669deaa18fb92d44a3bc00e9eb62c",
"score": "0.8099824",
"text": "def draw?(board)\n\n if full?(board) == true\n if won?(board) == nil\n return true\n else\n return false\n end\n else\n return false\n end\n\nend",
"title": ""
},
{
"docid": "d57b99e232876004fd9469b2582cf5fb",
"score": "0.8097815",
"text": "def draw?\n if won? == nil && full? == true\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "255c425d01606f1132103d3f8f2c5e6d",
"score": "0.8091188",
"text": "def draw?(board)\n if !won?(board) && !full?(board)\n elsif won?(board)\n else !won?(board) && full?(board)\n return true\n end\nend",
"title": ""
},
{
"docid": "1a7f41f86c382f794c7d24ec174c383b",
"score": "0.80880845",
"text": "def draw?(board)\n if won?(board) == false\n return true\n elsif full?(board) == true && won?(board) == false\n return true\n elsif full?(board) == false && won?(board) == false\n return false\n end\nend",
"title": ""
},
{
"docid": "37577793f933e6d36258d20f7589ebd7",
"score": "0.8075812",
"text": "def draw?(board)\n won?(board) == false && full?(board) ? true : false\n # full?(board) && !won?(board)\nend",
"title": ""
},
{
"docid": "c1e94cb1bc418713d41d4f12e4aede08",
"score": "0.8068122",
"text": "def draw?(board_array)\r\n full?(board_array) && !won?(board_array)\r\nend",
"title": ""
},
{
"docid": "56a33385ee6ab143f28f83b02d15e1f6",
"score": "0.80464685",
"text": "def draw?(board)\n won_check = won?(board)\n fullboard_check = full?(board)\n if won_check == false && fullboard_check == true\n return true\n elsif won_check == false && fullboard_check == false\n return false\n elsif won_check != false\n return false\n end\nend",
"title": ""
},
{
"docid": "128382daddb53c539436dd809b848a43",
"score": "0.80389744",
"text": "def draw? \n if full? == true\n !won?\n end\n end",
"title": ""
},
{
"docid": "360c7ca23b5cb58fb914a0c37e9d6548",
"score": "0.80388474",
"text": "def draw?\n won? == false && full? ? true : false\n end",
"title": ""
}
] |
09abe74dda9d3251d1acaf8f6f35ef18
|
Similar to Stringnothing?, except it joins all the elements first and does the same check. Example: [" ", " ", ""].nothing? => true Returns: True or false.
|
[
{
"docid": "f5ff165fcac94320df5ea245b4beabca",
"score": "0.8320959",
"text": "def nothing?\n\t\tjoin('').strip.empty?\n\tend",
"title": ""
}
] |
[
{
"docid": "250cc0d0270fa04b46692c2321aca4d0",
"score": "0.7179955",
"text": "def effectively_empty( value )\n value.nil? || value.to_s.empty?\n end",
"title": ""
},
{
"docid": "541399cc3f18a81204e38119c3fc4066",
"score": "0.6976455",
"text": "def empty?\n all? { |v| v.to_s.empty? }\n end",
"title": ""
},
{
"docid": "e5dfba95189200814189206406189803",
"score": "0.6916641",
"text": "def any_empty?\n self.any? { |element| element.to_s.empty? }\n end",
"title": ""
},
{
"docid": "81536ee69aadb6c034369b8a378121fd",
"score": "0.69036376",
"text": "def any_empty?\n\t\tself.any? {|elem| elem.to_s.empty?}\n\tend",
"title": ""
},
{
"docid": "def5fb4baae8c5dc38b9964b8cbfaca9",
"score": "0.69029737",
"text": "def any_empty?\n self.any? { |element| element.to_s.empty? }\n end",
"title": ""
},
{
"docid": "19e40ef15d02c8912c99b2a6192d2654",
"score": "0.68897384",
"text": "def all_empty?(words = [])\nend",
"title": ""
},
{
"docid": "fa4cb803ce5fc6b01cbd2ea99e13e045",
"score": "0.68786436",
"text": "def empty?\n to_s.empty?\n end",
"title": ""
},
{
"docid": "b3e648d9dfee45ce3d4af258534ba4a1",
"score": "0.68503827",
"text": "def empty?(*args)\n args.flatten.any? {|arg| (arg || '').strip.empty? }\n end",
"title": ""
},
{
"docid": "74077115cef5261ec532a3869a860c42",
"score": "0.68478054",
"text": "def empty? t\n !t ? true : clean(t).gsub(' ','') == ''\nend",
"title": ""
},
{
"docid": "edf49f5ff2db6da65948ae3fac76e35b",
"score": "0.6829157",
"text": "def empty?(*args)\n args.flatten.any? {|arg| (arg || '').strip.empty? }\n end",
"title": ""
},
{
"docid": "ef9096e1f035123cbe0320651488b1c8",
"score": "0.6820712",
"text": "def all_empty?(words = [])\n # words.all? { |word| word == '' }\n # words.all?(&:empty?)\n # words.reduce(:+).gsub(' ', '').length.zero? => Omits spaces as ASCII characters\n # words.map(&:size).reduce(:+).zero? \n # words.all? { |word| word.empty? || word == ' ' }\n words.count(\"\") == words.length \nend",
"title": ""
},
{
"docid": "852fee398ae8862072e74ade1a1f570f",
"score": "0.6807385",
"text": "def strip_empty?\n @strip_empty\n end",
"title": ""
},
{
"docid": "d45ba07c42e3e9801b91c68f3b277098",
"score": "0.6711373",
"text": "def not_empty!(*args)\n if args.any?{|arg| arg.nil? or arg.to_s.empty?}\n coercion_error!\n end\n args\n end",
"title": ""
},
{
"docid": "d474b4097dba3e885c1712fed146e205",
"score": "0.6657406",
"text": "def blank?\n # The regexp that matches blank strings is expensive. For the case of empty\n # strings we can speed up this method (~3.5x) with an empty? call. The\n # penalty for the rest of strings is marginal.\n empty? || BLANK_RE === self\n end",
"title": ""
},
{
"docid": "3b7e5c41009439e05e0d995acfd29b09",
"score": "0.6648694",
"text": "def is_blank? item\n\titem.nil? || item.gsub(/\\s+/, \"\").empty?\nend",
"title": ""
},
{
"docid": "805d8cb37a8dd17bfb49c4784452be4f",
"score": "0.66416276",
"text": "def blank?\n strip.empty?\n end",
"title": ""
},
{
"docid": "332d4f3c87f4afab421f8ffdf7e3e577",
"score": "0.66341025",
"text": "def blank?\n words.empty?\n end",
"title": ""
},
{
"docid": "67181fbcc2dec1143a1b68b6fc4dd8b5",
"score": "0.66108614",
"text": "def blank?\n self.strip.length === 0\n end",
"title": ""
},
{
"docid": "a103442279d1fa72ef5ce8d42670b03f",
"score": "0.6581614",
"text": "def musketeer *values\n values.join '' unless values.include? nil\n end",
"title": ""
},
{
"docid": "3eef09b965571a73a29201b35ea7e828",
"score": "0.65786624",
"text": "def blank?\n strip.size == 0\n end",
"title": ""
},
{
"docid": "e82385c9360de8bc3606bc6d6e57e846",
"score": "0.6576876",
"text": "def effectively_empty?(str)\n s = str.gsub(/[^A-Za-z0-9\\s]/, '').strip\n unique_terms = s.downcase.split(/\\s+/).uniq\n s.blank? || unique_terms.reject {|e| e == 'and' || e == 'or'}.empty?\n end",
"title": ""
},
{
"docid": "d80ea5e242e030a36b0497e93d7152ca",
"score": "0.6571984",
"text": "def blank?\n self.strip.empty?\n end",
"title": ""
},
{
"docid": "652e093a1608567525fbb9bb955d0160",
"score": "0.6566843",
"text": "def empty_content?(element)\n element.texts.join.blank?\n end",
"title": ""
},
{
"docid": "16d839a5ad9b17eadc13ecdcea43f1df",
"score": "0.65290654",
"text": "def none_empty?\n !any_empty?\n end",
"title": ""
},
{
"docid": "16d839a5ad9b17eadc13ecdcea43f1df",
"score": "0.65290654",
"text": "def none_empty?\n !any_empty?\n end",
"title": ""
},
{
"docid": "9219a45a8ef9fe021199671abdec715c",
"score": "0.6524197",
"text": "def empty?\n all? { |k, v| v && v.empty? && !v.is_a?(String) }\n end",
"title": ""
},
{
"docid": "15f7e9bac55216190750dd6ad56123b1",
"score": "0.6516716",
"text": "def empty?\n all? { |k, v| v && v.empty? && !v.is_a?(String) }\n end",
"title": ""
},
{
"docid": "2f5afd9f3b5ddc5e961715106d6fad13",
"score": "0.6494463",
"text": "def all?\n names.include? ''\n end",
"title": ""
},
{
"docid": "f19fdd4be46dafa6775f95fe13eea2d1",
"score": "0.64898866",
"text": "def blank?\n self.strip.size == 0\n end",
"title": ""
},
{
"docid": "b1f2d25c32a23b6da8798ff707102573",
"score": "0.64787084",
"text": "def blank?( string )\n string.respond_to?(:empty?) ? !!string.empty? : !string\n end",
"title": ""
},
{
"docid": "0b0333bc8756e6e565754ea5ea9527e4",
"score": "0.64768356",
"text": "def any_empty(*params)\n params.each do |param|\n if param == nil or param == ''\n return true\n end\n end\n false\n end",
"title": ""
},
{
"docid": "71c7b5534ce1e4457741e74b54c9388d",
"score": "0.6471461",
"text": "def is_empty(s)\n return true if s.nil?\n return true if s.length == 0\n return false\n end",
"title": ""
},
{
"docid": "36d335c9fb29ea1c86e01e076d202291",
"score": "0.64407504",
"text": "def test_String_001_isBlank\n \n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_String_001_isBlank\")\n puts2(\"#######################\")\n \n # Space, tab, empty, and formatting strings that should test as blank\n aStrings = [\" \", ' ', \" \", \"\", \"\\n\", \"\\t\"]\n aStrings.each do | sString |\n puts2(\"Expeced Blank: \" + sString.is_blank?.to_s)\n end\n \n # Strings that should test and NOT blank\n aStrings = [\"a\", \"a b\", \" a \", \" b \", 120.chr]\n \n aStrings.each do | sString |\n puts2(\"Expected NOT Blank: \" + sString.is_blank?.to_s)\n end\n \n \n end",
"title": ""
},
{
"docid": "a1226df234a6704eceb01875b0b82b8d",
"score": "0.6425956",
"text": "def blank?\n # The regexp that matches blank strings is expensive. For the case of empty\n # strings we can speed up this method (~3.5x) with an empty? call. The\n # penalty for the rest of strings is marginal.\n empty? || BLANK_RE.match?(self)\n end",
"title": ""
},
{
"docid": "e47ede34d7d0aa5970bc92050c55882d",
"score": "0.6424419",
"text": "def blank?(str)\n str.nil? || str.to_s.strip == ''\nend",
"title": ""
},
{
"docid": "b5bdbb22e62e53b64b6f9f6ae6eb484e",
"score": "0.64198935",
"text": "def is_empty(str)\n return str.empty?\nend",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.64172024",
"text": "def empty?() end",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.64172024",
"text": "def empty?() end",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.64172024",
"text": "def empty?() end",
"title": ""
},
{
"docid": "3e497e622ebedd5fdfb432f1ec1a7a80",
"score": "0.6367838",
"text": "def nil_or_empty_string?(obj)\n obj.nil? || obj.empty?\n end",
"title": ""
},
{
"docid": "691eac3b4569cdb79353d819659bd701",
"score": "0.63569874",
"text": "def test\n puts [].empty?\n puts \"\".empty?\n puts [].present?\n puts 1.present?\n puts nil.blank?\nend",
"title": ""
},
{
"docid": "34eedef8999a8778e773243c7e78d686",
"score": "0.63385916",
"text": "def empty!\n self.replace(\"\")\n end",
"title": ""
},
{
"docid": "743c74c09bd6d60a61874592fee859a4",
"score": "0.6327799",
"text": "def full?(board)\n board.none?{|x| x == \"\" || x == \" \" || x = nil}\nend",
"title": ""
},
{
"docid": "17f950543f9a0c473e216628660a1e52",
"score": "0.6327297",
"text": "def safe_empty(thing)\n thing.class.method_defined?(:empty?) && thing.empty?\n end",
"title": ""
},
{
"docid": "50c973401eb3d2c2955479f639ca719a",
"score": "0.63231474",
"text": "def full?(board)\n board.none? do |item|\n item == \" \" || item == \"\"\n end\nend",
"title": ""
},
{
"docid": "9edc0bf7ce984ef89983c6fb5574c45e",
"score": "0.6317589",
"text": "def is_empty?\n end",
"title": ""
},
{
"docid": "ecb1321f5cba16d00c84aca3950da15b",
"score": "0.6311715",
"text": "def empty?\n @text.empty?\n end",
"title": ""
},
{
"docid": "b4a6e5ee2b22b3591b9659c79cedcef5",
"score": "0.6307493",
"text": "def nil_blank(array)\n if ( array.include?(nil) ) #replace nil with empty string\n array.map! {|e| e ? e : \"\"}\n end\n return array\n end",
"title": ""
},
{
"docid": "0f23c849889f444b6ddddb7ee4e70860",
"score": "0.62707865",
"text": "def isempty(thing)\n thing.respond_to?(:empty?) && thing.empty?\n end",
"title": ""
},
{
"docid": "c2cf7a4a32215ecca143e829d466e9c4",
"score": "0.6269548",
"text": "def _blank?(value)\n value.nil? || value == ''\n end",
"title": ""
},
{
"docid": "8d104c2ab51d517a7924bf30910a65f7",
"score": "0.6267434",
"text": "def full?\n cells.none? {|cell| cell == \" \" || cell == nil}\nend",
"title": ""
},
{
"docid": "9e67f3199a6beeb2614e1df048ab492a",
"score": "0.6260559",
"text": "def join_strings_reject_empty(display_array, separator = \" ,\")\n display_array = display_array.reject { |display| display.empty? }\n return display_array.join(separator).html_safe\n\n end",
"title": ""
},
{
"docid": "a27ed61e1c900e745fc7ca1c0809891f",
"score": "0.6241533",
"text": "def full?(board)\n board.none? {|el| el == \"\" || el == \" \"}\nend",
"title": ""
},
{
"docid": "091c9895bda786b4daf5a843da053b05",
"score": "0.62269115",
"text": "def blank?\r\n empty? || BLANK_STRING_REGEXP.match(self)\r\n end",
"title": ""
},
{
"docid": "ce6853962b79b6be0dd78fd3e5959485",
"score": "0.62243724",
"text": "def blank?\n length == 0\n end",
"title": ""
},
{
"docid": "85053c81763767939540926e3b92b2b3",
"score": "0.62223196",
"text": "def empty(input)\n string = input.to_s\n if string.length != 0\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "2899af99307486d8f1d4d04b88c8fd94",
"score": "0.62215966",
"text": "def any?\n not blank?\n end",
"title": ""
},
{
"docid": "669921c9a3d12bc5b67083f0c4e49fb7",
"score": "0.62169814",
"text": "def is_empty(string)\n return true if string == \"\"\n return false\nend",
"title": ""
},
{
"docid": "a56aa0357661e9c91b5efa29b81043d1",
"score": "0.6204427",
"text": "def empty?(input)\n input == \"\" ? true : false\n end",
"title": ""
},
{
"docid": "5f22781b1d88671ffcd6baf86fc95987",
"score": "0.6201768",
"text": "def empty?\n `return self.length == 0 ? Qtrue : Qfalse;`\n end",
"title": ""
},
{
"docid": "5f22781b1d88671ffcd6baf86fc95987",
"score": "0.6201768",
"text": "def empty?\n `return self.length == 0 ? Qtrue : Qfalse;`\n end",
"title": ""
},
{
"docid": "cf1d11c690b713a3d09fe6d9d0cd501c",
"score": "0.61896485",
"text": "def blank?(str)\n str.nil? or (str.is_a? String and str.strip.empty?)\n end",
"title": ""
},
{
"docid": "e027cf1bd0ba261f0c7e303a1077f880",
"score": "0.6186821",
"text": "def isEmpty(value) \n return value.nil? || value.strip == \"\"\nend",
"title": ""
},
{
"docid": "e6e30ba581250239c76e8a26e79d9308",
"score": "0.61843246",
"text": "def empty?\n messages.all? { |k, v| v && v == \"\" && !v.is_a?(String) }\n end",
"title": ""
},
{
"docid": "1b72e20b599c97027c9acb00119b49f0",
"score": "0.6181295",
"text": "def is_empty(string)\n return true if string.length == 0\n return false\nend",
"title": ""
},
{
"docid": "90fd06ac35211d021aee97b29f1dc9a5",
"score": "0.6175818",
"text": "def empty_str?(value)\n EMPTY_STRING.eql?(value)\n end",
"title": ""
},
{
"docid": "34c8fb80d05d09556c4bd738c0accb58",
"score": "0.6174184",
"text": "def test_empty_on_strings\n assert_empty(@empty_string)\n assert_not_empty(@one_char_string)\n assert_not_empty(@long_string)\n end",
"title": ""
},
{
"docid": "90b4365912138603cb5722bb2e2f6b73",
"score": "0.61691904",
"text": "def empty()\n @s1.length == 0\n end",
"title": ""
},
{
"docid": "04b1e18d86c8a0f3e6d55d804c47ceb1",
"score": "0.61673594",
"text": "def full?(board)\n board.none? {|i| i == \"\" || i == \" \"}\nend",
"title": ""
},
{
"docid": "91f49bf3b985f92263e54271ad8ff0f1",
"score": "0.61526996",
"text": "def one_of(*args)\n args.each {|x|\n return to_joined_str(x) if x\n }\n\n \"\"\nend",
"title": ""
},
{
"docid": "251aa855f974931e3f81de821623eed8",
"score": "0.6133668",
"text": "def empty(string)\n if string == \"\" \n return true\n else \n return false\n end\nend",
"title": ""
},
{
"docid": "e43bbf6e8cb7139d7bbcdaa47e68886f",
"score": "0.61261487",
"text": "def blank?(value)\n value.nil? || value.to_s.empty?\n end",
"title": ""
},
{
"docid": "f6a53fb98c3a5250d244c72c21d618b1",
"score": "0.6122988",
"text": "def blank?\n empty?\n end",
"title": ""
},
{
"docid": "7b00424275835132fe13d1fbc1f59feb",
"score": "0.6108426",
"text": "def empty_nil_blank?(str, raize=false)\n result = (str !~ /[^[:space:]]/ || str.nil? || str.empty?)\n raise ShellTastic::CommandException.new(\"Command is emtpy or nil\") if result and raize\n result\n end",
"title": ""
},
{
"docid": "007c729f72ed304629fe10bb3e86274c",
"score": "0.61070514",
"text": "def is_empty(str)\n if str[0] == nil\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "3d5eacff123805506f08419173d34927",
"score": "0.6106156",
"text": "def nil_if_whitespace\n\n\t\tNilIfWhitespace_Helper_.string_nil_if_whitespace_array_ self\n\tend",
"title": ""
},
{
"docid": "c2c9160264153ee3e90b7251172eba7d",
"score": "0.61035275",
"text": "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end",
"title": ""
},
{
"docid": "c2c9160264153ee3e90b7251172eba7d",
"score": "0.61035275",
"text": "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end",
"title": ""
},
{
"docid": "c2c9160264153ee3e90b7251172eba7d",
"score": "0.6103273",
"text": "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end",
"title": ""
},
{
"docid": "007f9805bdde7338eb87eecd2bb34439",
"score": "0.6100805",
"text": "def empty?\n return self.length == 0\n end",
"title": ""
},
{
"docid": "3b3903f7f52163887be2de857fbb1bd5",
"score": "0.6098053",
"text": "def blank?\n respond_to?(:empty?) ? !!empty? : !self\n end",
"title": ""
},
{
"docid": "ebb023cadc70206ca4676dd617bd822a",
"score": "0.6096592",
"text": "def empty?\n self.length == 0\n end",
"title": ""
},
{
"docid": "d5379c5489116cd764dfecd1f6e5a8b3",
"score": "0.6083807",
"text": "def none?\n @value.to_s.empty? or /\\Anone\\z/io.match(@value.to_s)\n end",
"title": ""
},
{
"docid": "081190af04509102e7e9da42bcfd96e5",
"score": "0.60822517",
"text": "def empty?\n `self.length === 0`\n end",
"title": ""
},
{
"docid": "e1c77436fb9cd5dfad2c00912d38a494",
"score": "0.60789984",
"text": "def full?\n #return true if every element in the board contains something\n if @board.detect {|i| i == \" \" || i == nil}\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "9574e623693bdcd2cd4668ac261cf1b1",
"score": "0.6075033",
"text": "def full?(board)\r\n #return true if every element in the board contains something\r\n board.each do |element|\r\n if (element == \" \") \r\n return false\r\n end\r\n end\r\n return true\r\nend",
"title": ""
},
{
"docid": "062db8b27ef654b86f0cdc171f342c7a",
"score": "0.607229",
"text": "def string_and_space(str)\n str.blank? ? '' : (str + ' ')\n end",
"title": ""
},
{
"docid": "c22386911d75de14d24d3221ab0e3000",
"score": "0.60533994",
"text": "def blank?(object) \n\tif object.instance_of?(Array) || object.instance_of?(Hash)\n\t\treturn object.nil? || object.length == 0\n\telse\n\t\treturn object.nil? || object.strip == ''\n\tend\nend",
"title": ""
},
{
"docid": "01b4b57e248c9f30c6d4af2b0e04bc0d",
"score": "0.6052801",
"text": "def skip_blanks?() @skip_blanks end",
"title": ""
},
{
"docid": "57cdeafbae2e3323c479f8429b0a7949",
"score": "0.6052489",
"text": "def is_empty()\n \n end",
"title": ""
},
{
"docid": "05a1422328485a00ad159276b147fcd4",
"score": "0.60517424",
"text": "def blank?\n to_s.blank?\n end",
"title": ""
},
{
"docid": "906e4e376da164b32a70bf8dbd79e3be",
"score": "0.6047361",
"text": "def blank?(object)\n object.to_s.sub(/\\s+/, '') == ''\n end",
"title": ""
},
{
"docid": "ecb11b9c5042afe403b5380b59791ce3",
"score": "0.60465837",
"text": "def blank?\n self !~ /[^[:space:]]/\n end",
"title": ""
},
{
"docid": "137d8669b111261d736fb8951a54af21",
"score": "0.60414755",
"text": "def blank?\r\n nil? || (respond_to?(:empty?) && empty?)\r\n end",
"title": ""
},
{
"docid": "6f08dbb76c5d40de168b98bfb87eecfe",
"score": "0.6039933",
"text": "def full?(board)\n board.each do|i| if (i == nil || \" \" == i)\n return false\n end\n end\nend",
"title": ""
},
{
"docid": "5d4c878723231ffdfb112689c93c96a6",
"score": "0.6035152",
"text": "def empty?\n none? { true }\n end",
"title": ""
},
{
"docid": "109b076d7aaa1276c4ea6ab2db70abd7",
"score": "0.60242885",
"text": "def is_empty(str)\n i = 0\n output = true\n\n while i <= str.length\n if str[i] != nil\n output = false\n end\n i += 1\n end\n return output\nend",
"title": ""
},
{
"docid": "4d8b1fb79b1ba630e63ad9594d0dedb1",
"score": "0.60226506",
"text": "def empty?\n empty\n end",
"title": ""
},
{
"docid": "adb83d1875dcdc851bdbfeeac9a2c0bf",
"score": "0.6015398",
"text": "def weed_nils\n subject.reject! { |s| s == \"\" } if subject.present?\n end",
"title": ""
},
{
"docid": "911e064ada8666d37ae62844169b2210",
"score": "0.6015356",
"text": "def sb(s)\r\n (s == '(none)' || s == '') ? '' : s\r\n end",
"title": ""
}
] |
33853b417091bf2a0d8d8da634ce89e9
|
PUT /question_groups/1 PUT /question_groups/1.json
|
[
{
"docid": "69006f8ec1d14009ae1e8044a4b9f84a",
"score": "0.6778192",
"text": "def update\n @question_group = QuestionGroup.find(params[:id])\n \n # original list of questions, select question_id column where question_group_id = params[:id]\n # convert the results into an array ,convert the array into an array of question_ids in string format\n # rather than question group models\n orig_question_group_questions = QuestionGroupQuestion.where(\"question_group_id\" => params[:id]).select(\"question_id\").collect { |q| q.question_id.to_s}\n\n respond_to do |format|\n if @question_group.update_attributes(params[:question_group])\n \n # get all the question_group_questions for this question group. if none were submitted, then initialize an empty array\n new_question_group_questions = params[:question_group_questions].nil? ? Array.new : params[:question_group_questions][:question_ids]\n\n puts(\"______________________________ \" + new_question_group_questions.to_s)\n puts(\"______________________________ \" + orig_question_group_questions.to_s)\n \n # test if the original set of questions is not the same as the updated set\n if orig_question_group_questions != new_question_group_questions\n @question_group_questions_add = new_question_group_questions - orig_question_group_questions\n \n # for each newly added question, add to database\n @question_group_questions_add.each { \n |add| \n new_question_group_question = QuestionGroupQuestion.new(\n {\n :question_id => add,\n :question_group_id => params[:id] \n }\n ).save\n }\n \n @question_group_questions_remove = orig_question_group_questions - new_question_group_questions\n \n # remove each question_group_question from the computed remove list\n @question_group_questions_remove.each { \n |question| QuestionGroupQuestion.where(\n :question_group_id => params[:id],\n :question_id => question\n ).destroy_all\n }\n \n end\n \n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "f8fc63d3ad4cb437d3e5418a387b581f",
"score": "0.72734946",
"text": "def update\n @question_group = QuestionGroup.find(params[:id])\n\n respond_to do |format|\n if @question_group.update_attributes(params[:question_group])\n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31d9c2775b5261a06d9bae0ddb9f7afe",
"score": "0.7175352",
"text": "def update\n @group = @dataset.groups.find(params[:id])\n @group.assign_attributes(params[:group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:dataset].present? && params[:dataset][:questions_attributes].present?\n selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @dataset.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @dataset.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n respond_to do |format|\n if @dataset.save\n format.html { redirect_to dataset_groups_path(@owner), flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n else\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0137f0b82febebce3e8a5965285625b9",
"score": "0.7140958",
"text": "def update\n respond_to do |format|\n if @question_group.update(question_group_params)\n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_group }\n else\n format.html { render :edit }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55807d3b4737ea40cf728238afc48978",
"score": "0.71304363",
"text": "def update\n if @group_question.update(group_question_params)\n render status: :ok, json: @group_question\n else\n self.send(:edit)\n end\n end",
"title": ""
},
{
"docid": "45f6b4945603bb5f1b5841a20ce857f6",
"score": "0.709387",
"text": "def update\n respond_to do |format|\n if @question_group.update(question_group_params)\n format.html { redirect_to question_groups_url, notice: 'Question group was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_group }\n else\n format.html { render :edit }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0db77079a3699a14ddabfbd20ecfa6d",
"score": "0.70281535",
"text": "def update\n @group = @time_series.groups.find(params[:id])\n @group.assign_attributes(params[:time_series_group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:time_series].present? && params[:time_series][:time_series_questions_attributes].present?\n selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @time_series.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @time_series.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n respond_to do |format|\n if @time_series.save\n format.html { redirect_to time_series_time_series_groups_path(@owner), flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n else\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "849c20569190ce78e8fd01d8c0b6a265",
"score": "0.7007288",
"text": "def update\n @question = Question.find(params[:id])\n assign_groups(@question, params)\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n update_translations(params, @question, 'Question')\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(admin_question_path(@question)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "216a5d9182e4474e40378ea3b1dd0777",
"score": "0.69310164",
"text": "def update\n respond_to do |format|\n if @questiongroup.update(questiongroup_params)\n format.html { redirect_to @questiongroup, notice: 'Questiongroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @questiongroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51dcbfc41bc86a0e57cc716a020f2821",
"score": "0.6896446",
"text": "def set_question_group\n @question_group = QuestionGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "51dcbfc41bc86a0e57cc716a020f2821",
"score": "0.6896446",
"text": "def set_question_group\n @question_group = QuestionGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ecc7b15613dbd2f47795c5b227d9913",
"score": "0.682384",
"text": "def set_questiongroup\n @questiongroup = Questiongroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.66976964",
"text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name => group_params[:group_name], :group_permissions => group_params[:group_permissions]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "d32dbe8d7407b2bb984fd0961ac218bb",
"score": "0.66743445",
"text": "def update\n # note: parent_id is not changeable via this UI\n update_group_params = params.permit(:id, :name)\n @qset.update(update_group_params)\n redirect_to qset_path(@qset.id), notice: \"Qset '#{@qset.name}' saved.\"\n end",
"title": ""
},
{
"docid": "9a8a6bcc9e3fab460788536b02742249",
"score": "0.66616",
"text": "def update\n respond_to do |format|\n if @answer_group.update(answer_group_params)\n format.html { redirect_to @answer_group, notice: 'Answer group was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer_group }\n else\n format.html { render :edit }\n format.json { render json: @answer_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63712a9545e88b44469f5fc32fdbd376",
"score": "0.66233164",
"text": "def set_group_question\n @group_question = GroupQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "a5d3e4f36dd0cff1b023b4f1db8389b8",
"score": "0.6610517",
"text": "def set_questiongroupquestion\n @questiongroupquestion = Questiongroupquestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "33ce972d8d6ab278f84cd39e72a0417b",
"score": "0.65763193",
"text": "def set_question\n @question = GroupQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "4e070c1826b140df439e453b29df4333",
"score": "0.65761274",
"text": "def update\n respond_to do |format|\n if @questiongroupquestion.update(questiongroupquestion_params)\n format.html { redirect_to @questiongroupquestion, notice: 'Questiongroupquestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @questiongroupquestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec36e491aa5e69bc0da0412d4ac49ae8",
"score": "0.65554684",
"text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "0cc48c7f6fc562e54c2dba6a780ef960",
"score": "0.655392",
"text": "def update\n @group = Api::V1::Group.find(params[:id])\n\n if @group.update(group_params)\n head :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1602273770fdae786f68f3055bb67851",
"score": "0.6535631",
"text": "def update_question_group\n @editForm=params[:qstGroupEditForm]\n isGroupUpdate = false \n @oldQuestion = QuestionService.get_question_by_id(@editForm[:id])\n @typesOfNewGroup = QuestionService.get_question_type(@editForm[:qstGroup])\n @typesOfOldGroup = QuestionService.get_question_type(@oldQuestion.question_group)\n if @typesOfNewGroup.length > 0 && @editForm[:qstGroup] != @oldQuestion.question_group\n render json: {result: isGroupUpdate, message: Messages::GROUP_EXIST_ERROR_MESSAGE}\n elsif @typesOfOldGroup.any?{|type| type.question_type == @editForm[:qstType] } && @editForm[:qstType] != @oldQuestion.question_type\n render json: {result: isGroupUpdate, message: Messages::TYPE_EXIST_ERROR_MESSAGE}\n else\n isGroupUpdate = QuestionService.update_question_group(@editForm, @oldQuestion)\n render json: {result: isGroupUpdate, message: isGroupUpdate ? Messages::SUCCESSFUL_UPDATE_MESSAGE : Messages::UPDATE_ERROR_MESSAGE}\n end\n end",
"title": ""
},
{
"docid": "dcea0058fd3b37c8b06d814c2e754f05",
"score": "0.6521241",
"text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "ba7a2388a626ae10a85c348c13e5f3bb",
"score": "0.65144783",
"text": "def update #update users group\n @user_group = UserGroup.find(params[:id])\n @user_group.update(user_group_params)\n @user_group.save\n render json: @user_group\n end",
"title": ""
},
{
"docid": "4b5dae04a0354145cd0cdc32c8332323",
"score": "0.6501968",
"text": "def update_question_group(course_id,quiz_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :quiz_groups__name__,\n :quiz_groups__pick_count__,\n :quiz_groups__question_points__,\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"quiz_id is required\" if quiz_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :quiz_id => quiz_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes/{quiz_id}/groups/{id}\",\n :course_id => course_id,\n :quiz_id => quiz_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 end",
"title": ""
},
{
"docid": "fabbd12324ff052fe4532e2d4825aba1",
"score": "0.6455653",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n @group.users.clear\n User.all.each do |user|\n if params[:\"u#{user.id}\"]\n @group.users << user\n end\n end\n @group.problemsets.clear\n Problemset.all.each do |problemset|\n if params[:\"p#{problemset.id}\"]\n @group.problemsets << problemset\n end\n end\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad472d84355f831d96e0b2361c02fccb",
"score": "0.6449144",
"text": "def create\n @group = @dataset.groups.new(params[:group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:dataset].present? && params[:dataset][:questions_attributes].present?\n selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @dataset.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @dataset.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n\n respond_to do |format|\n if @dataset.save\n format.html { redirect_to dataset_groups_path(@owner), flash: {success: t('app.msgs.success_created', :obj => t('mongoid.models.group.one'))} }\n format.json { render json: @group, status: :created, location: @group }\n else\n logger.debug \"!!!!!!!!!!! error = #{@dataset.errors.messages.inspect}\"\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5fbb5956a5a1000001c175dd2012083",
"score": "0.64238876",
"text": "def update\n respond_to do |format|\n if @faq_group.update(faq_group_params)\n format.html { redirect_to faq_groups_url, notice: 'Faq group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @faq_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb7119ddb9e5fcf02cdb9c4c64ab0288",
"score": "0.6422125",
"text": "def update_questions\n #Rails.logger.debug \">>>>> updating questions after destroying group\"\n\n group_items = self.arranged_items(reload_items: true, include_groups: true, include_subgroups: true, include_questions: true)\n sub_groups = group_items.select{|x| x.class == TimeSeriesGroup}\n questions = []\n questions << group_items.select{|x| x.class == TimeSeriesQuestion}\n\n # if have sub-groups, get questions from subgroups that need to be updated\n if sub_groups.present?\n sub_groups.each do |sub_group|\n questions << sub_group.arranged_items.select{|x| x.class == TimeSeriesQuestion}\n end\n end\n\n questions.flatten!\n\n #Rails.logger.debug \">>>>> - need to update #{questions.length} questions in this group and all of its subgroups\"\n\n if questions.length > 0\n self.time_series.questions.assign_group(questions.map{|x| x.id}, self.parent_id.present? ? self.parent_id : nil)\n self.time_series.save\n end\n\n # delete all of its sub-groups\n if sub_groups.present?\n #Rails.logger.debug \">>>>> - deleting all subgroups\"\n self.time_series.groups.in(id: sub_groups.map{|x| x.id}).delete_all\n end\n\n end",
"title": ""
},
{
"docid": "a57f824aac41f150d380a4c3f560657b",
"score": "0.64059186",
"text": "def update\n @group = scoped_groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(group_params)\n format.html { redirect_to @group, notice: 'Class was successfully updated.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "b644f99b7ba7a338d0310d6ed0a5907e",
"score": "0.6402503",
"text": "def update\n respond_to do |format|\n if @api_v1_group.update(api_v1_group_params)\n format.html { redirect_to @api_v1_group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebe08bf5796699ace37c14031ebd9b2c",
"score": "0.63993883",
"text": "def update\n question_params = params.require(:question).permit(:text, :id, :question_group_id)\n user_params = params.require(:user).permit(:id, :role)\n question = Question.find(params[:id])\n # authorization\n if user_params[:role] != 'admin' and question.user_id != user_params[:id]\n msg = \"user #{user_params[:id]} with role #{user_params[:role]} attempted to modify question #{question.id} \"\n msg << \"(with user_id #{question.user_id}) without permission\"\n logger.debug msg\n render status: 403, json: {} and return\n end\n logger.debug \"Updating question: #{question}\"\n if question.update(question_params)\n logger.debug \"Updated question: #{question}\"\n render status: 200, json: question.to_json(:include => :answers)\n else\n render status: 400, json: {}\n end\n end",
"title": ""
},
{
"docid": "07df2a29507ce59a2d6ec5980e393bdb",
"score": "0.6391358",
"text": "def update\n respond_to do |format|\n if @group.update(form_params)\n format.json { render json: { groups: @group }, status: :ok, location: @group }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "222cc98d7114d9f473e3cff083437417",
"score": "0.63671553",
"text": "def update\n if @group.update(group_params)\n render json: @group, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7a78e526827dc9ef675ace45724f519a",
"score": "0.6362489",
"text": "def update\r\n if @group.update(group_params)\r\n render json: @group, status: 200, location: @group\r\n else\r\n render json: @group.errors, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "63031428b3755958bdb36293531246cc",
"score": "0.6361407",
"text": "def update\n respond_to do |format|\n if @survey_group.update(survey_group_params)\n format.html { redirect_to @survey_group, notice: 'Survey group was successfully updated.' }\n format.json { render :show, status: :ok, location: @survey_group }\n else\n format.html { render :edit }\n format.json { render json: @survey_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aaaf47e48ce47523897ea8b9bb07e92",
"score": "0.6347124",
"text": "def update_group(group_id, name)\n params = { name: name }\n\n request :patch,\n \"/v3/team/groups/#{group_id}.json\",\n params\n end",
"title": ""
},
{
"docid": "f598b2a4454349d4e781e8c267aef67d",
"score": "0.63403857",
"text": "def create\n @question_group = QuestionGroup.new(question_group_params)\n respond_to do |format|\n if @question_group.save\n format.html { redirect_to question_groups_url, notice: \"Question group was successfully created. unique id is: #{@question_group.id}\" }\n format.json { render :show, status: :created, location: @question_group }\n else\n format.html { render :new }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0c5cb8ec03b096d4c80b3691aa30a41",
"score": "0.6322602",
"text": "def update_question_group(question, qstGroup)\n isGroupUpdate = question.update(\n 'question_group' => qstGroup\n )\n end",
"title": ""
},
{
"docid": "565c68ce8259fa32cde0c1c8244aed7d",
"score": "0.63177866",
"text": "def update\n respond_to do |format|\n if @exercises_group.update(exercises_group_params)\n format.html { redirect_to @exercises_group, notice: 'Exercises group was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercises_group }\n else\n format.html { render :edit }\n format.json { render json: @exercises_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c8c38aa01bc84775298b920090e74b2",
"score": "0.6312939",
"text": "def update\n if @group.update(group_params(params))\n render json: @group, status: 200\n else\n render :json => @group.errors, :status => 422\n end\n end",
"title": ""
},
{
"docid": "f02bb7f65e6f31a338ba69748a93d999",
"score": "0.62764925",
"text": "def update\n @group = @groupable.groups.find(params[:id])\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to [@groupable, :groups], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "965c72f7d45112a9c186ba448c376652",
"score": "0.6273937",
"text": "def update\n @group = Course.groups.new(group_params)\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3512b04148080a9a674f391f26232f13",
"score": "0.6265784",
"text": "def update\n\tsubj_ids=params[:subject_ids]\n\[email protected]\n\tsubj_ids.each do |subj_id|\n\t\ts=Subject.find(subj_id)\n\t\ts.groups << @group\n\tend\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab1f81568ff04aa0198579c1f9cf0f41",
"score": "0.6250302",
"text": "def update\n authorize! :modify, @group\n if @group.update(group_params)\n render json: @group.to_json\n else\n render_error_model(@group)\n end\n end",
"title": ""
},
{
"docid": "c981337df143a67d5fd7b6f932ab5102",
"score": "0.6246248",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n Season.flush_open_groups_cache\n\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fa86a80368917c19161ab74a0d714f7",
"score": "0.6232548",
"text": "def set_answer_group\n @answer_group = AnswerGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f34dff770c302945cc1f45eb63191eb",
"score": "0.6228841",
"text": "def update\n update_resource_response(@student_group_kind, student_group_kind_params)\n end",
"title": ""
},
{
"docid": "b256de05d1b5323a20ddec56a0cbfc09",
"score": "0.6219128",
"text": "def update\n unless @group.user_id == @current_user.id\n return render json: { message: 'You are not permitted to perform this operation.' }, status: :forbidden\n end\n if @group.update(group_params)\n render json: @group, status: :ok, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.6200576",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.6200576",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ac0efa0334b084bf1345cbf087abbe8",
"score": "0.6198491",
"text": "def create\n @group = @time_series.groups.new(params[:time_series_group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:time_series].present? && params[:time_series][:time_series_questions_attributes].present?\n selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @time_series.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @time_series.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n\n respond_to do |format|\n if @time_series.save\n format.html { redirect_to time_series_time_series_groups_path(@owner), flash: {success: t('app.msgs.success_created', :obj => t('mongoid.models.group.one'))} }\n format.json { render json: @group, status: :created, location: @group }\n else\n logger.debug \"!!!!!!!!!!! error = #{@time_series.errors.messages.inspect}\"\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8439be2d1ca580b7994df5a803e5b8be",
"score": "0.6192762",
"text": "def update\n if @group.update(group_params)\n render :show, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dc2537788a31c816ff842e22d891b15c",
"score": "0.6183016",
"text": "def update\n\t@student_group_questionnaire = StudentGroupQuestionnaire.find(params[:id])\n\n\trespond_to do |format|\n\t if @student_group_questionnaire.update_attributes(params[:student_group_questionnaire])\n\t\tformat.html { redirect_to(@student_group_questionnaire, :notice => 'Student group questionnaire was successfully updated.') }\n\t\tformat.xml { head :ok }\n\t else\n\t\tformat.html { render :action => \"edit\" }\n\t\tformat.xml { render :xml => @student_group_questionnaire.errors, :status => :unprocessable_entity }\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "ad7b0505c8b8d8f42e6cb7f6b9f5cc97",
"score": "0.618098",
"text": "def update\n @vendor_questionnaire_group = VendorQuestionnaireGroup.find(params[:id])\n\n respond_to do |format|\n if @vendor_questionnaire_group.update_attributes(params[:vendor_questionnaire_group])\n format.html { redirect_to @vendor_questionnaire_group, notice: 'Vendor questionnaire group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vendor_questionnaire_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4b8130e1725844ffbd7798d02ef3d59",
"score": "0.61807317",
"text": "def update\n @group = current_user.teached_groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n errors = @group.populate_group\n flash[:errors] = \"The following student ids are not valid: #{errors}\" unless errors.blank?\n format.html { redirect_to [:teacher, @group], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f961b86299b4f6d642a642c57baf24e6",
"score": "0.6178701",
"text": "def update\n @survey_group.update(survey_group_params)\n @survey_groups = SurveyGroup.all \n @survey_group = SurveyGroup.new \n\n # respond_to do |format|\n # if @survey_group.update(survey_group_params)\n # format.html { redirect_to @survey_group, notice: 'Survey group was successfully updated.' }\n # format.json { render :show, status: :ok, location: @survey_group }\n # else\n # format.html { render :edit }\n # format.json { render json: @survey_group.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "e6c5d47ae3dc49c9e6d98976d735cac8",
"score": "0.6176743",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.json { render :show, id: @group.id }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52f3f3e42f9c88790980e763c0017b31",
"score": "0.6170759",
"text": "def create\n @question_group = QuestionGroup.new(question_group_params)\n @question_group.user = current_user\n \n respond_to do |format|\n if @question_group.save\n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render :show, status: :created, location: @question_group }\n else\n format.html { render :new }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c55c7ad1acdfc0be8b9e7b42d1310d16",
"score": "0.61677885",
"text": "def create\n @question_group = QuestionGroup.new(params[:question_group])\n\n respond_to do |format|\n if @question_group.save\n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render json: @question_group, status: :created, location: @question_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.61620516",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "b65e28618ac1b41b7ab0d147095abe11",
"score": "0.61592025",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes_from_api(params[:group])\n format.json { render_for_api :group, :json => @group }\n else\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "953391b6360635142b5ea786d977676e",
"score": "0.6156499",
"text": "def update\n @group = Group.find_by_id(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fddcdd2f6752cdaf71f6680852e6dade",
"score": "0.615369",
"text": "def update\n if @group.update(group_params)\n render :show, status: :ok, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cd85e947490f8db18eed83a80b5a69a2",
"score": "0.61534166",
"text": "def update\n if @group.update(group_params)\n render_json_message({success: t('.success')}, 200)\n else\n render_json_message({errors: @group.errors.messages}, 422)\n end\n end",
"title": ""
},
{
"docid": "f76a1695ad12215fce15e9deb896a9f2",
"score": "0.6148096",
"text": "def create\n # Get all questions so user can add questions\n # CHANGE SO THAT THIS ONLY APPEARS IF VALIDATION FAILS\n @questions = Question.all \n \n @question_group = QuestionGroup.new(params[:question_group])\n @question_group.user = current_user\n puts(params.to_s)\n respond_to do |format|\n if @question_group.save\n \n # save all dynamically added questions from form\n # TO-DO: ADD ERROR HANDLING IF NO QUESTIONS WERE SUBMITTED THROUGH VALIDATION\n params[:question_group_questions][:question_ids].each {\n |q| @question_group_questions = QuestionGroupQuestion.new(\n {\n \"question_id\" => q, \n \"question_group_id\" => @question_group.id\n }\n )\n @question_group_questions.save\n }\n \n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render json: @question_group, status: :created, location: @question_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "248418d047278682e742f81ff15d1c3a",
"score": "0.6140614",
"text": "def update\n if @group_question_statetment.update(group_question_statetment_params)\n render status: :ok, json: @group_question_statetment\n else\n self.send(:edit)\n end\n end",
"title": ""
},
{
"docid": "aa48549b5ae0bd9b5a73c44ae5ae34ae",
"score": "0.6136345",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a82a9e2899f2b53d661d0161661c6f95",
"score": "0.6136285",
"text": "def update\n #@group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n @group.recompute_members_quotas\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9d48907498c6679fe07082bd51c1fa3",
"score": "0.6133574",
"text": "def update_group(name, new_name)\n self.class.put(\"#{@url}/rest/user-management/groups/#{URI.escape(name)}\", basic_auth: @auth, body: generate_group_payload(new_name), headers: {'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "baba3303cab28aad4dcfec9cb5e9bf07",
"score": "0.6124081",
"text": "def set_group\n if params[:group_id] || params[:quizzes_quiz].try(:[], :group_id)\n @group = Group.find(params[:group_id] || params[:quizzes_quiz][:group_id])\n end\n end",
"title": ""
},
{
"docid": "c0493adb0576149569cbbb47c83f66e1",
"score": "0.61106455",
"text": "def put_new_group(group_name)\n c = curl_put(\"#{self.host}/api2/groups/\",{\"group_name\" => group_name})\n JSON.parse(c.body_str)\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.6108107",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.6108107",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e32d695f0bc583dc3e0918d743d933b1",
"score": "0.61038566",
"text": "def update\n \n respond_to do |format|\n \n if @group.update(group_params)\n format.html { redirect_to @group, flash: { success:'Your group was successfully created ! Enjoy !' }}\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bab1266f78355d208692655efd22c45",
"score": "0.6102189",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea14253966c3473e499a4867122ab9a6",
"score": "0.61000484",
"text": "def update\n @todo_group = TodoGroup.find(params[:id])\n\n respond_to do |format|\n if @todo_group.update_attributes(params[:todo_group])\n format.html { redirect_to @todo_group, notice: 'Todo group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @todo_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.6092802",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd2d7482476b0bb985b81a7dac3e0c2d",
"score": "0.60915095",
"text": "def update\n @questionnaire = Questionnaire.find(params[:id])\n\n respond_to do |format|\n if @questionnaire.update_attributes(params[:questionnaire]) and @questionnaire.administrator.update_attributes(params[:group])\n format.html { redirect_to @questionnaire, :notice => 'Questionnaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @questionnaire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fcfad14421a7b4042cd8f9606ebc86a",
"score": "0.60888565",
"text": "def group_questions\n if params[:time_series_id].present?\n time_series = TimeSeries.by_id_for_owner(params[:time_series_id], @owner.id, current_user.id)\n\n if time_series.present?\n # if group id was provided, look for questions assigned to the group\n # else get questions that do not have groups assigned yet\n questions = params[:group_id].present? ? time_series.questions.assigned_to_group_meta_only(params[:group_id]) : time_series.questions.not_assigned_group_meta_only\n\n # get existing group\n group = time_series.groups.find(params[:id])\n assigned_questions = []\n if group.present?\n # if the group parent id equals the group id param, then get the existing questions for this group\n # else, the parent group is changing and the existing questions are no longer valid\n if (group.parent_id.nil? && params[:group_id].empty?) || (group.parent_id.to_s == params[:group_id])\n # get questions already assigned to the group\n assigned_questions = time_series.questions.assigned_to_group_meta_only(params[:id])\n end\n end\n\n # combine the two sets of questions with the selected questions first\n items = sort_objects_with_sort_order(assigned_questions).map{|x| x.json_for_groups(true)} + sort_objects_with_sort_order(questions).map{|x| x.json_for_groups}\n\n respond_to do |format|\n format.json { render json: items }\n end\n return\n end\n end\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e51e82bf9b20217361e1e8f56392b11c",
"score": "0.6082991",
"text": "def destroy\n @question_group = QuestionGroup.find(params[:id])\n @question_group.destroy\n\n respond_to do |format|\n format.html { redirect_to question_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e51e82bf9b20217361e1e8f56392b11c",
"score": "0.6082991",
"text": "def destroy\n @question_group = QuestionGroup.find(params[:id])\n @question_group.destroy\n\n respond_to do |format|\n format.html { redirect_to question_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6f12a6e749c6cb6310b35d1dc7cd178",
"score": "0.60818887",
"text": "def group_question_params\n params.require(:group_question).permit(:name, :media, :correct, :question_id)\n end",
"title": ""
},
{
"docid": "311397e45f05866b95f59820eaa975f8",
"score": "0.60779285",
"text": "def new\n @question_group = QuestionGroup.new\n @question_group_questions = @question_group.question_group_questions.new\n \n # Get all questions so user can add questions\n @questions = Question.all \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question_group }\n end\n end",
"title": ""
},
{
"docid": "95fd8e55f96fc9382bca59f285e175c4",
"score": "0.6077038",
"text": "def update\n @group = Group.find(params[:id])\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to action: \"about\", group_id: params[:id] , notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to :back }\n format.json { redirect_to :back, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d78f0ddf8ee76e091a24feb4e532b2",
"score": "0.60748243",
"text": "def update\n @practice_group = PracticeGroup.find(params[:id])\n \n respond_to do |format|\n if @practice_group.update_attributes(params[:practice_group])\n format.html { redirect_to @practice_group, notice: 'Practice group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @practice_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e5ad547435d2b3bbaae23f6a4e22e2f",
"score": "0.6074795",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: t('controllers.group.update') }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "013fc8a1d593ec6735f1ce211a828038",
"score": "0.6070704",
"text": "def update_mod\n if params[:groupName] != nil && params[:subId] != nil && params[:password] != nil\n @group.subId = params[:subId] == \"\" ? nil : params[:subId].to_i\n @group.groupName = params[:groupName]\n @group.password = params[:password] == \"\" ? nil : params[:password]\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to groups_path\n end\nend",
"title": ""
},
{
"docid": "1b53a2423e28388cb1c388356dada282",
"score": "0.6068989",
"text": "def questiongroupquestion_params\n params.require(:questiongroupquestion).permit(:questiongroup_id, :question_id, :position)\n end",
"title": ""
}
] |
91e8e1002acc0629cfa230f9f341f80c
|
Given file path within src, return any subdirectory path needed to reach file, or the empty string. This is also src trailing '/' aware.
|
[
{
"docid": "bf505a98007ac5c01d113a6c3073dcc1",
"score": "0.84722024",
"text": "def subpath( src, file ) # :doc:\n src = src.sub( %r{/[^/]*$}, '' ) #remove trail slash or last element\n File.dirname( file ).sub( /^#{src}\\/?/, '' )\n end",
"title": ""
}
] |
[
{
"docid": "ccad5e56e0319aad833da1b98ac69a75",
"score": "0.68963677",
"text": "def subpath(file)\n file.sub(/#{@directory}/, '').sub(/#{File::SEPARATOR}/, '')\n end",
"title": ""
},
{
"docid": "a40a56a224f107836a18fc9d1b98298e",
"score": "0.6720418",
"text": "def construct_path_upwards(sub_file, path)\n sub_file ? \"../#{path}\" : path\n end",
"title": ""
},
{
"docid": "d6fe368b4001d7f3c25794d9640a79d3",
"score": "0.6680448",
"text": "def get_directory_above_src()\n Dir.pwd.split('/')[-2]\nend",
"title": ""
},
{
"docid": "0e84789651d578483f01eb96cf2a6529",
"score": "0.6624691",
"text": "def get_filepath(file, root = '.')\n children = Dir.children(root)\n return root if children.include?(file)\n children_dirs = Pathname(root).children.select(&:directory?).map(&:basename)\n \n children_dirs.each do |child_dir|\n result = get_filepath(file, File.join(root, child_dir))\n return result if result\n end\n\n nil\nend",
"title": ""
},
{
"docid": "cb95d9fea57dc0af28740390f0bf1f3c",
"score": "0.6613596",
"text": "def filename_with_subpath\n [file_subpath, filename].reject(&:blank?).join('/')\n end",
"title": ""
},
{
"docid": "b0a32fdc278b45bad39456121788ddbf",
"score": "0.65986335",
"text": "def relative_source_path(path, src_base = source_root)\n File.expand_path(path).gsub(File.expand_path(src_base) + '/', '')\n end",
"title": ""
},
{
"docid": "4a62264855cb900a659df1f203302bed",
"score": "0.65811473",
"text": "def full_path\n p = self_and_ancestors.collect{|sm| sm.path_segment }.join(FILE_SEPARATOR)\n p = FILE_SEPARATOR + p unless p =~ /^\\// \n p\n end",
"title": ""
},
{
"docid": "7d1bdd416f039ec1d1a9ff51d3ba9560",
"score": "0.6548594",
"text": "def relative_to_base(path)\n path.sub(%r(^#{@directory}/?/), '')\n end",
"title": ""
},
{
"docid": "3e7bf23010abc064237dbc53ce204a86",
"score": "0.6530453",
"text": "def trim_to_dir_path(path)\n return path.slice(%r{/([^/]+/)+}) || '/'\nend",
"title": ""
},
{
"docid": "f39047adf8cebf9e0432dbb8a1580e7f",
"score": "0.65275925",
"text": "def normalize_subdirectory_path(path)\n path = normalize_file_path(path)\n path += '/' unless path.empty?\n return path\n end",
"title": ""
},
{
"docid": "bd895d23adad11d4c836ef04e6d08c57",
"score": "0.65054625",
"text": "def construct_path_downwards(sub_file, file)\n sub_file ? \"#{path}/\" : file\n end",
"title": ""
},
{
"docid": "40fd16f50b586939e28cc61bd5e06cf9",
"score": "0.6478749",
"text": "def path_to(dir, file)\n Find.find(dir) { |p| return p if ::File.basename(p) =~ /^#{file}$/ }\n rescue Errno::ENOENT\n nil\n end",
"title": ""
},
{
"docid": "b213faf50b05f3ffc404d0357769fe06",
"score": "0.6432669",
"text": "def relative_path path\n require 'pathname'\n\n full_path = Pathname.new(path).realpath # /full/path/to/project/where/is/file.extension\n base_path = Pathname.new(source_directory).realpath # /full/path/to/project/\n\n full_path.relative_path_from(base_path).to_s # where/is/file.extension\n end",
"title": ""
},
{
"docid": "d61d6e9dc67a84bc98c3342e2ade3413",
"score": "0.6429703",
"text": "def get_path(file)\n path = \"#{cwd}/#{options[:output]}\"\n if File.extname(options[:output]).empty?\n filename = file.gsub \"#{cwd}/\", ''\n source = filename.split('/').first\n filename.gsub! \"#{source}/\", ''\n path = \"#{path}/#{filename}\"\n end\n path\n end",
"title": ""
},
{
"docid": "2f3bb47c5f352d79e60be6593b6f3b74",
"score": "0.6386312",
"text": "def relative_path_of path\n if @root === nil\n @root = File.expand_path('.')\n end\n if path.start_with?('./')\n path[2..-1] \n else\n path.sub(/^#{@root}\\//, '')\n end\n end",
"title": ""
},
{
"docid": "ee9b11a98e0c541d760b0804b24bb071",
"score": "0.63614225",
"text": "def blindly_relativize_path(maybe_abspath)\n (maybe_abspath.split('').drop_while {|ch| ch=='/'}).join\n end",
"title": ""
},
{
"docid": "050015fa1697f0d36417df057a3569f4",
"score": "0.6352165",
"text": "def dir_path\n Index.virtual_parent_dir_for(filename,false) || path.sub(/\\/[^\\/]+\\Z/m,'')\n end",
"title": ""
},
{
"docid": "bf8a962729a8cdc0c67cb5448c87f1ca",
"score": "0.63387424",
"text": "def get_file_path(path = '')\n unless path.strip.empty?\n path.strip!\n path = '/' + path unless path.match(%r|^/|)\n end\n\n return path\n end",
"title": ""
},
{
"docid": "4774571fe1b884599248c0aa22fe9b32",
"score": "0.63363814",
"text": "def file_directory\n subpath(\"files\")\n end",
"title": ""
},
{
"docid": "4774571fe1b884599248c0aa22fe9b32",
"score": "0.63360137",
"text": "def file_directory\n subpath(\"files\")\n end",
"title": ""
},
{
"docid": "ddd02ee9fff44cc1a254de146cbc8010",
"score": "0.629722",
"text": "def get_full_path(path)\n if path == '.'\n path = Dir.pwd\n elsif !File::exists? path\n Dir.pwd + File::SEPARATOR + path\n end\n\n return path\nend",
"title": ""
},
{
"docid": "f627e0b017d5cac43d6e1a0209b6b5f9",
"score": "0.6296268",
"text": "def relative\n pwd = Dir.pwd\n pth = path\n if pth.index(pwd) == 0\n r = pth[pwd.size+1..-1]\n r = '.' unless r\n return r\n else\n pwd = File.dirname(pwd)\n if pth.index(pwd) == 0\n r = pth[pwd.size+1..-1]\n return '..' unless r\n return File.join('..', r)\n else\n pth\n end\n end\n end",
"title": ""
},
{
"docid": "781c326c43ae2091d4ed915b5f346de0",
"score": "0.6292307",
"text": "def find_file(path)\n path = File.join(@basedir, path)\n\n # Return if the file exists\n return path if File.exists?(path) && !File.directory?(path)\n\n # else add default\n path = \"#{path}#{@default}\" if path.to_s[-1] == File::SEPARATOR\n\n # Check for all possible extensions and recurse if found\n @extensions.each do |e|\n return \"#{path}#{e}\" if File.exists?(\"#{path}#{e}\") && !File.directory?(\"#{path}#{e}\")\n end\n\n # and, unless found, return default\n path = \"#{path}#{@extensions[0]}\" unless @extensions.include?(File.extname(path))\n\n # return path\n return path\n end",
"title": ""
},
{
"docid": "7abeb45db368728376b61893be51b82e",
"score": "0.6290995",
"text": "def source_path\n pr = proj_root\n SourceTools.common_src_dirs.each do |d|\n return \"#{pr}/#{d}\" if File.directory?(\"#{pr}/#{d}\")\n end\n nil\n end",
"title": ""
},
{
"docid": "21b6a2759266af3bf539df4fc8adc790",
"score": "0.62835413",
"text": "def findPathOfSuperdirectory(file_path, directory_name)\n\tfile_dir = File.dirname(file_path)\n\tif file_dir == file_path # reached base\n\t\treturn ''\n\telsif File.basename(file_dir) == directory_name # found it\n\t\treturn file_dir\n\telse # go up one\n\t\treturn findPathOfSuperdirectory(file_dir, directory_name)\n\tend\nend",
"title": ""
},
{
"docid": "d125556d3bcd5300b005730339e06704",
"score": "0.6247913",
"text": "def get_full_path( sub_path )\n File.join( Rails.root, sub_path )\nend",
"title": ""
},
{
"docid": "73f0fc784058d8915b541141b0750d68",
"score": "0.6244829",
"text": "def source_directory(dir = Pathname.new('.'))\n config_ru = dir + 'config.ru'\n\n if dir.children.include?(config_ru)\n dir.expand_path\n else\n return pwd_with_warning if dir.expand_path.root?\n source_directory(dir.parent)\n end\n end",
"title": ""
},
{
"docid": "153e9500f2048c60a622353c7217a03d",
"score": "0.62432724",
"text": "def relative_path(filename, base_directory)\n if (is_root? filename) && (is_root? base_directory)\n offset = base_directory.chomp(@file_separator).length + 1\n filename[offset..-1]\n else\n filename\n end\n end",
"title": ""
},
{
"docid": "b4d5f09b79ecd79d23a742411f168167",
"score": "0.6219082",
"text": "def full_path(file_name, subpath = nil)\n if subpath\n # legacy ec2 support omits file extension and creates a parent dir\n # using file name prefix; this is the default behavior.\n subpath = subpath.join('-') if subpath.kind_of?(Array)\n subpath = subpath.gsub(/[\\/\\\\]+/, '-').gsub(/^-+|-+$/, '')\n return File.normalize_path(File.join(@output_dir_path, file_name, subpath)) unless subpath.empty?\n end\n\n return File.normalize_path(File.join(@output_dir_path, \"#{file_name}#{@file_extension}\"))\n end",
"title": ""
},
{
"docid": "61c263fc85aedda8cc844a9a769bc02e",
"score": "0.6208153",
"text": "def reldir_from_src_root(in_path)\n p = self.class.closest_dir in_path\n p.relative_path_from(@src_root_abs)\n end",
"title": ""
},
{
"docid": "48778220e925824f7771e0b61efb95fd",
"score": "0.619855",
"text": "def relative base_path = Request.current.base_path\n case self\n when base_path\n # RFC2396, Section 4.2\n return ''\n when %r{(?:\\A|/)\\.\\.?(?:/|\\z)}\n # self has abnormal absolute path,\n # like \"/./\", \"/../\", \"/x/../\", ...\n return self.dup\n end\n\n src_path = base_path.scan(%r{(?:\\A|[^/]+)/})\n dst_path = self.scan(%r{(?:\\A|[^/]+)/?})\n\n # discard same parts\n while !dst_path.empty? && dst_path.first == src_path.first\n src_path.shift\n dst_path.shift\n end\n\n tmp = dst_path.join\n\n # calculate\n if src_path.empty?\n if tmp.empty?\n return './'\n elsif dst_path.first.include?(':') # (see RFC2396 Section 5)\n return './' + tmp\n else\n return tmp\n end\n end\n\n return '../' * src_path.size + tmp\n end",
"title": ""
},
{
"docid": "13055f7fb505a375e6397740c8528e57",
"score": "0.61849344",
"text": "def dir_path\n # binding.pry\n if extension.nil?\n node_warn(node: parent, msg: \"Extension '#{extension_name}' not found\")\n elsif extension.segment(extension_path).nil?\n node_warn(node: parent, msg: \"Extension '#{extension_name}' segment '#{extension_path}' not found\")\n else\n return extension.segment(extension_path)\n end\n parent.parent.rootpath.join(parent.node_name).to_s\n end",
"title": ""
},
{
"docid": "fc9be8fb2f85fb9036bf54a2c5781862",
"score": "0.6173691",
"text": "def relativize(path)\n \"./#{path.sub(%r{^\\./}, \"\")}\"\n end",
"title": ""
},
{
"docid": "802999c3b8d21a5fc10c1a11ff62e84e",
"score": "0.6165666",
"text": "def search_path(filename) #:nodoc:\n if File.file?(filename)\n return filename\n else\n $:.each do |pth|\n fpth = File.join(pth, filename)\n return fpth if File.file?(fpth)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "49e71056a00d8e0d3765c2837d4b8ea4",
"score": "0.61648077",
"text": "def relative_path\n File.join(*[@dir, @name].map(&:to_s).reject(&:empty?))\n end",
"title": ""
},
{
"docid": "853ddc6583033bdc3bad948ade3a3c97",
"score": "0.6164222",
"text": "def get_base(file)\n if file\n if Bee::Util::url?(file)\n return File.dirname(file)\n else\n return File.expand_path(File.dirname(file))\n end\n else\n return File.expand_path(Dir.pwd)\n end\n end",
"title": ""
},
{
"docid": "19e0b67e5128b12d1a9fc0e3cf1e76e0",
"score": "0.61613995",
"text": "def rel_src_path(src_node)\n src_node.pathname.relative_path_from(@src_topdir)\n end",
"title": ""
},
{
"docid": "c37c7000038236da4ecf0fd2c7f5cd8b",
"score": "0.6156674",
"text": "def relative_path(path, index_chop = INDEX_CHOP, extension_chop = EXTENSION_CHOP)\n needle = File.join(@staticmatic.src_dir, \"pages\")\n index = path.rindex(needle)\n# raise Exception.new(\"needle=>#{needle}, index=>#{index.to_i}, path => #{path}\")\n relative = index ? path.slice(index+needle.length..-1) : path\n if index_chop\n discard_slice = relative.slice!(INDEX_PATTERN)\n end\n if extension_chop\n relative.chomp!(File.extname(relative))\n end\n return relative\n end",
"title": ""
},
{
"docid": "40b87ef9fcee51d2851588c14ed1a9f9",
"score": "0.6117895",
"text": "def path_to( file )\n path = Pathname( file )\n .expand_path\n .relative_path_from( root )\n .to_path\n\n path.start_with?( '.' ) ? path : File.join( '.', path )\n end",
"title": ""
},
{
"docid": "68f0f9319ec1aed3f822e009b3053224",
"score": "0.61162597",
"text": "def relative_path\n @relative_path ||= path.gsub %r{^#{directory}},\n directory.split('/').last\n end",
"title": ""
},
{
"docid": "c1c3155d307b8d1f076b6ea6ae1410bb",
"score": "0.6114769",
"text": "def find_first_path(start, filename)\n Dir.foreach(start) do |x|\n path = File.join(start, x)\n if x == '.' or x == '..'\n next\n elsif File.directory?(path)\n found_path = find_first_path(path, filename)\n if found_path\n return found_path\n end\n else\n if x == filename && path.include?('drawable-')\n return File.join(start, x)\n end\n end\n end\n return nil\nend",
"title": ""
},
{
"docid": "84bd9db565a1d7e704bee13f1a37f23a",
"score": "0.610463",
"text": "def get_output_dir( path )\n ret = \".\"\n \n if ARGV[0]\n path_end_idx = ARGV[0].rindex('/')\n ret = ARGV[0].slice( 0, path_end_idx )\n end\n \n return ret\nend",
"title": ""
},
{
"docid": "4f7ec5fdf027e7895461fe96c0182260",
"score": "0.6103691",
"text": "def local_source_path\n # normalize path\n Pathname.new(\"#{clone_root_path}/#{src_subpath}\").cleanpath\n end",
"title": ""
},
{
"docid": "afa113818112d787f4c58a874d3b118c",
"score": "0.6102456",
"text": "def relative_path\n self.file.path.sub(\"#{root}/\", '')\n end",
"title": ""
},
{
"docid": "a1f682cbd11fa3be81dddd384388371f",
"score": "0.6099146",
"text": "def relative_path(path, directory = @directory)\n base_dir = directory.sub(/\\/$/, '')\n path.sub(%r(^#{base_dir}/), '')\n end",
"title": ""
},
{
"docid": "c5ab75b9d3af56b1c7206ae7cf863bc5",
"score": "0.60990644",
"text": "def relative_path_of file, dir\n file.relative_path_from(dir)\n end",
"title": ""
},
{
"docid": "199bc48c1d055e35ecad41929af542cb",
"score": "0.6098735",
"text": "def full_path(path)\n if path[0] == '/'\n path\n else\n File.join(options.dir, path)\n end\n end",
"title": ""
},
{
"docid": "31433ce4f64ee876d87e937350f56bad",
"score": "0.60870975",
"text": "def relative_path\n self.source_file ? self.source_file.sub(app.source_dir, '') : nil\n end",
"title": ""
},
{
"docid": "021d62ae39799c4af5902197a92049a7",
"score": "0.6086374",
"text": "def eponymous_directory_path\n \"#{path.sub(ext, '/').sub(%r{/$}, '')}/\"\n end",
"title": ""
},
{
"docid": "f6bd75fc6b644c863b0411e243f1c1d6",
"score": "0.6083931",
"text": "def path\n if d = dir\n File.join(d, (filename || \"\") )\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "f6bd75fc6b644c863b0411e243f1c1d6",
"score": "0.6083931",
"text": "def path\n if d = dir\n File.join(d, (filename || \"\") )\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "ecee9d98bad9e1bf89125962b9228b91",
"score": "0.60820985",
"text": "def path_for(file_name)\n\t\t\t\tfull_path = File.expand_path(file_name, @root)\n\t\t\t\tif File.exist?(full_path)\n\t\t\t\t\treturn full_path\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "5b22d10dc1dc17a4737994b29b979b8d",
"score": "0.608117",
"text": "def src_path\n ::File.join(@src_dir, @file_list.original_name)\n end",
"title": ""
},
{
"docid": "eea7d5b15c4fc5220ec05931602c0f50",
"score": "0.6076545",
"text": "def relative_file_name\n @file.sub(%r{\\A#{@base_dir}/}, \"\")\n end",
"title": ""
},
{
"docid": "b21be1ed5376a81b9c8438332b8ab92a",
"score": "0.606151",
"text": "def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c95fa12a351f4b726d4aa50310752e60",
"score": "0.6043478",
"text": "def dirname\n path.sub(%r{/?[^/]*/?$}, \"\")\n end",
"title": ""
},
{
"docid": "cb8c49d940d5c853e6084e300b41914b",
"score": "0.6038742",
"text": "def relative_path\n File.join subdir, name\n end",
"title": ""
},
{
"docid": "e4e92c18f9f9e179627481cf3afb86af",
"score": "0.603801",
"text": "def dir_path\n File.dirname(file_path)\n end",
"title": ""
},
{
"docid": "81ea726028207abe33528bba756f5a89",
"score": "0.6037877",
"text": "def sub_path(name)\n File.expand_path(name, root_dir)\n end",
"title": ""
},
{
"docid": "279e32af1e4e33cb2cf5d1d6eae9cae6",
"score": "0.60164714",
"text": "def full_path(dummy_argument=:work_arround_for_ruby_GC_bug)\n (if relative_path.nil? or relative_path == \"\" or relative_path == \".\"\n path\n else\n File.join(path, relative_path)\n end).gsub(%r{//+}, \"/\")\n end",
"title": ""
},
{
"docid": "06661e671d0153157bbd503d8f2c2067",
"score": "0.6011813",
"text": "def reldir_to_src_root(path)\n src = self.class.closest_dir path\n @src_root_abs.relative_path_from(src)\n end",
"title": ""
},
{
"docid": "9d9a09210e1fd8ad7ba03cad0b0426a8",
"score": "0.60109156",
"text": "def find_dir_w_file(d,h)\n g = Dir.glob(RbConfig.expand(d+\"/\"+h))\n File.dirname(g.last) if g and !g.empty?\nend",
"title": ""
},
{
"docid": "a8e3d1f4b0b3a737e2eb63f6610ab5f3",
"score": "0.60106695",
"text": "def resolve_path(path)\n joined = ::File.join(Global.public_root, path)\n\n if ::File.directory?(joined)\n Dir[joined/\"{#{INDICES.join(',')}}\"].first || joined\n else\n joined\n end\n end",
"title": ""
},
{
"docid": "353849f18a30fa945707becde083d36a",
"score": "0.6010039",
"text": "def basedir\n File.directory?(@file) ? @file : File.dirname(@file)\n end",
"title": ""
},
{
"docid": "52a91bb6895cdb48b260d5716f7b57f1",
"score": "0.6008827",
"text": "def pretty_fullpath\n return self.fullpath unless self.has_wildcards?\n\n index = 0\n\n self.fullpath.split('/').map do |segment|\n if segment == '*'\n \":#{self.wildcards[index]}\".tap { index += 1 }\n else\n segment\n end\n end.join('/')\n end",
"title": ""
},
{
"docid": "8a731ae9f01c7f04cb57f78cc5ad1f9f",
"score": "0.6007466",
"text": "def dir_strict2(path)\n dir = File.dirname(get(path))\n\n if %w[.].include?(dir) && path !~ %r~^\\./~\n \"\"\n else\n dir\n end\n end",
"title": ""
},
{
"docid": "9f05668570e07af06b96ed509ddc5c37",
"score": "0.59918743",
"text": "def full_path\n\t\t if file and @props[:repo]\n Pathname.new(@props[:repo]).dirname+file\n\t\t else\n\t\t path\n\t\t end\n\t\tend",
"title": ""
},
{
"docid": "71bbbd9ea82a667a048fb47f385f50e5",
"score": "0.5990443",
"text": "def full_path\n container.root.join(path)\n end",
"title": ""
},
{
"docid": "55f0acdaf27bc0276e0c2067bc0ae0af",
"score": "0.59896094",
"text": "def fully_qualified_path\n path = expand_path\n path = path.sub(/ \\z/x, \"/\") if path.directory?\n path\n end",
"title": ""
},
{
"docid": "cc875efe68f46ab701685a00c03f02e4",
"score": "0.5984817",
"text": "def get_path(path)\n if overwrite_file_path?(path)\n path = add_index_root?(path) ? (path + @index) : @urls[path]\n end\n File.join(@root, Utils.clean_path_info(path))\n end",
"title": ""
},
{
"docid": "16cf38f0e689d2c02aa0dee89c0456ad",
"score": "0.5984776",
"text": "def realpath\n path.nil? ? template.src_folder : File.join(template.src_folder, path)\n end",
"title": ""
},
{
"docid": "333c207bbb61ca493b55fd40029bf860",
"score": "0.59846276",
"text": "def relative_path(path)\n path_array = path.split('/').select {|x| x != \"..\"}\n path_array.shift\n path_array.join('/')\n end",
"title": ""
},
{
"docid": "0646a404c46e54e42a43c57f1a3d0850",
"score": "0.5976971",
"text": "def relative_path_for(path)\n path[@path.length + 1, path.length] or '.'\n end",
"title": ""
},
{
"docid": "74ed3fb192d9c7056be6779baca51050",
"score": "0.597372",
"text": "def relative_path(path, directory)\n path = Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(File.expand_path(directory))).to_s\n path == '.' ? '' : path\n end",
"title": ""
},
{
"docid": "8a2af9b6b46bb123477abd4762821500",
"score": "0.59509635",
"text": "def full_path\n program.root_path().join(path)\n end",
"title": ""
},
{
"docid": "8814d94b9fdce24209dcb843b337c471",
"score": "0.5948057",
"text": "def src_basename\n @src_node.pathname.basename.to_s\n end",
"title": ""
},
{
"docid": "2c6f635ac25c9b72ade57a5829b149a2",
"score": "0.5945675",
"text": "def till_slash(f_path)\n\t# Remove characters from the absolute path till a \"/\" is encountered.\n\tloop {\n\t\t# If the last character of the absolute path is \"/\"\n\t\tif f_path[-1].chr == \"/\"\n\t\t\t# Exit indefinite loop\n\t\t\tbreak\n\t\tend\n\t\t\n\t\t# Remove a character following the \"/\" character\n\t\tf_path = f_path.chop\n\t}\n\t\n\t# Remove the \"/\" character\n\tf_path = f_path.chop\n\t\n\t# Return absolute path of the file's/subdirectory's directory\n\treturn f_path\nend",
"title": ""
},
{
"docid": "2c6f635ac25c9b72ade57a5829b149a2",
"score": "0.5945675",
"text": "def till_slash(f_path)\n\t# Remove characters from the absolute path till a \"/\" is encountered.\n\tloop {\n\t\t# If the last character of the absolute path is \"/\"\n\t\tif f_path[-1].chr == \"/\"\n\t\t\t# Exit indefinite loop\n\t\t\tbreak\n\t\tend\n\t\t\n\t\t# Remove a character following the \"/\" character\n\t\tf_path = f_path.chop\n\t}\n\t\n\t# Remove the \"/\" character\n\tf_path = f_path.chop\n\t\n\t# Return absolute path of the file's/subdirectory's directory\n\treturn f_path\nend",
"title": ""
},
{
"docid": "3244f4ed60676fd0f125c088667eb860",
"score": "0.5940219",
"text": "def relpath_to_dir_after_generate(src_filepath, dir_path)\n dst_abs = dst_abs_from_src_abs(src_filepath)\n dir = self.class.to_pathname(dir_path)\n dir.relative_path_from(dst_abs)\n end",
"title": ""
},
{
"docid": "2dc140fc8b5609d27af4ba90fabdb7ea",
"score": "0.5934811",
"text": "def uri_to_relative(filepath)\n result = URI.split(filepath)[5]\n result = result[1..-1] if result[0] == \"/\".freeze\n result\n end",
"title": ""
},
{
"docid": "eb15b51d05fbd939cfdeb3829f2367a6",
"score": "0.5934443",
"text": "def source_path\n root.join(self[\"source_path\"])\n end",
"title": ""
},
{
"docid": "9f7b519d59fcfa9d13b7a3d10d5fc834",
"score": "0.5932319",
"text": "def directory\n unless path.nil? || path.empty?\n parts = path.split('/')\n if parts.empty?\n '/'\n else\n parts.pop unless segment.to_s.empty?\n parts.unshift('') unless parts.first.to_s.empty?\n parts.compact.join('/')\n end\n end\n end",
"title": ""
},
{
"docid": "03797fbfebf074d4bd596c13606ad91a",
"score": "0.5929673",
"text": "def get_file_dir(filepath)\n if filepath =~ %r{^((.*\\/)[^\\/]+|[^\\/]+)$}\n # Return directory (sans file name)\n return Regexp.last_match[2]\n end\n raise \"Invalid path: #{filepath}\"\n end",
"title": ""
},
{
"docid": "7bcea3f0e36e3b1d6fbf866eb2e23039",
"score": "0.59273857",
"text": "def relative_path(path)\n\t\t\tcurrent_hierarchy = Quarto::Generator.current_output_file_path\n\t\t\tunless current_hierarchy.is_a?(String)\n\t\t\t\traise \"Expected Quarto::Generator.current_output_file_path to be a String, but got #{current_hierarchy.inspect}\"\n\t\t\tend\n\t\t\tcurrent_hierarchy = current_hierarchy.split('/')\n\t\t\tcurrent_hierarchy.pop # remove the filename\n\t\t\ttarget_hierarchy = path.split('/')\n\t\t\twhile current_hierarchy[0] == target_hierarchy[0]\n\t\t\t\tcurrent_hierarchy.shift\n\t\t\t\ttarget_hierarchy.shift\n\t\t\tend\n\t\t\trel_path = current_hierarchy.inject('') do |result, dir|\n\t\t\t\tresult + '../'\n\t\t\tend\n\t\t\trel_path << target_hierarchy.join('/')\n\t\tend",
"title": ""
},
{
"docid": "d7d6e6af01701ef64147f97a4682ac2d",
"score": "0.591942",
"text": "def file_full_path\n Rails.root.to_s + file_path.to_s\n end",
"title": ""
},
{
"docid": "b547a9339f5184ef5d73617ea63c379d",
"score": "0.5916484",
"text": "def filename\n only_ext = true\n relative = nil\n if (@in_files != nil)\n @in_files.each { |file| \n re = /ext\\/(.*)+\\/([^)]+)\\.c/\n md = re.match(file.name)\n if md == nil\n only_ext = false\n else\n relative = md[1]\n end\n }\n if only_ext\n return relative\n end\n end\n \n nil\n end",
"title": ""
},
{
"docid": "af4c66a6c0be8cac74cc469c071c0c51",
"score": "0.5909146",
"text": "def source_path(file = \"sitemap.xml\")\n File.expand_path \"../#{file}\", __dir__\n end",
"title": ""
},
{
"docid": "f910a2c14be61c379906670b26daad53",
"score": "0.5901042",
"text": "def relative(base, path)\n dir = base.rindex(\"/\") ? base[0..base.rindex(\"/\")] : \"\"\n no_slash(path[dir.length..-1])\nend",
"title": ""
},
{
"docid": "a764f0a2cfc3fe9244a4b37c6393ed14",
"score": "0.5895117",
"text": "def flatten_root_relative\n source_root_url + path[1..-1] # strip the leading “/” from the path\n end",
"title": ""
},
{
"docid": "8a02d0e254fc4604ca3d13d832ee079b",
"score": "0.58931094",
"text": "def process_path(path)\n path.sub('path/to', @default_file_directory)\nend",
"title": ""
},
{
"docid": "3ec72daa7cd21fbe9d4dd54ea01e864a",
"score": "0.58928484",
"text": "def relative_to_original_destination_root(path, remove_dot=true)\n path = path.dup\n if path.gsub!(destination_root, '.')\n remove_dot ? (path[2..-1] || '') : path\n else\n path\n end\n end",
"title": ""
},
{
"docid": "db4046fd614cb959c05423b41076a3bb",
"score": "0.58921313",
"text": "def basepath\n File.join(File.dirname(self.path), File.basename(self.path, '.*'))\n end",
"title": ""
},
{
"docid": "dcdd919ca9e8326ca06106320afe4c94",
"score": "0.58864135",
"text": "def source_dir\n Pathname(File.join(root, config[:source]))\n end",
"title": ""
},
{
"docid": "93eb7ce1ac4077f730c2816fe9f3fead",
"score": "0.58725774",
"text": "def source_path(file = \"sitemap.xml\")\n File.expand_path \"../#{file}\", __dir__\n end",
"title": ""
},
{
"docid": "aba820c5b9e7ea47163933d3cb2dd518",
"score": "0.5872275",
"text": "def relative_to_srcroot(path)\n path.relative_path_from(client_root).to_s\n end",
"title": ""
},
{
"docid": "937ab1c41568a3e68965b3c7015a8a6a",
"score": "0.5868125",
"text": "def dirname( filename )\n rgxp = %r/\\A(?:#{self.config.content_dir}|#{self.config.layout_dir})\\/?/o\n dirname = ::File.dirname(filename)\n dirname << '/' if dirname.index(?/) == nil\n dirname.sub(rgxp, '')\n end",
"title": ""
},
{
"docid": "96d3de549d849ad0cd4038ba26e954f0",
"score": "0.5867834",
"text": "def fullpath(file, path)\n if file.nil?\n dir = path || @location_paths.first || Dir.pwd\n ::File.join(dir, \"#{filename}#{@extname}\")\n elsif file && path\n ::File.join(path, ::File.basename(file))\n else\n file\n end\n end",
"title": ""
},
{
"docid": "65c74c5662e08d64ffc6161104396b92",
"score": "0.58596176",
"text": "def simplify_path(path)\n rr = File.expand_path(File.join(RAILS_ROOT, \"..\")) + \"/\"\n File.expand_path(path).gsub(/^#{rr}/, \"\")\nend",
"title": ""
},
{
"docid": "bda124c16b7b8ed9297dd319376e34ba",
"score": "0.5857476",
"text": "def hier src, prefix\n dir + '/.' + src.sub(%r{\\A#{prefix}/?}, '').split('/').map { |d| d.sub /\\A_/, '' }.join('/')\n end",
"title": ""
},
{
"docid": "d150834c1b06059aaf80ac26123e74aa",
"score": "0.5854647",
"text": "def relative_to_original_destination_root(path, remove_dot = true)\n path = path.dup\n if path.gsub!(@destination_stack[0], \".\")\n remove_dot ? (path[2..-1] || \"\") : path\n else\n path\n end\n end",
"title": ""
}
] |
3805dd7d663b7f2265f48c761665d732
|
GET /radios/new GET /radios/new.json
|
[
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.0",
"text": "def edit; end",
"title": ""
}
] |
[
{
"docid": "1d1ee25cd525c1f2d603c705eeddd4a3",
"score": "0.6882535",
"text": "def new\n @radio = Radio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @radio }\n end\n end",
"title": ""
},
{
"docid": "1d1ee25cd525c1f2d603c705eeddd4a3",
"score": "0.6882535",
"text": "def new\n @radio = Radio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @radio }\n end\n end",
"title": ""
},
{
"docid": "9a901f083a616954869423cc4b0f9362",
"score": "0.683074",
"text": "def new\n @mote = Mote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @radio }\n end\n end",
"title": ""
},
{
"docid": "fd46eb658e309ff90d18970e1756a6f8",
"score": "0.6724254",
"text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end",
"title": ""
},
{
"docid": "5cf465f92df4a0de2696682a1815ca76",
"score": "0.6556093",
"text": "def new\n @ram = Ram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ram }\n end\n end",
"title": ""
},
{
"docid": "d18208ce55714bb4d9b3a2c5605d30c7",
"score": "0.6537577",
"text": "def new\n @radio_group = RadioGroup.new\n @dispatch_centers = DispatchCenter.all\n @crews = Crew.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @radio_group }\n end\n end",
"title": ""
},
{
"docid": "2a03c370ed7bae61fb071270d78f4efe",
"score": "0.6529917",
"text": "def new\n @ridol = Ridol.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ridol }\n end\n end",
"title": ""
},
{
"docid": "4a6d100fbca7b810114e340445fbbf4c",
"score": "0.64853126",
"text": "def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end",
"title": ""
},
{
"docid": "95c3b84a463a74a8640e262a39ed9482",
"score": "0.6481785",
"text": "def new\n @rum = Rum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rum }\n end\n end",
"title": ""
},
{
"docid": "3782c0d68c6a6bd75cc3dcf9f622da65",
"score": "0.6442911",
"text": "def new\n @rating = Rating.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rating }\n end\n end",
"title": ""
},
{
"docid": "3782c0d68c6a6bd75cc3dcf9f622da65",
"score": "0.6442911",
"text": "def new\n @rating = Rating.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rating }\n end\n end",
"title": ""
},
{
"docid": "3782c0d68c6a6bd75cc3dcf9f622da65",
"score": "0.6442911",
"text": "def new\n @rating = Rating.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rating }\n end\n end",
"title": ""
},
{
"docid": "27d424c677e956e2112f195b4a971287",
"score": "0.642955",
"text": "def new\n @estadio = Estadio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estadio }\n end\n end",
"title": ""
},
{
"docid": "27d424c677e956e2112f195b4a971287",
"score": "0.642955",
"text": "def new\n @estadio = Estadio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estadio }\n end\n end",
"title": ""
},
{
"docid": "dfa715907076bd80e8ba7ba10494d534",
"score": "0.63844836",
"text": "def new\n @circle = Circle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @circle }\n end\n end",
"title": ""
},
{
"docid": "dfa715907076bd80e8ba7ba10494d534",
"score": "0.63844836",
"text": "def new\n @circle = Circle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @circle }\n end\n end",
"title": ""
},
{
"docid": "ec3add36be04871a0b328954f72e61bb",
"score": "0.63599485",
"text": "def create\n @radio = Radio.new radio_params\n flash.now[:notice] = 'Radio was successfully created.' if @radio.save\n respond_with @radio, location: radios_path\n end",
"title": ""
},
{
"docid": "00ee0574c9405885d5cf495aefc96ce1",
"score": "0.635313",
"text": "def create\n @radio = Radio.new(radio_params) \t\n respond_to do |format|\n if @radio.save\n format.json {render json: @radio, status: :ok }\n else\n format.json { render json: @radio.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "05851c99d00c19b7acc299b5797b502e",
"score": "0.6346442",
"text": "def new\n @rating_alt = Rating.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rating_alt }\n end\n end",
"title": ""
},
{
"docid": "77798eeb6252e4f204a301b577b595fc",
"score": "0.6326158",
"text": "def new\n @ringtone = Ringtone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ringtone }\n format.js\n end\n end",
"title": ""
},
{
"docid": "2f422c8799dee8bb619478a58f459e0f",
"score": "0.6322353",
"text": "def new\n @compound = Compound.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compound }\n end\n end",
"title": ""
},
{
"docid": "40e198f5d4bea194c391bec0cbd6971f",
"score": "0.6306733",
"text": "def create\n @radio = Radio.new(params[:radio])\n\n respond_to do |format|\n if @radio.save\n format.html { redirect_to(@radio, :notice => 'Radio was successfully created.') }\n format.xml { render :xml => @radio, :status => :created, :location => @radio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @radio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d039a37269d3dbc0349c1c6b2e962b2e",
"score": "0.6306033",
"text": "def new\n @rinit = Rinit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rinit }\n end\n end",
"title": ""
},
{
"docid": "89041de801f1c637564d4ef6dadc435e",
"score": "0.6294183",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0e433b9c4d045612eaf3c3c247d79aa9",
"score": "0.6252805",
"text": "def new\n @resource_type = ResourceType.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end",
"title": ""
},
{
"docid": "ab393da77b3bc0bd3ab48876f0f0525d",
"score": "0.6248616",
"text": "def create\n @radio = Radio.new(params[:radio])\n\n respond_to do |format|\n if @radio.save\n flash[:notice] = 'Radio was successfully created.'\n format.html { redirect_to(@radio) }\n format.xml { render :xml => @radio, :status => :created, :location => @radio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @radio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38c4e68c53e1ca4b9dec14a10b7d1f50",
"score": "0.6236904",
"text": "def new\n @rcrieval = Rcrieval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rcrieval }\n end\n end",
"title": ""
},
{
"docid": "aed2af17b772318c442aa16ed6e99ba1",
"score": "0.6234494",
"text": "def new\n @reltramovano = Reltramovano.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reltramovano }\n end\n end",
"title": ""
},
{
"docid": "572298eb9909895a566170fcdc3c558b",
"score": "0.6226186",
"text": "def new\n @red_flag = RedFlag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @red_flag }\n end\n end",
"title": ""
},
{
"docid": "ba5783b3c710eec7cf26ff7361098356",
"score": "0.62217945",
"text": "def new\n @atr = Atr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @atr }\n end\n end",
"title": ""
},
{
"docid": "ca503cf3e44ff55a99edffbab74c1ca6",
"score": "0.62216234",
"text": "def new\n @attri = Attri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attri }\n end\n end",
"title": ""
},
{
"docid": "afcfc8269e8222795f2bb9fe21dc838d",
"score": "0.6212049",
"text": "def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"title": ""
},
{
"docid": "9520f78d4c0d80ed926f012a72c0b8ae",
"score": "0.61933535",
"text": "def new\n @rtype = Rtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rtype }\n end\n end",
"title": ""
},
{
"docid": "b44ef126635f4b985620ad52b44a8bbd",
"score": "0.61897445",
"text": "def new\n @round = Round.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @round }\n end\n end",
"title": ""
},
{
"docid": "b4af3932531ecb62bb6cac92d937bd97",
"score": "0.6183809",
"text": "def new\n @expression_relationship_type = ExpressionRelationshipType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expression_relationship_type }\n end\n end",
"title": ""
},
{
"docid": "3ba4c3154dfdc663e8d9ed15403d9821",
"score": "0.6182495",
"text": "def new\n @relatorios = Relatorio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatorios }\n end\n end",
"title": ""
},
{
"docid": "91e97e65623d5fe71f5c6df3feb4cca4",
"score": "0.61802465",
"text": "def new\n @variety = Variety.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @variety }\n end\n end",
"title": ""
},
{
"docid": "60e3695b61cd22e4dcbfbc4fd85cf072",
"score": "0.6180191",
"text": "def new\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end",
"title": ""
},
{
"docid": "615c1e1c8a1ddd10fae6d3c3e710813d",
"score": "0.6179793",
"text": "def new\n @type = Type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end",
"title": ""
},
{
"docid": "342f6517ffdfe3181f705296837841c6",
"score": "0.61785305",
"text": "def new\n @ramal = Ramal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ramal }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.61684096",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.61684096",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.61684096",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.61684096",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.61684096",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "45ab435d778bc6d151520b3a9f535e50",
"score": "0.61663866",
"text": "def new\n @realty_type = RealtyType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @realty_type }\n end\n end",
"title": ""
},
{
"docid": "66478484c57f1f7daea375504824adc0",
"score": "0.6157458",
"text": "def new\n @security_similar = SecuritySimilar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @security_similar }\n end\n end",
"title": ""
},
{
"docid": "2afe85c45127d1db5af493430727fff4",
"score": "0.6155373",
"text": "def new\n @repa = Repa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repa }\n end\n end",
"title": ""
},
{
"docid": "4c22e857bd7a85b51f3b9b504fca481d",
"score": "0.6154412",
"text": "def new\n @breadcrumb = 'create'\n @ratio_group = RatioGroup.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ratio_group }\n end\n end",
"title": ""
},
{
"docid": "e4d83253031320daee2c3de97a909e81",
"score": "0.6153354",
"text": "def new\n @rock = Rock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rock }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.6146962",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.6146962",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.6146962",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "3739364d312f0b3efa79f22f581b3a31",
"score": "0.6143214",
"text": "def new\n @radio_program = RadioProgram.new\n 1.times { @radio_program.audios.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @radio_program }\n end\n end",
"title": ""
},
{
"docid": "b19140e56f88370b1086810b2adaf565",
"score": "0.61407596",
"text": "def new\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rsvp }\n end\n end",
"title": ""
},
{
"docid": "b19140e56f88370b1086810b2adaf565",
"score": "0.61407596",
"text": "def new\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rsvp }\n end\n end",
"title": ""
},
{
"docid": "e2dc9cbe6462ea34efce1af4591c4f8f",
"score": "0.61387086",
"text": "def new\n @oma_relation_type = OmaRelationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @oma_relation_type }\n end\n end",
"title": ""
},
{
"docid": "3a0405039d85e7c5952c06625910ba1f",
"score": "0.6138521",
"text": "def new\n @resource = Resource.new\n @resource_types=ResourceType.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "47346e85bc88772a6bddea6739c65931",
"score": "0.6134188",
"text": "def new\n @rua = Rua.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rua }\n end\n end",
"title": ""
},
{
"docid": "41650db805ea0751d4314f77d3199296",
"score": "0.6128795",
"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": "f021d6d2c069c331189d4a2a721844a5",
"score": "0.6127134",
"text": "def new\n @railway = Railway.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @railway }\n end\n end",
"title": ""
},
{
"docid": "4e65036498305ddc9c67347b8dd86948",
"score": "0.6127045",
"text": "def new\n @rrold = Rrold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rrold }\n end\n end",
"title": ""
},
{
"docid": "5126edc2552c25dfcfc8387858952d49",
"score": "0.61224127",
"text": "def new\n \trespond_with @rubro\n end",
"title": ""
},
{
"docid": "2a22ec97a33d4dd14a183b94ebcb1c98",
"score": "0.61144584",
"text": "def new\n @rank = Rank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @rank }\n end\n end",
"title": ""
},
{
"docid": "a141830f2486bb0b28b8914939cbbb3b",
"score": "0.6109968",
"text": "def new\n @operation = Operation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @operation }\n end\n end",
"title": ""
},
{
"docid": "7c2aa7f9a2f48edd14927d52c99b13d6",
"score": "0.61078936",
"text": "def new\n @apprentice = Apprentice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apprentice }\n end\n end",
"title": ""
},
{
"docid": "1fe31c27fdc54f14804affa7a37e9fc0",
"score": "0.6106114",
"text": "def new\n @role = Role.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @role }\n end\n end",
"title": ""
},
{
"docid": "1fe31c27fdc54f14804affa7a37e9fc0",
"score": "0.6106114",
"text": "def new\n @role = Role.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @role }\n end\n end",
"title": ""
},
{
"docid": "1fe31c27fdc54f14804affa7a37e9fc0",
"score": "0.6106114",
"text": "def new\n @role = Role.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @role }\n end\n end",
"title": ""
},
{
"docid": "d9c488312f916dc48dcccf7863842f2c",
"score": "0.6094756",
"text": "def new\n @rent = Rent.new\n @properties = AddProperty.find(:all, :conditions =>\" is_rented = 0 \");\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rent }\n end\n end",
"title": ""
},
{
"docid": "dba396ec2b2f481deb8df610140ac413",
"score": "0.60912657",
"text": "def new\n @kind = Kind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kind }\n end\n end",
"title": ""
},
{
"docid": "c1b120b15f30669a0cac3ffd94e0b086",
"score": "0.6090413",
"text": "def new\n @recinto = Recinto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recinto }\n end\n end",
"title": ""
},
{
"docid": "7393bd36d03562ad98b2318e5738cc4e",
"score": "0.6085919",
"text": "def new\n @recipe_all = RecipeAll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_all }\n end\n end",
"title": ""
},
{
"docid": "7e2c1c51adc3a7f1bd905ce7e70ad465",
"score": "0.608513",
"text": "def new\n @title = \"New Resources Periods\"\n @resource_period = ResourcePeriod.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource_period }\n end\n end",
"title": ""
},
{
"docid": "4560ee1f7b9b1826a4a542b3df707120",
"score": "0.6081216",
"text": "def new\n @presence = Presence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presence }\n end\n end",
"title": ""
},
{
"docid": "d8c444c632e799d81e2f335fc7616be8",
"score": "0.6075989",
"text": "def new\n @reel = Reel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reel }\n end\n end",
"title": ""
},
{
"docid": "7207b823679281b0cb6e05d534bd8a1b",
"score": "0.6073172",
"text": "def new\n @relogio = Relogio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relogio }\n end\n end",
"title": ""
},
{
"docid": "d3dc9987ebb2cbf0d2733bd8a1b1d9b4",
"score": "0.60666263",
"text": "def new\n @circulation = Circulation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @circulation }\n end\n end",
"title": ""
},
{
"docid": "4063fa5f070167510d5c36a14ee0b4c5",
"score": "0.6062725",
"text": "def new\n @girltype = Girltype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @girltype }\n end\n end",
"title": ""
},
{
"docid": "61b3b60dc9ab01dfb419a8e1b7f7ebd9",
"score": "0.6059281",
"text": "def create\n @radioshow = Radioshow.new(radioshow_params)\n\n respond_to do |format|\n if @radioshow.save\n format.html { redirect_to music_path, notice: 'Radioshow was successfully created.' }\n format.json { render :show, status: :created, location: @radioshow }\n else\n format.html { render :new }\n format.json { render json: @radioshow.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f9db4488195c1dd05da8ade5ce3feae",
"score": "0.605724",
"text": "def new\n @noto = Noto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noto }\n end\n end",
"title": ""
},
{
"docid": "0eed20f15f411f8ebd94e4632c227700",
"score": "0.60509527",
"text": "def new\n @relation = Relation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation }\n end\n end",
"title": ""
},
{
"docid": "c6011bf182facbb1b8362cbaaecf277a",
"score": "0.60365003",
"text": "def new\n @rayon = Rayon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rayon }\n end\n end",
"title": ""
},
{
"docid": "5210fb604c38cbe2ab21ea55c068f4ad",
"score": "0.60314953",
"text": "def new\n @resource = Resource.new\n respond_to do |format|\n format.html {render action: :new} # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "2ac76f4714e2009ace6bbfb6f8e98efc",
"score": "0.6026445",
"text": "def new\n @roadcrime = Roadcrime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roadcrime }\n end\n end",
"title": ""
},
{
"docid": "77f936e099d037a61f347553e81a1b5c",
"score": "0.6025879",
"text": "def new\n @renter = Renter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @renter }\n end\n end",
"title": ""
},
{
"docid": "a0dbf626d0370bb8e470ddb485422ced",
"score": "0.60099983",
"text": "def new\n @network = Network.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @network }\n end\n end",
"title": ""
},
{
"docid": "b23c3d411a5e8c35b41d8585e394a247",
"score": "0.60092133",
"text": "def new\n @star_fact = Star::Fact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @star_fact }\n end\n end",
"title": ""
},
{
"docid": "f13cd66d36896663270dd2ac7dc34c64",
"score": "0.60087824",
"text": "def new\n @create_rating = CreateRating.new\n\n respond_to do |format|\n \n format.html # new.html.erb\n format.xml { render :xml => @create_rating }\n end\n end",
"title": ""
},
{
"docid": "24ecb5e3aa3476114d10cf2ae8226e2c",
"score": "0.60083276",
"text": "def new\n @new_review = NewReview.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_review }\n end\n end",
"title": ""
},
{
"docid": "1612eaa5a47ee0534d42721a83a01aa8",
"score": "0.6007437",
"text": "def new\n @core_nota = Core::Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_nota }\n end\n end",
"title": ""
},
{
"docid": "55596433b8a9b19e43dc957a9348c989",
"score": "0.6004725",
"text": "def new\n @concept = Concept.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concept }\n end\n end",
"title": ""
},
{
"docid": "d1b3c98474bc1f25706e4ad5ce7263fc",
"score": "0.6001757",
"text": "def new\n @orthodb_level = OrthodbLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orthodb_level }\n end\n end",
"title": ""
},
{
"docid": "6f1e06f2ed4f929345552fcbb19f611f",
"score": "0.59976304",
"text": "def new\n @remito = Remito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @remito }\n end\n end",
"title": ""
},
{
"docid": "3d8ee53891cf461923d55eac10bf5e38",
"score": "0.5995993",
"text": "def new\n @trenton = Trenton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trenton }\n end\n end",
"title": ""
},
{
"docid": "09d9f63143f3f7b19ff30d622452b203",
"score": "0.5992119",
"text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lore }\n end\n end",
"title": ""
},
{
"docid": "5444a59dece822bdfeac9db3a2f3a631",
"score": "0.59910494",
"text": "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end",
"title": ""
},
{
"docid": "7cf9ea453034ec763eaca14f3591a12b",
"score": "0.59859097",
"text": "def new\n @socio = Socio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @socio }\n end\n end",
"title": ""
},
{
"docid": "b99bf410dc1438407c8908a0d99f566d",
"score": "0.59853417",
"text": "def new\n @requisition = Requisition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requisition }\n end\n end",
"title": ""
},
{
"docid": "9744a0a315778c64df7368cfb7aeb79f",
"score": "0.5984782",
"text": "def new\n @gl_type = GlType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gl_type }\n end\n end",
"title": ""
},
{
"docid": "78fc5c9bcfdc78bf29f9ae0e74799532",
"score": "0.5981942",
"text": "def new\n @plannegocio = Plannegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plannegocio }\n end\n end",
"title": ""
}
] |
1f7857311f55ff1dc1cbeb6c3b1b1f9f
|
Fake a bad RC
|
[
{
"docid": "b2596607022d4465622efb1d02e55da2",
"score": "0.60548013",
"text": "def bad_rc(error_msg = '', args = {})\n @rc = 999\n @output = args[:output]\n @error_msg = error_msg\n self\n end",
"title": ""
}
] |
[
{
"docid": "33ad2cf3336fc5d05bfed0b38d105193",
"score": "0.59200984",
"text": "def rc?; end",
"title": ""
},
{
"docid": "dff37ea0d68b9c86bab1ceb2dfb658a9",
"score": "0.5796041",
"text": "def rc; end",
"title": ""
},
{
"docid": "af12fc44533fb1e35525618a695693ec",
"score": "0.5741771",
"text": "def fail_if_invalidate_fake_args(args)\n raise 'invalid group id' if args[:group_id] == INVALID_GROUP_ID\n raise 'invalid blueprint id' if args[:blueprint_id] == INVALID_BLUEPRINT_ID\n raise 'invalid url' if args[:url] == INVALID_VCAC_URL\n raise 'invalid password' if @password == INVALID_PASSWORD\n raise 'invalid url' if @url_prefix == INVALID_VCAC_URL\n\n @last_response = {'message' => 'Success', 'stacktrace' => nil, 'success' => true, 'machine_id' => '02800475-14ec-4a7e-8680-c0e4c16119d6'}\n\n end",
"title": ""
},
{
"docid": "d9fa6e07799ccb37b2fdb73f32404af6",
"score": "0.5739798",
"text": "def test_api_bad_request\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request('')\n end",
"title": ""
},
{
"docid": "deca5e01605df7655cd433763b5329db",
"score": "0.5724431",
"text": "def non_example_failure; end",
"title": ""
},
{
"docid": "cf5a85b85c9a4228c664135e02e8cd86",
"score": "0.56783456",
"text": "def genarete_broken_stub_for(root_url, req_uri, extension)\n stub_request(:get, \"#{root_url}#{req_uri}?version=#{extension}\").to_return(\n status: 200,\n body: '{\"referrrrrrence\": \"314124900925jfw3413\", \"content\": \"{}\" }',\n headers: { 'Content-Type' => 'application/json' }\n )\nend",
"title": ""
},
{
"docid": "2cf0d21d091dc500e47132971754a41a",
"score": "0.56586534",
"text": "def broken?; end",
"title": ""
},
{
"docid": "2cf0d21d091dc500e47132971754a41a",
"score": "0.56586534",
"text": "def broken?; end",
"title": ""
},
{
"docid": "ef9206f70e1a8e01b01fc61700bb83b0",
"score": "0.5591459",
"text": "def test_mg_client_handles_unsuported_input\n RestClient.stubs(:post).returns(exp_msg)\n ENV.stubs(:[]).returns('AN ENV VAR')\n\n assert_equal bad_req_code, MailgunClient.send_email(nil)\n assert_equal bad_req_code, MailgunClient.send_email('')\n assert_equal bad_req_code, MailgunClient.send_email(123)\n assert_equal bad_req_code, MailgunClient.send_email({})\n assert_equal bad_req_code, MailgunClient.send_email([])\n end",
"title": ""
},
{
"docid": "d5e6fcad531435d87b3763b42690fa1d",
"score": "0.5581956",
"text": "def mock_error_type\n GRPC::BadStatus\n end",
"title": ""
},
{
"docid": "f90ecef68234e1b50779770783150ef1",
"score": "0.55661315",
"text": "def assert(rc)\n raise \"Last API call failed at #{caller(1)}\" unless rc >= 0\nend",
"title": ""
},
{
"docid": "8a741d258b38ea89b1066d8cc02a2e10",
"score": "0.5554733",
"text": "def reset_narnia_neg_caller_id(caller_id, serial = 'fake')\n res = nil\n before :all do\n res = reset_narnia caller_id, serial\n end\n\n it 'Verify response [status] is false' do\n expect(res['status']).to eq(false)\n end\n\n it 'Verify error message is \\'Error while checking caller id\\'' do\n expect(res['data']['message']).to eq('Error while checking caller id')\n end\nend",
"title": ""
},
{
"docid": "aa0074c5d58d48ba0909abbe0daf09f6",
"score": "0.5551271",
"text": "def test_bombs_if_no_cached_json\n stub(URI).parse { raise RuntimeError }\n stub(File).read { raise RuntimeError, 'boom' }\n capture_io do\n assert_raises RuntimeError, 'boom' do\n vault_spec('usage.json')\n end\n end\n end",
"title": ""
},
{
"docid": "beca831fb21acdbebfd098845b291841",
"score": "0.5544747",
"text": "def good_rc(output = '', args = {})\n @rc = 0\n @output = output\n @error_msg = args[:error_msg]\n self\n end",
"title": ""
},
{
"docid": "9e8dcba9ed24973f5536befef46e615d",
"score": "0.550601",
"text": "def test_short_rcon_goldsrc_server\n assert_nothing_raised do\n server = GoldSrcServer.new IPAddr.new('127.0.0.1')\n server.rcon_auth 'test'\n rcon_reply = server.rcon_exec 'version'\n print \"#{rcon_reply}\\n\"\n\n assert(\n rcon_reply.include?('Protocol version') &&\n rcon_reply.include?('Exe version') &&\n rcon_reply.include?('Exe build'),\n 'Did not receive correct version response.');\n end\n end",
"title": ""
},
{
"docid": "f6a5d3476deb29771d4ac0277222ce50",
"score": "0.55024785",
"text": "def check_rc(rv_hash, inputs)\n code = rv_hash[:rc]\n\n if code && (code != Zookeeper::ZOK)\n return rv_hash if ignore_set(inputs[:ignore]).include?(code)\n \n msg = inputs ? \"inputs: #{inputs.inspect}\" : nil\n raise Exceptions::KeeperException.by_code(code), msg \n else\n rv_hash\n end\n end",
"title": ""
},
{
"docid": "8086e9fcec3bf9735bea27adc8e7077a",
"score": "0.5484473",
"text": "def verify_severe(rc)\r\n raise \"A severe error (#{rc}) occurred.\\n\" if rc < 0\r\n end",
"title": ""
},
{
"docid": "6513ed80c07083afaa67e08a17d5b972",
"score": "0.54606605",
"text": "def stubbed?; end",
"title": ""
},
{
"docid": "6bb991edba6b8d168919877dbc3692c6",
"score": "0.5453056",
"text": "def test_connection\n errors = nil\n begin\n\n if @personal_access_token\n @github_client = Octokit::Client.new(:access_token => @personal_access_token)\n else\n @github_client = Octokit::Client.new \\\n :login => @username,\n :password => @password\n end\n\n user = @github_client.user\n user.login \n\n rescue Octokit::Forbidden\n errors = \"403 - Forbidden\" \n rescue Octokit::Unauthorized\n errors = \"401 - Bad credentials for GitHub repository\"\n rescue Octokit::ServerError\n errors = \"(500-599) - GitHub server error\"\n end\n\n binding.pry\n\n errors\n end",
"title": ""
},
{
"docid": "dca63fd26b85f46313abd53859cb4598",
"score": "0.54468745",
"text": "def test_api_handles_nil_input\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request(nil)\n end",
"title": ""
},
{
"docid": "64087b2482a87b6c682c8cc897193c26",
"score": "0.54393905",
"text": "def test_api_handles_unsupported_input\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request('text')\n assert_raises NoMethodError do\n ambiguous_request(123)\n end\n assert_raises NoMethodError do\n ambiguous_request([])\n end\n end",
"title": ""
},
{
"docid": "936be353376bc8c1645578b65b92def4",
"score": "0.5421588",
"text": "def testget_bogus_record\n VCR.use_cassette('web service invalid document') do\n assert_raise(RuntimeError) {\n ws = Exlibris::Primo::WebService::GetRecord.new(@primo_invalid_doc_id, @base_url, {:institution => \"NYU\"})\n }\n end\n end",
"title": ""
},
{
"docid": "69da0e0c6e9db72dcb217c9dad33873f",
"score": "0.53721863",
"text": "def test_error_no_re\n\n pdef =\n Ruote.define do\n error :re => '$f:err'\n end\n\n wfid = @dashboard.launch(pdef)\n r = @dashboard.wait_for(wfid)\n\n assert_equal('terminated', r['action'])\n end",
"title": ""
},
{
"docid": "ba5a97a7ad577a47dfda564bd79171f7",
"score": "0.536686",
"text": "def test_connection \n\n begin\n response = send_my_own_request('/api/review-requests/')\n\n if response.code == '401' && response.msg == 'UNAUTHORIZED'\n return 'Please, check your credentials to Review Board system'\n elsif response.code == '502'\n return 'Something going wrong on Review Board server side. Please, try later.'\n end\n\n rescue Errno::ECONNREFUSED\n return \"Can't get connection to ReviewBoard url - #{@url} - Connection refused\"\n rescue Errno::ETIMEDOUT\n return \"Can't get connection to ReviewBoard url - #{@url} - Connection timed out\"\n end\n nil\n end",
"title": ""
},
{
"docid": "3f10b38052df27636831403ab052bdc1",
"score": "0.5356395",
"text": "def testsearch_by_invalid_doc_id\n VCR.use_cassette('searcher invalid id') do\n assert_raise(RuntimeError) { \n searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_invalid_doc_id})\n }\n end\n end",
"title": ""
},
{
"docid": "4598871ce1e476b35938709da1cd3655",
"score": "0.5354024",
"text": "def Retry; end",
"title": ""
},
{
"docid": "e258948fd3c062c0f4c6cb2d4e204677",
"score": "0.5344553",
"text": "def retry_on_windows; end",
"title": ""
},
{
"docid": "3338808c1ccab41fa72c414f6ac151b7",
"score": "0.53349936",
"text": "def reverify # :nologin:\n raise \"This action should never occur!\"\n end",
"title": ""
},
{
"docid": "d4a012f566996ed11c9223864f6c1493",
"score": "0.5324766",
"text": "def test_for_bad_uri_passed_to_method\n assert_raise Reve::Exceptions::ReveNetworkStatusException do\n @api.character_sheet :url => File\n end\n end",
"title": ""
},
{
"docid": "90ca89e80c54bdb79da5857a0be7a007",
"score": "0.531958",
"text": "def test_int_invalid\n refute @rpn.int?(\"10hello\")\n end",
"title": ""
},
{
"docid": "b0e34591e9357e7202df177856d777a0",
"score": "0.5309163",
"text": "def valid_exit_codes; end",
"title": ""
},
{
"docid": "ac6679bd13184e8d53bdf94e306ab39f",
"score": "0.53004056",
"text": "def test_rejecting_invalid_arguments\n flunk 'Not implemented yet!'\n end",
"title": ""
},
{
"docid": "09ef72277e6e4b26eb9cae28d79d1b51",
"score": "0.5295251",
"text": "def fail_fast; end",
"title": ""
},
{
"docid": "1e55ec402084619784628d1c7e8733bf",
"score": "0.5287827",
"text": "def generate_fake_response\n \"LOL\" * 404\n end",
"title": ""
},
{
"docid": "0172f026ea3f163d3cd0a7374c886142",
"score": "0.5285229",
"text": "def non_example_failure=(_arg0); end",
"title": ""
},
{
"docid": "cce4df4c6b1fcb8414f511b94972abfe",
"score": "0.5282163",
"text": "def test_version_1_0\n ok = false\n EM.run {\n c = silent { EM::P::HttpClient.request(\n :host => \"www.google.com\",\n :port => 80,\n :version => \"1.0\"\n )}\n c.callback {\n ok = true\n c.close_connection\n EM.stop\n }\n c.errback {EM.stop}\n }\n assert ok\n end",
"title": ""
},
{
"docid": "a2a8845bfc55c7e78b951272ebad1c94",
"score": "0.5275875",
"text": "def test_passes_other_exceptions\n client_stub = make_client_stub\n\n mock = expect_connection client_stub, :get, \"/foo\" do\n raise FakeCodeError.new(\"Not a real GRPC error\",\n GRPC::Core::StatusCodes::UNAVAILABLE)\n end\n\n assert_raises FakeCodeError do\n client_stub.make_get_request uri: \"/foo\"\n end\n mock.verify\n end",
"title": ""
},
{
"docid": "b60677e41b4719a55fb04b2f6035b657",
"score": "0.52736115",
"text": "def test_bad_path\r\n\t\tassert_raises(SystemExit){ suppress_output{@bc.validate_block_chain} }\r\n\tend",
"title": ""
},
{
"docid": "af8f14e7678a0d7d18394501451b0fb9",
"score": "0.5243953",
"text": "def test_api_handles_empty_input\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request({})\n assert_equal expected_response(bad_req_code), ambiguous_request('')\n end",
"title": ""
},
{
"docid": "aa698353af9b0b23dc325273039cbb04",
"score": "0.52424866",
"text": "def test_broken_version\n @client.stubs(:request).with(:get, '', allow_html: true).returns <<~HTML\n\n\n\n <script>\n window.location.href = '/help/manuals/api/index.html';\n </script>\n HTML\n\n assert_nil @client.version\n assert @client.version? '~> 9.3'\n end",
"title": ""
},
{
"docid": "f45548dcb7a3c38feff9885726278be6",
"score": "0.5239402",
"text": "def test_WAPI_do_request_unauthorized\n\n skip(\"problem on build server with user-agent mismatch\")\n stub_request(:get, \"https://start/hey\").\n with(:headers => {'Accept' => 'application/json', 'Accept-Encoding' => 'gzip, deflate', \n 'Authorization' => 'Bearer sweet!'}).\n to_return(:status => 401, :body => \"unauthorized\", :headers => {})\n\n a = Hash['api_prefix' => \"https://start\",\n 'key' => 'key',\n 'secret' => 'secret',\n 'scope' => 'nothing',\n 'grant_type' => 'tomb',\n 'token_server' => 'nowhere.edu',\n 'token' => 'sweet!'\n ]\n h = WAPI.new(a);\n\n r = h.do_request(\"/hey\")\n\n assert_equal(r.meta_status, 666, \"didn't get wrapped exception\")\n\n exp = r.result\n assert_equal(exp.http_code, 401, \"didn't catch unauthorized in do_request\")\n\n end",
"title": ""
},
{
"docid": "718e41dddc6a5eb2082d7d626e581916",
"score": "0.5227375",
"text": "def test_acknowledgement\n valid = Netgiro::Return.new(http_raw_data, :credential2 => 'password')\n assert valid.acknowledge\n assert valid.success?\n assert valid.complete?\n \n invalid = Netgiro::Return.new(http_raw_data, :credential2 => 'bogus')\n assert !invalid.acknowledge\n assert !invalid.success?\n assert !invalid.complete?\n end",
"title": ""
},
{
"docid": "3dd49bf89ca13eba8cb278cfe6edcd89",
"score": "0.52210975",
"text": "def rescue_result; end",
"title": ""
},
{
"docid": "2a6e643f452273bb035488c76b8b7b53",
"score": "0.52181584",
"text": "def test_malformed_bounce\n bounce = test_bounce('malformed_bounce_01')\n assert_equal '5.1.1', bounce.code\n end",
"title": ""
},
{
"docid": "8feb967fe16d40d30aa137bf716d211d",
"score": "0.5217796",
"text": "def bad_req_code\n assert_equal SendgridClient.bad_req_code, MailgunClient.bad_req_code\n SendgridClient.bad_req_code\n end",
"title": ""
},
{
"docid": "6014bdd45748b021a2d7ce040a0b406e",
"score": "0.521263",
"text": "def wrong_usage\n invoke(invalid) and pass\n end",
"title": ""
},
{
"docid": "535f76db4467d7995c15ff1e5d2cba55",
"score": "0.52090013",
"text": "def test_wrong_protocol_version_too_long_message\n ensure_server_fatal random_string(4096)\n end",
"title": ""
},
{
"docid": "1c9e07356b7d4f0837691db33b20beca",
"score": "0.5207284",
"text": "def test_rfc_compliant_errors\n @client.state[:nick] = 'nick'\n @client.state[:newnick] = %w{newnick, newnick2}\n @plugin.nick_in_use# message(:nick_in_use_rfc)\n assert_equal ['newnick2'], @client.state[:newnick]\n @plugin.nick_invalid# message(:invalid_nick_rfc) \n assert_equal [], @client.state[:newnick]\n end",
"title": ""
},
{
"docid": "e8b26c61db4847b1248f0c995fd59a24",
"score": "0.5202399",
"text": "def test_resume_failure\r\n assert_raises(ServiceError){ Service.resume('bogus') }\r\n assert_raises(ServiceError){ Service.resume('W32Time') }\r\n end",
"title": ""
},
{
"docid": "447cf38fff474ccf4b6f8c447a45edc8",
"score": "0.52015543",
"text": "def defuse\n begin # The following code may fail with an exception.\n puts risky # Try to invoke print the return value.\n rescue RuntimeError => e # If we get an exception\n puts e.message # print the error message instead.\n end\nend",
"title": ""
},
{
"docid": "78b6280a5d3e14c1f3cf6107f0218f3b",
"score": "0.519337",
"text": "def defuse\n begin # The following code may fail with an exception.\n puts risky # Try to invoke print the return value.\n rescue RuntimeError => e # If we get an exception\n puts e.message # print the error message instead.\n end \nend",
"title": ""
},
{
"docid": "7ee1695d19e7a5f1b9e40932294d7d05",
"score": "0.519218",
"text": "def test02()\n begin\n resultStr = MILAMeta.version\n \n if resultStr != $miversion\n puts \"MILAMeta.version returned: #{resultStr}\"\n end\n\n rescue RuntimeError => e\n $errorcode = MILAMeta.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: #{MILAMeta.exitstring}, Code: #{MILAMeta.exitvalue}\"\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend",
"title": ""
},
{
"docid": "83b7956f58466f9018cd599560a8e55a",
"score": "0.51880443",
"text": "def do_risky_thing\n fail \"bad thing\"\nend",
"title": ""
},
{
"docid": "b88590315e03fd797874d2f281a51635",
"score": "0.51858485",
"text": "def netrc; end",
"title": ""
},
{
"docid": "b2afb43f2c229a620e37427a3bfe5dec",
"score": "0.5185594",
"text": "def reverify\n raise(\"This action should never occur!\")\n end",
"title": ""
},
{
"docid": "37013b22997a7d16cf75d139ba2a2aef",
"score": "0.5185078",
"text": "def failed?; end",
"title": ""
},
{
"docid": "37013b22997a7d16cf75d139ba2a2aef",
"score": "0.5185078",
"text": "def failed?; end",
"title": ""
},
{
"docid": "a9b4b561b04ad3aa44d429bfab1373ef",
"score": "0.5184696",
"text": "def stubbee; end",
"title": ""
},
{
"docid": "1ba8c188f3990fdd9c79594029328395",
"score": "0.5181438",
"text": "def retries; end",
"title": ""
},
{
"docid": "926b6fee3192473d15a6c1614b15fb05",
"score": "0.5181287",
"text": "def fail_hard!\n @fail_hard = true\n end",
"title": ""
},
{
"docid": "81a13fd587abb7b5532fdccc1cf747af",
"score": "0.5170656",
"text": "def xtest_bogus_source_hoses_up_remote_install_but_gem_command_gives_decent_error_message\n @ruby_options << \" -rtest/bogussources\"\n gem_nossl \"install asdf --remote\"\n assert_match(/error/im, @err)\n assert_status 1\n end",
"title": ""
},
{
"docid": "ce83910952f81bd07d3f5df53e75decf",
"score": "0.5170478",
"text": "def test_on_serve()\n @l.open() \n expectT = \"Gim does not have a library card.\" \n assert_equal(expectT, @l.serve('Gim') ,msg=\"___Gim does not have a library card.\")\n @l.issue_card('Gim') \n expectT = \"Now serving Gim \"\n assert_equal(expectT, @l.serve('Gim') ,msg=\"___Now serving Gim\") \nend",
"title": ""
},
{
"docid": "adb0af49ae02e4b6cd7ac1268a406951",
"score": "0.5163067",
"text": "def hunter_stub(payload, badchars = '', opts = {})\n end",
"title": ""
},
{
"docid": "a11eb7d0088b221901dbf6d963545574",
"score": "0.5162844",
"text": "def rescueing; end",
"title": ""
},
{
"docid": "64681591548cd61181e4de7998a80c16",
"score": "0.51620704",
"text": "def fail_soft!\n @fail_hard = false\n end",
"title": ""
},
{
"docid": "c4d589290d75745bab2d59473804d9d2",
"score": "0.5158313",
"text": "def failure_exit_code; end",
"title": ""
},
{
"docid": "da971647eaf87cbb02a9234c4d560e6f",
"score": "0.5156817",
"text": "def test_connection \n str = escape_cru_project\n try(str)\n end",
"title": ""
},
{
"docid": "fc2a52551a3fd2fd6757f3dbec13868d",
"score": "0.51546913",
"text": "def test_verify_code_nonexistant\n params = { 'code' => @fake_promo }\n\n get '/pros/verify', params.merge(api_key)\n assert_response(@response, :client_error)\n assert_equal('NotFoundError', @parsed_response['error'])\n assert_equal('Oops! That promo code isn\\'t valid.', @parsed_response['message'])\n end",
"title": ""
},
{
"docid": "df7de3957e50569502d14c09fe9067be",
"score": "0.5151225",
"text": "def try_api\n yield\n rescue SystemCallError\n # log API connection failure\n :network_error\n end",
"title": ""
},
{
"docid": "066be921ec228d17c51f101728564a5d",
"score": "0.51468486",
"text": "def private\n head :ok\n end",
"title": ""
},
{
"docid": "42ae8512de994569bec6105572fe5396",
"score": "0.51464105",
"text": "def test_mg_client_empty_input\n RestClient.stubs(:post).returns(exp_msg)\n ENV.stubs(:[]).returns('AN ENV VAR')\n\n assert_equal bad_req_code, MailgunClient.send_email(EmailObject.new)\n end",
"title": ""
},
{
"docid": "20e27e9989ce82652d674236b04c0883",
"score": "0.51437557",
"text": "def try_api\n yield\n rescue SystemCallError => e\n # log API connection failure\n :network_error\n end",
"title": ""
},
{
"docid": "7bd8b2334feb24636f4d0545e4584ea9",
"score": "0.5143361",
"text": "def run_rc_file(rc_file); end",
"title": ""
},
{
"docid": "7bd8b2334feb24636f4d0545e4584ea9",
"score": "0.5143361",
"text": "def run_rc_file(rc_file); end",
"title": ""
},
{
"docid": "b9c0e11fa42c7794b41a2a0281f22c62",
"score": "0.51377916",
"text": "def check_fake_mode\n setting = MiniGit::Capturing.git(:config, 'vendorificator.stub').strip\n ['', 'false', '0', 'no'].include?(setting) ? false : true\n rescue MiniGit::GitError\n false\n end",
"title": ""
},
{
"docid": "6ca2c1cbec1b7cbb221d8d2a11f6b6db",
"score": "0.51359195",
"text": "def rejectCall code, reason\n @code = code; @reason = reason\n sys.Respond code, reason\nend",
"title": ""
},
{
"docid": "6ac7b2b0b7d5ed4de3b86392888370ca",
"score": "0.51344615",
"text": "def test_error_from_fetch\n new_service = Splunk::Service.new(@splunkrc)\n new_confs = new_service.confs()\n new_service.logout()\n assert_raise(SplunkHTTPError) do\n new_confs[temporary_name()]\n end\n end",
"title": ""
},
{
"docid": "e40385308a8da48755a43eeb31011abf",
"score": "0.5133954",
"text": "def internal_error; end",
"title": ""
},
{
"docid": "e8dbc901d93c9e1e8e5970783dca57e4",
"score": "0.51329225",
"text": "def test_send_invalid_parameters\n client = Givalia::Client.new(\"127.0.0.1\", 12322)\n res = client.enq(\"foobar\")\n client.close\n\n decRes = JSON.parse(res)\n\n testval = \"fail\"\n val = decRes['response']\n\n assert testval==val, \"JSON response invalid.\"\n end",
"title": ""
},
{
"docid": "e4a9e13f96857e6967bd713e110aa40c",
"score": "0.51316136",
"text": "def test_user_unknown\n bounce = test_bounce('tt_bounce_07')\n assert_equal '5.0.0', bounce.code\n end",
"title": ""
},
{
"docid": "31047aae893bc1a9f6c5cde164675c8c",
"score": "0.51268446",
"text": "def mock_undetermined_vehicle_compliance\n allow(ComplianceCheckerApi).to receive(:vehicle_compliance)\n .and_raise(BaseApi::Error422Exception.new(422, '', {}))\n end",
"title": ""
},
{
"docid": "0f300fe942c0e64b8d66a83332d41b1e",
"score": "0.51260865",
"text": "def test_short_rcon_source_server\n assert_nothing_raised do\n server = SourceServer.new IPAddr.new('127.0.0.1')\n if server.rcon_auth 'test'\n rcon_reply = server.rcon_exec 'version'\n print \"#{rcon_reply}\\n\"\n end\n\n assert(\n rcon_reply.include?('Protocol version') &&\n rcon_reply.include?('Exe version') &&\n rcon_reply.include?('Exe build'),\n 'Did not receive correct version response.');\n end\n end",
"title": ""
},
{
"docid": "f0c75e2f7c64b7236290f386df9abb58",
"score": "0.51217973",
"text": "def on_client_unknown_command(c,cmd,arg)\r\n\t\tc.put(\"200 OK\\r\\n\")\r\n\tend",
"title": ""
},
{
"docid": "624426ce65f61ebf507cf27a0f9ce04c",
"score": "0.5120191",
"text": "def fallback\n head :ok\n end",
"title": ""
},
{
"docid": "745d17f1d81da0c7bee51926aa5b0cd3",
"score": "0.5116807",
"text": "def test_invalid_cvv\n @gateway.expects(:ssl_post).returns(failed_token_response)\n response = @gateway.token(@invalid_cvv_card, @options)\n assert_failure response\n end",
"title": ""
},
{
"docid": "f9f63f0feef20da2f05a1af1f886985d",
"score": "0.51155674",
"text": "def rescueing=(_arg0); end",
"title": ""
},
{
"docid": "34c265bcf322b31754ed542353045e51",
"score": "0.5111073",
"text": "def test_rescues_errors\n app = TestApp.new(LogErrors) do |env|\n raise 'Kaboom'\n end\n\n without_error do\n app.get('/')\n end\n end",
"title": ""
},
{
"docid": "70a427969ce436b06d4591666e54d189",
"score": "0.5107768",
"text": "def test_invalid_authorization_scheme\n downstream_called = false\n test_user = User.new\n user_repo = UserRepo.new('abc123' => test_user)\n\n app = TestApp.new(Authorize, user_repo) do |env|\n downstream_called = true\n [200, {}, ['Downstream called']]\n end\n\n response = app.get('/', 'HTTP_AUTHORIZATION' => 'Basic abc123')\n\n assert_equal 401, response.status\n assert_equal 'Unauthorized', response.body\n refute downstream_called, 'downstream app called'\n end",
"title": ""
},
{
"docid": "a36226b649d30bfb18714eb619ca3beb",
"score": "0.5094912",
"text": "def test_example_4_bad_input\n begin\n Pricer::Calculator.run(price: 12_456.95, people: 0, material: :books)\n assert false\n rescue Pricer::Errors::BadInput\n assert true\n end\n end",
"title": ""
},
{
"docid": "aab6064d476b2920afbc391592a2c0d7",
"score": "0.50765204",
"text": "def fail(reason)\n end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.50722104",
"text": "def try; end",
"title": ""
},
{
"docid": "21d7b9cf7209fba7af0351d0fd7c9a22",
"score": "0.5067035",
"text": "def test_bad_creds_request\n bad_creds = JsonUtils.retrieve_config('UnitTesting/bad_config.json')\n assert_raise(BadRequestException) do\n @@requester.check_auth(\n bad_creds['email'],\n bad_creds['pass']\n )\n end\n end",
"title": ""
},
{
"docid": "7e956f8985610605ca1b6c5e7ae40037",
"score": "0.5054793",
"text": "def test_no_options\n assert_raise ExecutionException do\n exe( \"bin/ffrog\" )\n end\n end",
"title": ""
},
{
"docid": "4b850ea43c58d687b0f68dff4a2477ac",
"score": "0.50484717",
"text": "def test_check_for_incorrect\n card = Card.new(\"Which planet is closest to the sun?\", \"Mercury\")\n guess = Guess.new(\"Saturn\", card)\n refute guess.correct?\n end",
"title": ""
},
{
"docid": "f9c10ae1e3006784c620d4bbb8bd3aec",
"score": "0.5048302",
"text": "def runtime_fail(msg, *p)\n fail Lorj::PrcError.new, format(msg, *p)\n end",
"title": ""
},
{
"docid": "a32e73a75ea25a61b709ac3eb4d9146f",
"score": "0.50329274",
"text": "def defuse\r\n begin # the following code may fail with an exception\r\n puts risky # Try to invoke print the return value\r\n rescue RuntimeError => e\r\n # if we get an exception\r\n p e.message # print the error message instead\r\n end\r\nend",
"title": ""
},
{
"docid": "9df88620c3c190d0ae36b2807aa71cca",
"score": "0.5032592",
"text": "def test_errors\n [Errno::ECONNREFUSED,\n Errno::ECONNRESET,\n Errno::EHOSTUNREACH,\n OpenSSL::SSL::SSLError,\n SocketError,\n Timeout::Error,].each do |error|\n url = \"http://raise_#{error.to_s.gsub(/:+/, '_').downcase}\"\n stub_request(:any, url).to_raise(error)\n r1, r2 = (1..2).map { @faraday.get(url) }\n assert_equal HTTPDisk::ERROR_STATUS, r1.status\n assert_requested(:get, url, times: 1)\n assert_responses_equal r1, r2\n end\n end",
"title": ""
},
{
"docid": "998bb423228c0ec847c5060917748b9c",
"score": "0.50268924",
"text": "def test_input_invalid \n\t\tassert_raises \"rand is invalid\" do \n\t\t\ttest = Run.new(\"Foo\", 42)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "187c5c3cc14790b076b20ce2e30422a3",
"score": "0.5026022",
"text": "def calling_cry\n cry\n end",
"title": ""
},
{
"docid": "a6f9002754847f87a16148ab838ad4bc",
"score": "0.50199765",
"text": "def returning; raise \"Not Yet Implemented\"; end",
"title": ""
}
] |
5768858cb1aefbf632b2b9b2ee3ffed5
|
Puma doesn't use singletons (which is good) but this means we need to pass through whether the puma server is running in single mode or cluster mode
|
[
{
"docid": "0481fe4559b5af9fa9765448cdf6a699",
"score": "0.0",
"text": "def set_puma_options(options)\n @puma_options = options\n end",
"title": ""
}
] |
[
{
"docid": "db2bd1dc7d1a5023e02c51ec3ba9bb39",
"score": "0.6942442",
"text": "def puma_server?\n $PROGRAM_NAME.include?('puma') && Puma.const_defined?('Server')\n end",
"title": ""
},
{
"docid": "5c84f6616992126c76cb124fa75cad48",
"score": "0.6792057",
"text": "def server\n @server ||= Thread.list.map { |t| t[Puma::Server::ThreadLocalKey] }.compact.first\n end",
"title": ""
},
{
"docid": "e9a2e538f2f3e979503bd3d958207607",
"score": "0.6323454",
"text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend",
"title": ""
},
{
"docid": "0897a3afd5a0133e6b6c950b740cdab4",
"score": "0.62029177",
"text": "def single_rs_member?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.replica_set_name\nend",
"title": ""
},
{
"docid": "fad6ffda914a7d18c9f4c3883f4db29d",
"score": "0.6153546",
"text": "def puma_is_running?\n remote_process_exists?(puma_pid)\n end",
"title": ""
},
{
"docid": "3540f87f6ddb4d5a30862608b2a71c5c",
"score": "0.60630554",
"text": "def application?\n puma? || sidekiq?\n end",
"title": ""
},
{
"docid": "8a736cf5057a7221b5e16a162cce0f21",
"score": "0.60603464",
"text": "def clustered?\n (@launcher.options[:workers] || 0) > 0\n end",
"title": ""
},
{
"docid": "2c149530adbec3fe1c033b7de435e836",
"score": "0.59582394",
"text": "def puma_workers\n Integer(ENV.fetch('WEB_CONCURRENCY', 2))\n end",
"title": ""
},
{
"docid": "37bfde58c6852ac2410d5e7eeac66780",
"score": "0.58988583",
"text": "def start\n synchronize do\n unless running?\n # Puma >= 6.0 interprets these settings from options\n options = {\n min_threads: @config.min_threads,\n max_threads: @config.max_threads,\n environment: @config.show_error_details? ? \"development\" : \"production\"\n }\n # Puma::Events.stdio for Puma < 6.0; otherwise nil for Puma >= 6.0\n events = ::Puma::Events.stdio if ::Puma::Events.respond_to? :stdio\n @server = ::Puma::Server.new @app, events, options\n if @server.respond_to? :min_threads=\n # Puma < 6.0 sets server attributes for these settings\n @server.min_threads = @config.min_threads\n @server.max_threads = @config.max_threads\n @server.leak_stack_on_error = @config.show_error_details?\n end\n @server.binder.add_tcp_listener @config.bind_addr, @config.port\n @config.logger.info \"FunctionsFramework: Serving function #{@function.name.inspect} \" \\\n \"on port #{@config.port}...\"\n @server.run true\n end\n end\n self\n end",
"title": ""
},
{
"docid": "d39f9f9b35feaf18b7b775c178bb9dcd",
"score": "0.58717537",
"text": "def start_puma\n %Q%\n if [ -e \"#{puma_pid}\" ]; then\n if #{try_puma_user} kill -0 `cat #{puma_pid}` > /dev/null 2>&1; then\n echo \"-----> Puma is already running!\";\n exit 0;\n fi;\n\n #{try_puma_user} rm #{puma_pid};\n fi;\n\n echo \"-----> Starting Puma...\";\n cd #{deploy_to}/#{current_path} && #{try_puma_user} #{puma_cmd} -d -C #{puma_config};\n %\n end",
"title": ""
},
{
"docid": "c100902acd068ff5c6299c9ad28a8b02",
"score": "0.58571386",
"text": "def puma_dedicated_metrics_server?\n Settings.monitoring.web_exporter.enabled\nend",
"title": ""
},
{
"docid": "53443ae9a9185fd2e2953c0e227aadfa",
"score": "0.5850645",
"text": "def old_puma_is_running?\n remote_process_exists?(old_puma_pid)\n end",
"title": ""
},
{
"docid": "962ca713ebf724cfb3b39a47dc5757e2",
"score": "0.58084065",
"text": "def puma_worker_id\n match = process_name.match(/cluster worker ([0-9]+):/)\n match ? match[1] : 'master'\n end",
"title": ""
},
{
"docid": "6ce2cbb1539010efef3c1c83db9e7603",
"score": "0.57835346",
"text": "def singleton?\n options[:singleton]\n end",
"title": ""
},
{
"docid": "ee462ba41e95a713109caf3724613859",
"score": "0.57507646",
"text": "def standalone?\n $mongo_client ||= initialize_scanned_client!\n $standalone ||= $mongo_client.cluster.servers.first.standalone?\nend",
"title": ""
},
{
"docid": "ee462ba41e95a713109caf3724613859",
"score": "0.57507646",
"text": "def standalone?\n $mongo_client ||= initialize_scanned_client!\n $standalone ||= $mongo_client.cluster.servers.first.standalone?\nend",
"title": ""
},
{
"docid": "777cd9558fc078b98eb02a3aa3223b45",
"score": "0.5727131",
"text": "def is_master_running?\n !list_of_running_instances.select {|a| a.name == \"master\"}.first.nil?\n end",
"title": ""
},
{
"docid": "7ace9d9362665cdbb1737f34ce44d760",
"score": "0.571306",
"text": "def default_instance_warmup\n data[:default_instance_warmup]\n end",
"title": ""
},
{
"docid": "23fd0fc26ad4c552243a419dc6d23f9a",
"score": "0.57036734",
"text": "def has_writable_server?(cluster); true; end",
"title": ""
},
{
"docid": "23fd0fc26ad4c552243a419dc6d23f9a",
"score": "0.57036734",
"text": "def has_writable_server?(cluster); true; end",
"title": ""
},
{
"docid": "1863cb7220566a8960b339c7ab785d71",
"score": "0.570338",
"text": "def puma_threads\n Integer(ENV.fetch('WEB_MAX_THREADS', 5))\n end",
"title": ""
},
{
"docid": "03b1960b3e420ed06806b793e327f15f",
"score": "0.56655216",
"text": "def restart_at_cluster #:nodoc:\n self.restart_at_setup # same logic\n end",
"title": ""
},
{
"docid": "e36822c7ce7337b025abb5bb5bf1632b",
"score": "0.5651744",
"text": "def cluster\n @cluster = true\n end",
"title": ""
},
{
"docid": "6bdd305ca35b39d4c8ed1dafb03bc44b",
"score": "0.5590338",
"text": "def daemon_mode\n @@daemon_mode ||= false\n end",
"title": ""
},
{
"docid": "7dd8a49fbbbdce112cfaceacb71befad",
"score": "0.5583787",
"text": "def singleton\n @actor_system.actor_of(\n JavaLib::ClusterSingletonManager.defaultProps(\n @props,@name,JavaLib::PoisonPill.get_instance,nil),'singleton')\n @actor_system.actor_of(\n JavaLib::ClusterSingletonProxy.defaultProps(\n \"user/singleton/#{@name}\", nil), @name);\n end",
"title": ""
},
{
"docid": "4f6cbb75885940095935681b6019be85",
"score": "0.5559439",
"text": "def start_server\n @host = \"localhost\"\n app = lambda { |env| [200, {}, [env['rack.url_scheme']]] }\n\n @log_writer = SSLLogWriterHelper.new STDOUT, STDERR\n @server = Puma::Server.new app, nil, {log_writer: @log_writer}\n @server.add_ssl_listener @host, 0, nil\n @http = Net::HTTP.new @host, @server.connected_ports[0]\n\n @http.use_ssl = true\n # Disabling verification since its self signed\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n # @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n @server.run\n end",
"title": ""
},
{
"docid": "69759963475448b184399575b19ad10b",
"score": "0.55587703",
"text": "def start_server\n @host = \"127.0.0.1\"\n\n app = lambda { |env| [200, {}, [env['rack.url_scheme']]] }\n\n ctx = Puma::MiniSSL::Context.new\n\n if Puma.jruby?\n ctx.keystore = File.expand_path \"../examples/puma/keystore.jks\", __dir__\n ctx.keystore_pass = 'jruby_puma'\n else\n ctx.key = File.expand_path \"../examples/puma/puma_keypair.pem\", __dir__\n ctx.cert = File.expand_path \"../examples/puma/cert_puma.pem\", __dir__\n end\n\n ctx.verify_mode = Puma::MiniSSL::VERIFY_NONE\n\n yield ctx if block_given?\n\n @log_writer = SSLLogWriterHelper.new STDOUT, STDERR\n @server = Puma::Server.new app, nil, {log_writer: @log_writer}\n @port = (@server.add_ssl_listener @host, 0, ctx).addr[1]\n @server.run\n\n @http = Net::HTTP.new @host, @port\n @http.use_ssl = true\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end",
"title": ""
},
{
"docid": "652812b7a54b40c2eba0582b7207cbc2",
"score": "0.55509305",
"text": "def old_puma_pid\n \"#{puma_pid}.oldbin\"\n end",
"title": ""
},
{
"docid": "a954e6dace2c69ae9aa5868bdef93f28",
"score": "0.55388546",
"text": "def single_rs_member?\n $mongo_client ||= initialize_scanned_client!\n $single_rs_member ||= (single_seed? &&\n $mongo_client.cluster.servers.first.replica_set_name)\nend",
"title": ""
},
{
"docid": "6f63111520e49ca4a7304ca34be43200",
"score": "0.5534129",
"text": "def enable_single_instance\n set_option \"aws:elasticbeanstalk:environment\", \"EnvironmentType\", \"SingleInstance\"\n end",
"title": ""
},
{
"docid": "3655b23530d336d2c1476150b5e387a4",
"score": "0.5519821",
"text": "def start_monit\n super(\"/var/run/lock/#{app['shortname']}/puma.pid\")\n end",
"title": ""
},
{
"docid": "2f7fcd6c557ce32dc3744ff4185a0895",
"score": "0.5517254",
"text": "def single_mongos?\n $mongo_client ||= initialize_scanned_client!\n $single_mongos ||= (single_seed? &&\n $mongo_client.cluster.servers.first.mongos?)\nend",
"title": ""
},
{
"docid": "d332e5ad9853c976f6b3d146c1742d5c",
"score": "0.5492461",
"text": "def spawned_server_instance\n if self.instance_variables.include?(:@_redis_spawnserver_instance)\n @_redis_spawnserver_instance\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "087ae17cf901eb99b76160a6a9ed665b",
"score": "0.5487138",
"text": "def start_worker_thread?\n !environment.forking? or environment.app_server == :thin\n end",
"title": ""
},
{
"docid": "191f185ce5db4383a3d958a319c26a36",
"score": "0.5477919",
"text": "def set_given_or_default_command\n ARGV.concat %w[puma] if ARGV.empty?\nend",
"title": ""
},
{
"docid": "9381d9a420c0ccd4d5c370b02298420e",
"score": "0.5453118",
"text": "def establish_concurrency\n Graphiti.config.concurrency = !::Rails.env.test? &&\n ::Rails.application.config.cache_classes\n end",
"title": ""
},
{
"docid": "dfee7a5cfeda522315bf43fae291ec8f",
"score": "0.5435214",
"text": "def on_is_standalone\n end",
"title": ""
},
{
"docid": "2becc9d994417ca5a581f5530428bc0b",
"score": "0.5397848",
"text": "def singleton_class?; end",
"title": ""
},
{
"docid": "2becc9d994417ca5a581f5530428bc0b",
"score": "0.5397848",
"text": "def singleton_class?; end",
"title": ""
},
{
"docid": "ddd8d757c0ac4b94364384de6f5105aa",
"score": "0.5357388",
"text": "def concurrency\n :shared\nend",
"title": ""
},
{
"docid": "7241b839dacf09c497be8276aa5c1b56",
"score": "0.533905",
"text": "def run_default_server(app, port)\n servers[:puma].call(app, port, server_host)\n end",
"title": ""
},
{
"docid": "f7758756866166cc989a558ab21e8131",
"score": "0.53361475",
"text": "def load_config\n # defaults from Puma::CLI\n options = {\n :min_threads => 0,\n :max_threads => 16,\n :quiet => false,\n :debug => false,\n :binds => [],\n :workers => 0,\n :daemon => false,\n :worker_boot => [],\n\n # custom defaults (differ from Puma)\n :redirect_append => true,\n :config_file => File.join(\"config\", \"deploy\", \"puma.conf.rb\")\n }\n\n config = Puma::Configuration.new(options)\n config.load\n\n if not config.app_configured? then\n error \"Rails app not configured!\"\n exit 1\n end\n\n config\n end",
"title": ""
},
{
"docid": "f7758756866166cc989a558ab21e8131",
"score": "0.53361475",
"text": "def load_config\n # defaults from Puma::CLI\n options = {\n :min_threads => 0,\n :max_threads => 16,\n :quiet => false,\n :debug => false,\n :binds => [],\n :workers => 0,\n :daemon => false,\n :worker_boot => [],\n\n # custom defaults (differ from Puma)\n :redirect_append => true,\n :config_file => File.join(\"config\", \"deploy\", \"puma.conf.rb\")\n }\n\n config = Puma::Configuration.new(options)\n config.load\n\n if not config.app_configured? then\n error \"Rails app not configured!\"\n exit 1\n end\n\n config\n end",
"title": ""
},
{
"docid": "02d2bf4f57f0e8e127998a058091d032",
"score": "0.53298885",
"text": "def singleton\n false\n end",
"title": ""
},
{
"docid": "3af4d251df2a50a0360dd9b3c0b136e4",
"score": "0.5305831",
"text": "def sharded?\n $mongo_client ||= initialize_scanned_client!\n $sharded ||= ($mongo_client.cluster.sharded? || single_mongos?)\nend",
"title": ""
},
{
"docid": "3af4d251df2a50a0360dd9b3c0b136e4",
"score": "0.5305831",
"text": "def sharded?\n $mongo_client ||= initialize_scanned_client!\n $sharded ||= ($mongo_client.cluster.sharded? || single_mongos?)\nend",
"title": ""
},
{
"docid": "f9eb3260d76782df0fb45a3891ef9398",
"score": "0.53033847",
"text": "def singleton?\n false\n end",
"title": ""
},
{
"docid": "f9eb3260d76782df0fb45a3891ef9398",
"score": "0.53033847",
"text": "def singleton?\n false\n end",
"title": ""
},
{
"docid": "0048e29e67bbf37b713273545329eac0",
"score": "0.52910143",
"text": "def fetch_cluster_def\n fetch_cluster_def_http || fetch_cluster_def_local\n end",
"title": ""
},
{
"docid": "df077ba97c1251133bab9f8024ace82d",
"score": "0.5287806",
"text": "def running_instances(n)\n return true if self.check_status && self.servers == n\n return false\n end",
"title": ""
},
{
"docid": "ad2c4337943455e8b27a70d27736457c",
"score": "0.5267616",
"text": "def server?\n config[:mode] == :server\n end",
"title": ""
},
{
"docid": "ad2c4337943455e8b27a70d27736457c",
"score": "0.5267616",
"text": "def server?\n config[:mode] == :server\n end",
"title": ""
},
{
"docid": "3b49b7460ed62772726f37a18e8f64c1",
"score": "0.5263346",
"text": "def find_instance_cluster_platform_kubernetes(environment: nil)\n Clusters::Instance.new.clusters.enabled.default_environment\n .first&.platform_kubernetes\n end",
"title": ""
},
{
"docid": "29cb5ec74e5812da399f14ff423876c2",
"score": "0.5260875",
"text": "def non_evented()\n\t\n\t# Hm, maybe not compatible with Unicorn?\n\tuse Rack::FiberPool\n\t\n\t# 1) Non event machine + Unicorn\n\t# Start the application\n\t#run Mds.new\nend",
"title": ""
},
{
"docid": "a3860511f4560931f84dc7532c454e34",
"score": "0.5260102",
"text": "def singleton_instance; end",
"title": ""
},
{
"docid": "52bd84f2080cbe064b3a25cc184f4b0d",
"score": "0.5256679",
"text": "def single_pool?\n self.pools.size == 1 ? true : false\n end",
"title": ""
},
{
"docid": "9b193ec1ce72da7c819d1dfd5e5c1a49",
"score": "0.52562845",
"text": "def singleton?\n false\n end",
"title": ""
},
{
"docid": "d9fe94c0621b843dc6514ce927a308a9",
"score": "0.5249377",
"text": "def initialize(seeds, monitoring, options = Options::Redacted.new)\n if seeds.nil?\n raise ArgumentError, 'Seeds cannot be nil'\n end\n\n options = options.dup\n if options[:monitoring_io] == false && !options.key?(:cleanup)\n options[:cleanup] = false\n end\n @options = options.freeze\n\n # @update_lock covers @servers, @connecting, @connected, @topology and\n # @sessions_supported. Generally instance variables that do not have a\n # designated for them lock should only be modified under the update lock.\n # Note that topology change is locked by @update_lock and not by\n # @sdam_flow_lock.\n @update_lock = Mutex.new\n @servers = []\n @monitoring = monitoring\n @event_listeners = Event::Listeners.new\n @app_metadata = Server::AppMetadata.new(@options.merge(purpose: :application))\n @monitor_app_metadata = Server::Monitor::AppMetadata.new(@options.merge(purpose: :monitor))\n @push_monitor_app_metadata = Server::Monitor::AppMetadata.new(@options.merge(purpose: :push_monitor))\n @cluster_time_lock = Mutex.new\n @cluster_time = nil\n @srv_monitor_lock = Mutex.new\n @srv_monitor = nil\n @server_selection_semaphore = Semaphore.new\n @topology = Topology.initial(self, monitoring, options)\n # State change lock is similar to the sdam flow lock, but is designed\n # to serialize state changes initated by consumers of Cluster\n # (e.g. application connecting or disconnecting the cluster), so that\n # e.g. an application calling disconnect-connect-disconnect rapidly\n # does not put the cluster into an inconsistent state.\n # Monitoring updates performed internally by the driver do not take\n # the state change lock.\n @state_change_lock = Mutex.new\n # @sdam_flow_lock covers just the sdam flow. Note it does not apply\n # to @topology replacements which are done under @update_lock.\n @sdam_flow_lock = Mutex.new\n Session::SessionPool.create(self)\n\n if seeds.empty? && load_balanced?\n raise ArgumentError, 'Load-balanced clusters with no seeds are prohibited'\n end\n\n # The opening topology is always unknown with no servers.\n # https://github.com/mongodb/specifications/pull/388\n opening_topology = Topology::Unknown.new(options, monitoring, self)\n\n publish_sdam_event(\n Monitoring::TOPOLOGY_OPENING,\n Monitoring::Event::TopologyOpening.new(opening_topology)\n )\n\n @seeds = seeds = seeds.uniq\n servers = seeds.map do |seed|\n # Server opening events must be sent after topology change events.\n # Therefore separate server addition, done here before topology change\n # event is published, from starting to monitor the server which is\n # done later.\n add(seed, monitor: false)\n end\n\n if seeds.size >= 1\n # Recreate the topology to get the current server list into it\n recreate_topology(topology, opening_topology)\n end\n\n if load_balanced?\n # We are required by the specifications to produce certain SDAM events\n # when in load-balanced topology.\n # These events don't make a lot of sense from the standpoint of the\n # driver's SDAM implementation, nor from the standpoint of the\n # driver's load balancer implementation.\n # They are just required boilerplate.\n #\n # Note that this call must be done above the monitoring_io check\n # because that short-circuits the rest of the constructor.\n fabricate_lb_sdam_events_and_set_server_type\n end\n\n if options[:monitoring_io] == false\n # Omit periodic executor construction, because without servers\n # no commands can be sent to the cluster and there shouldn't ever\n # be anything that needs to be cleaned up.\n #\n # Omit monitoring individual servers and the legacy single round of\n # of SDAM on the main thread, as it would race with tests that mock\n # SDAM responses.\n @connecting = @connected = false\n return\n end\n\n # Update instance variables prior to starting monitoring threads.\n @connecting = false\n @connected = true\n\n if options[:cleanup] != false\n @cursor_reaper = CursorReaper.new(self)\n @socket_reaper = SocketReaper.new(self)\n @periodic_executor = PeriodicExecutor.new([\n @cursor_reaper, @socket_reaper,\n ], options)\n\n @periodic_executor.run!\n end\n\n unless load_balanced?\n # Need to record start time prior to starting monitoring\n start_monotime = Utils.monotonic_time\n\n servers.each do |server|\n server.start_monitoring\n end\n\n if options[:scan] != false\n server_selection_timeout = options[:server_selection_timeout] || ServerSelector::SERVER_SELECTION_TIMEOUT\n # The server selection timeout can be very short especially in\n # tests, when the client waits for a synchronous scan before\n # starting server selection. Limiting the scan to server selection time\n # then aborts the scan before it can process even local servers.\n # Therefore, allow at least 3 seconds for the scan here.\n if server_selection_timeout < 3\n server_selection_timeout = 3\n end\n deadline = start_monotime + server_selection_timeout\n # Wait for the first scan of each server to complete, for\n # backwards compatibility.\n # If any servers are discovered during this SDAM round we are going to\n # wait for these servers to also be queried, and so on, up to the\n # server selection timeout or the 3 second minimum.\n loop do\n # Ensure we do not try to read the servers list while SDAM is running\n servers = @sdam_flow_lock.synchronize do\n servers_list.dup\n end\n if servers.all? { |server| server.last_scan_monotime && server.last_scan_monotime >= start_monotime }\n break\n end\n if (time_remaining = deadline - Utils.monotonic_time) <= 0\n break\n end\n log_debug(\"Waiting for up to #{'%.2f' % time_remaining} seconds for servers to be scanned: #{summary}\")\n # Since the semaphore may have been signaled between us checking\n # the servers list above and the wait call below, we should not\n # wait for the full remaining time - wait for up to 0.5 second, then\n # recheck the state.\n begin\n server_selection_semaphore.wait([time_remaining, 0.5].min)\n rescue ::Timeout::Error\n # nothing\n end\n end\n end\n\n start_stop_srv_monitor\n end\n end",
"title": ""
},
{
"docid": "3d6448e1d128e44fbd7bb636f5be7891",
"score": "0.5237504",
"text": "def karaf_started?\n on roles(:esb) do\n as \"smx-fuse\" do\n n = capture('netstat -ao | grep 8101 | wc -l')\n n.to_i > 0\n end\n end\nend",
"title": ""
},
{
"docid": "c5a9d97205a463885ae7106575f0d791",
"score": "0.5228728",
"text": "def slave?\n true\n end",
"title": ""
},
{
"docid": "fea08602b85592560e47b81570248c56",
"score": "0.5228243",
"text": "def restart_monit\n super(\"/var/run/lock/#{app['shortname']}/puma.pid\")\n end",
"title": ""
},
{
"docid": "a16e4c2cb695a6aa661fbd20937ddcef",
"score": "0.5220684",
"text": "def cluster\n session.cluster\n end",
"title": ""
},
{
"docid": "f72ff6454e0f83f6a589927118390ab9",
"score": "0.5214223",
"text": "def default_pool_size\n defined?(Rails) ? 5 : 1\n end",
"title": ""
},
{
"docid": "161a132e7adb5e4e0092d7460d7dc0ae",
"score": "0.5189955",
"text": "def pool_config; end",
"title": ""
},
{
"docid": "d961de363f9f0d45ef960354488ed0aa",
"score": "0.5181588",
"text": "def persistent_hostname?\n false\n end",
"title": ""
},
{
"docid": "aaf2905c2fa69f5ddf09325dcd5fffa1",
"score": "0.5164746",
"text": "def server_defined?\n !!server\n end",
"title": ""
},
{
"docid": "f7bd6ae61e47299d62d2ecfc6a922172",
"score": "0.5161618",
"text": "def replica_set_member?\n ok? && !(standalone? || mongos?)\n end",
"title": ""
},
{
"docid": "c26f46048c5ee8e6d84101217bcd009e",
"score": "0.5156732",
"text": "def app_master\n if x = data['instances'].detect { |i| i['role'] == 'app_master' }\n x['public_hostname']\n else\n solo\n end\n end",
"title": ""
},
{
"docid": "e7352acadbfbb4ca26c44d21c514f0f2",
"score": "0.5154094",
"text": "def before_run\n logger.info 'Master starting'\n @redis = Antelopes::Redis.new(size: 5).connection\n end",
"title": ""
},
{
"docid": "9bb5559c33c273bcf2102fa553687651",
"score": "0.5133135",
"text": "def replica_set?; false; end",
"title": ""
},
{
"docid": "9bb5559c33c273bcf2102fa553687651",
"score": "0.5133135",
"text": "def replica_set?; false; end",
"title": ""
},
{
"docid": "5ed98bc73d222aab2ec320ed22073be7",
"score": "0.5131965",
"text": "def standalone_discovered\n @topology = topology.standalone_discovered\n end",
"title": ""
},
{
"docid": "edc66272b8c2b12ad99cf08bf3092a8d",
"score": "0.5130903",
"text": "def saas_configuration_driven_apicast_self_managed?\n apicast_configuration_driven && self_managed?\n end",
"title": ""
},
{
"docid": "d9290f929057be1da6ab2f2623b842bb",
"score": "0.5129164",
"text": "def singleton_instance\n @unique_instance\n end",
"title": ""
},
{
"docid": "1b2f4b875853855ecad3065f7a35b07c",
"score": "0.5126153",
"text": "def server\n raise Thor::Error, \"No config.ru file\" unless File.exist? \"config.ru\"\n\n gemfile = File.join(Dir.pwd, \"/Gemfile\")\n\n if options.key? :no_reload\n exec \"BUNDLE_GEMFILE=#{gemfile} bundle exec puma\"\n else\n exec \"BUNDLE_GEMFILE=#{gemfile} bundle exec rerun puma\"\n end\n end",
"title": ""
},
{
"docid": "0ba4dc8b3460677cd7359fe78e9c7db5",
"score": "0.5124948",
"text": "def instance\n @instance ||= begin\n _, _, instance = *I.parse_instance\n instance || if %w(test development).include?(environment)\n environment\n else\n raise(Missing, \"Cannot determine instance setting, INSTANCE env value is #{I.from_environment(\"INSTANCE\").inspect}\")\n end\n end\n end",
"title": ""
},
{
"docid": "94d39464afb65691067f2ec68ff232f4",
"score": "0.5121936",
"text": "def registered_in_mappy_server?\n is_main_sub_env? ? @client[:mainnet_statuses].include?(GlobalConstant::Client.mainnet_registered_in_mappy_server_status) :\n @client[:sandbox_statuses].include?(GlobalConstant::Client.sandbox_registered_in_mappy_server_status)\n end",
"title": ""
},
{
"docid": "56a484bd6489474a1794cb111c769bbd",
"score": "0.51213235",
"text": "def multi_threaded?\n application?\n end",
"title": ""
},
{
"docid": "d318cec7508556f22ed705421d9f20d8",
"score": "0.5121219",
"text": "def can_shutdown_an_instance?\n minimum_number_of_instances_are_running?\n end",
"title": ""
},
{
"docid": "2a9027552e0b7872891180133a3f519f",
"score": "0.5116403",
"text": "def prometheus_default_multiproc_dir\n return unless Rails.env.development? || Rails.env.test?\n\n if Sidekiq.server?\n Rails.root.join('tmp/prometheus_multiproc_dir/sidekiq')\n elsif defined?(Unicorn::Worker)\n Rails.root.join('tmp/prometheus_multiproc_dir/unicorn')\n elsif defined?(::Puma)\n Rails.root.join('tmp/prometheus_multiproc_dir/puma')\n else\n Rails.root.join('tmp/prometheus_multiproc_dir')\n end\nend",
"title": ""
},
{
"docid": "07f0ad26f8147d792c7d4124d70c1770",
"score": "0.51051486",
"text": "def env_log\n puts \"#{ENV['PUMA_BENCH_CMD']} #{ENV['PUMA_BENCH_ARGS']}\"\n puts @workers ?\n \"Server cluster mode -w#{@workers} -t#{@threads}, bind: #{@bind_type}\" :\n \"Server single mode -t#{@threads}, bind: #{@bind_type}\"\n\n branch = %x[git branch][/^\\* (.*)/, 1]\n if branch\n puts \"Puma repo branch #{branch.strip}\", RUBY_DESCRIPTION\n else\n const = File.read File.expand_path('../../lib/puma/const.rb', __dir__)\n puma_version = const[/^ +PUMA_VERSION[^'\"]+['\"]([^\\s'\"]+)/, 1]\n puts \"Puma version #{puma_version}\", RUBY_DESCRIPTION\n end\n end",
"title": ""
},
{
"docid": "ca54a6b1d7e1e92d2334119ba157f940",
"score": "0.51028275",
"text": "def slave?\n false\n end",
"title": ""
},
{
"docid": "586b1a70146406f2e186cb8d5f7c7641",
"score": "0.5093455",
"text": "def server\n instance\n end",
"title": ""
},
{
"docid": "71571abeb66232943e159d0c76bf1267",
"score": "0.5093124",
"text": "def instance\n Thread.current[:sauce_configuration] ||= Configuration.new\n end",
"title": ""
},
{
"docid": "adbcb4e547fa3d6581e1ee704e23671c",
"score": "0.5092395",
"text": "def server_running?\n # have to rely on nginx_port, which is a bit unstable,\n # because we're not setting up hostnames for each dat server,\n # so we can't just ping \"#{@server_name}.localhost:#{@http_port}\"\n begin\n response = Net::HTTP.get('localhost', '/', nginx_port)\n # make sure the response is actually info from a dat server\n return response.include? '\"datasets\":['\n rescue Errno::ECONNREFUSED\n return false\n end\n end",
"title": ""
},
{
"docid": "d20da8583df199dacaaf417c52a8622c",
"score": "0.50825584",
"text": "def server?\n !local?\n end",
"title": ""
},
{
"docid": "b45fe08265f0d5b986b9c38c0b51fcbc",
"score": "0.5073014",
"text": "def start_background_worker?\n !environment.forking? or environment.app_server == :thin\n end",
"title": ""
},
{
"docid": "11b2afc142459b373ab813d3b3ec7ff0",
"score": "0.5072111",
"text": "def daemonize?\n @daemonize\n end",
"title": ""
},
{
"docid": "129503cdaede843f4f4677913b164764",
"score": "0.507023",
"text": "def server_running?\n !! @server\n end",
"title": ""
},
{
"docid": "aa0fb5c69b243a96436574586be4a171",
"score": "0.50655097",
"text": "def single_threaded?\n @single_threaded\n end",
"title": ""
},
{
"docid": "69891375fa9af8ac2652430fbaef6068",
"score": "0.50617576",
"text": "def update_unknown_with_standalone\n if seeds.length == 1\n @topology = Topology::Single.new(\n topology.options, topology.monitoring, self)\n else\n log_warn(\n \"Removing server #{updated_desc.address.to_s} because it is a standalone and we have multiple seeds (#{seeds.length})\"\n )\n remove\n end\n end",
"title": ""
},
{
"docid": "13fc47895d24b43845451ab1a72cb611",
"score": "0.5056675",
"text": "def minimum_number_of_instances_are_running?\n list_of_running_instances.size > Application.minimum_instances\n end",
"title": ""
},
{
"docid": "7f1ffcd3a73e2cb74a8a54ae4ec9d4d5",
"score": "0.50507104",
"text": "def after_probe_master\n unless @running\n if collins_secondary_role == 'master'\n @master = false\n else\n pool = Jetpants.topology.pool(collins_pool)\n @master = pool.master if pool\n end\n end\n \n # We completely ignore cross-data-center master unless inter_dc_mode is enabled.\n # This may change in a future Jetpants release, once we support tiered replication more cleanly.\n if @master && @master.in_remote_datacenter? && !Jetpants::Plugin::JetCollins.inter_dc_mode?\n @remote_master = @master # keep track of it, in case we need to know later\n @master = false\n elsif !@master\n in_remote_datacenter? # just calling to cache for current node, before we probe its slaves, so that its slaves don't need to query Collins\n end\n end",
"title": ""
},
{
"docid": "618796b8b3f2e8feff25e39110e3da26",
"score": "0.5048065",
"text": "def master_process?\n @workers\n end",
"title": ""
},
{
"docid": "6c294eb6572771261c533aca68a5b6a3",
"score": "0.5044981",
"text": "def running?\n return false if server_thread.nil?\n return false unless server_thread.alive?\n\n res = Net::HTTP.start(localhost, port, open_timeout: 1, read_timeout: 1) do |http|\n http.get(Middleware::IDENTIFY_PATH)\n end\n\n res.is_a?(Net::HTTPOK) && res.body == app.object_id.to_s\n rescue Errno::ECONNREFUSED, Errno::EBADF, EOFError, Net::ReadTimeout, Net::OpenTimeout\n false\n end",
"title": ""
},
{
"docid": "766941b4a4f3e7049ca1c3ea699e4822",
"score": "0.5043599",
"text": "def my_server_is_primary?\n my_server.zone&.name == \"default\"\n end",
"title": ""
},
{
"docid": "e4e589e696766ace2a2bac579191e431",
"score": "0.5038015",
"text": "def replicas; end",
"title": ""
},
{
"docid": "4df50b841c98271e737ad0c731a5e771",
"score": "0.5037227",
"text": "def worker_initial_config\n\n end",
"title": ""
},
{
"docid": "37f782a9c1c03182219604b6b344bd2b",
"score": "0.50340384",
"text": "def rds\n Thread.current[:redis] ||= Redis.new host: 'localhost', port: 6379\n end",
"title": ""
},
{
"docid": "df7426635a530153b1b5c199940b7141",
"score": "0.50278735",
"text": "def running?\n [email protected]?\n end",
"title": ""
},
{
"docid": "3aec06207160f016897cfe6d12c00856",
"score": "0.50247616",
"text": "def running?\n str = `ps aux|grep thin`\n str =~ /thin\\s+server/i # Regexp\nend",
"title": ""
}
] |
8fb5536f27af5501f669666db4036965
|
alias :inspect :to_s two directives are equal if their string representations match
|
[
{
"docid": "576922537c09b997d1a60b0febfc7782",
"score": "0.0",
"text": "def ==(other)\n other = other.to_s unless other.is_a?(String)\n to_s == other\n end",
"title": ""
}
] |
[
{
"docid": "cc4d3b4ada29c46326afe3a7cc42c6d3",
"score": "0.6333914",
"text": "def define_inspect\n define_method(:inspect) do\n klass = self.class\n name = klass.name || klass.inspect\n attrs = klass.comparison_attrs\n \"#<#{name}#{attrs.map { |attr| \" #{attr}=#{send(attr).inspect}\" }.join}>\"\n end\n end",
"title": ""
},
{
"docid": "2b5b1380ed943fb469ff902f150482a2",
"score": "0.6130119",
"text": "def inspect\n out = \"#<#{self.class.name}\"\n self.class::Equalization::EQUALIZE_ON.each do |ivar_name|\n out << \" @#{ivar_name}=#{__send__(ivar_name).inspect}\"\n end\n out << \">\"\n end",
"title": ""
},
{
"docid": "829b84e4c2bddf888771fc8981708dd6",
"score": "0.6029052",
"text": "def should_to_s(newvalue)\n newvalue.inspect\n end",
"title": ""
},
{
"docid": "829b84e4c2bddf888771fc8981708dd6",
"score": "0.6029052",
"text": "def should_to_s(newvalue)\n newvalue.inspect\n end",
"title": ""
},
{
"docid": "867264ffc9503b6b7d1de07348c67fb7",
"score": "0.6024795",
"text": "def inspect\n str = to_s\n\n case str\n when /^(\\$|@@?)[a-z_][a-z_\\d]*$/i, # Variable names\n /^[a-z_][a-z_\\d]*[=?!]?$/i, # Method names\n /^\\$(-[a-z_\\d]|[+~:?<_\\/'\"$.,`!;\\\\=*>&@]|\\d+)$/i, # Special global variables\n /^([|^&\\/%~`!]|!=|!~|<<|>>|<=>|===?|=~|[<>]=?|[+-]@?|\\*\\*?|\\[\\]=?)$/ # Operators\n \":#{str}\"\n else\n \":#{str.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "f10e1b4c551ae1f729ba798efbea035a",
"score": "0.5987463",
"text": "def inspect(abbreviate = true)\n to_s(abbreviate)\n end",
"title": ""
},
{
"docid": "0e169cd0be75bb3f8d5a2e599e04d806",
"score": "0.5964766",
"text": "def to_s\n directive_strings = @directives.map do |name, value|\n case name\n when *BOOLEAN_DIRECTIVES.keys\n BOOLEAN_DIRECTIVES[name]\n when :max_age\n \"max-age=#{value.to_i}\"\n when :min_fresh\n \"min-fresh=#{value.to_i}\"\n when :s_maxage\n \"s-maxage=#{value.to_i}\"\n when :max_stale\n if value == true\n \"max-stale\"\n else\n \"max-stale=#{value.to_i}\"\n end\n when :private\n if value == true\n \"private\"\n else\n \"private=\\\"#{value.join(\", \")}\\\"\"\n end\n when :no_cache\n if value == true\n \"no-cache\"\n else\n \"no-cache=\\\"#{value.join(\", \")}\\\"\"\n end\n when :extension, :cache_extension, :extensions\n value.map do |name, value|\n if value.is_a? Symbol\n \"#{name}=#{value}\"\n else\n \"#{name}=\\\"#{value}\\\"\"\n end\n end.join(\", \")\n end\n end\n directive_strings.join(\", \")\n end",
"title": ""
},
{
"docid": "24e924041c77d0204eb7d29a08767081",
"score": "0.5916354",
"text": "def inspect\n respond_to?(:to_s) ? to_s : long_inspect\n end",
"title": ""
},
{
"docid": "5a72c881e0fe8deaac22b3e8187e30b1",
"score": "0.5889663",
"text": "def to_s\n d = @directive.to_s.gsub(/[\\r\\n]+/, ' ')\n v = ' ' + @data.to_s.gsub(/[\\r\\n]+/, ' ') unless @data.to_s.empty?\n \"\\#\\##{d}#{v}\\n\"\n end",
"title": ""
},
{
"docid": "344d1c08cfdc1f8939bc7be13f4f717d",
"score": "0.58895814",
"text": "def to_s\n val = @lhs.name + \" ==>\"\n @rhs.each { |s| val.concat(\" \" + s.name) }\n return val\n end",
"title": ""
},
{
"docid": "801d22ff0483bb5457b33eab7477a4eb",
"score": "0.588545",
"text": "def is_to_s(v)\n v.inspect\n end",
"title": ""
},
{
"docid": "801d22ff0483bb5457b33eab7477a4eb",
"score": "0.588545",
"text": "def is_to_s(v)\n v.inspect\n end",
"title": ""
},
{
"docid": "b03318f0f858b4c8528518fefeec94d6",
"score": "0.5877594",
"text": "def assert_equal_inspect_strs(exp, out)\n # remove EOL space\n out = out.gsub(/ *$/, '')\n exp = exp.gsub(/ *$/, '')\n\n # normalize BOL space\n exp.gsub!(%r'^#{INDENT}*') do |s|\n levels = s.length / INDENT.length\n C::Node::INSPECT_TAB*levels\n end\n\n # compare\n msg = \"Debug strings unequal:\\n#{juxtapose('Expected', exp, 'Output', out)}\"\n assert(out == exp, msg)\n end",
"title": ""
},
{
"docid": "c1a5d2e64113f950e4db3b096668c3c3",
"score": "0.5858149",
"text": "def inspect\n return '' unless full?\n return @value.inspect if empty_val?\n return @value.to_s if plain?\n return delim(@value.to_s) if has_useful_to_s?\n @value.inspect.gsub(/^Contracts::/, '')\n end",
"title": ""
},
{
"docid": "d7afc424d09b6b0cd22935628bc4cc7e",
"score": "0.58465934",
"text": "def inspect\n double_quotes = orig_inspect\n single_quotes = \"'#{gsub \"'\", \"\\\\\\\\'\"}'\"\n if double_quotes.length < single_quotes.length\n double_quotes\n else\n single_quotes\n end\n end",
"title": ""
},
{
"docid": "b17d2a4663beaa15f22da756f3ffa2cb",
"score": "0.58272624",
"text": "def should_to_s(value)\n value.inspect\n end",
"title": ""
},
{
"docid": "b17d2a4663beaa15f22da756f3ffa2cb",
"score": "0.58272624",
"text": "def should_to_s(value)\n value.inspect\n end",
"title": ""
},
{
"docid": "b17d2a4663beaa15f22da756f3ffa2cb",
"score": "0.58272624",
"text": "def should_to_s(value)\n value.inspect\n end",
"title": ""
},
{
"docid": "e3e020e18018e7ec9c09160a827cfdce",
"score": "0.5815284",
"text": "def match_to_s(obj1, obj2); end",
"title": ""
},
{
"docid": "9924f4fa12542b0f3ec0c4794a940c5e",
"score": "0.57974595",
"text": "def inspect_details\n\t\tparts = []\n\t\tparts << self.one_of_description\n\t\tparts << self.all_of_description\n\t\tparts << self.none_of_description\n\t\tparts.compact!\n\n\t\tstr = \"matching entities\"\n\t\tif parts.empty?\n\t\t\tstr << \" with any components\"\n\t\telse\n\t\t\tstr << parts.join( ', ' )\n\t\tend\n\n\t\treturn str\n\tend",
"title": ""
},
{
"docid": "68fb3ab8f11d7083dae278e279ffd830",
"score": "0.57727885",
"text": "def to_str\n inspect\n end",
"title": ""
},
{
"docid": "401f358ebe286a567ef44fa6a98ed9b0",
"score": "0.57611763",
"text": "def inspect\n toString\n end",
"title": ""
},
{
"docid": "0f903a260dcb5a8cd2e04d4c985ece8b",
"score": "0.5760089",
"text": "def ==(other)\n to_s == other.to_segment_info(self.class).to_s\n end",
"title": ""
},
{
"docid": "231ebc1a17745edf01521f8cd2371203",
"score": "0.5740105",
"text": "def inspect\r\n to_s \r\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.573671",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.573671",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.573671",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "e3f6cc1661eb46309321a3779b337d08",
"score": "0.5730785",
"text": "def inspect\n\t\tto_s\n\tend",
"title": ""
},
{
"docid": "d28ef509d663663e8a07f43c2d14a434",
"score": "0.57190144",
"text": "def to_s\n \"#{self.nonsense.to_s} #{self.and.inspect} #{self.stuff.inspect}\"\n end",
"title": ""
},
{
"docid": "41d25ab77066b1e00a8ccabd990b5e80",
"score": "0.5710683",
"text": "def inspect\n redacted_string(:inspect)\n end",
"title": ""
},
{
"docid": "0d5d396b91b8658b20822cf3ffceae93",
"score": "0.56985456",
"text": "def to_s\n \"#{@diff1}\\n#{@diff2}\"\n end",
"title": ""
},
{
"docid": "69e7726f7af27d2d924f8216132899fa",
"score": "0.56865937",
"text": "def inspect_compact ; inspect ; end",
"title": ""
},
{
"docid": "b32af0239121b324caca78e1f907cadc",
"score": "0.5667376",
"text": "def to_s\n Semantic.assert_exists(*variables)\n return \"#{Indentation.get}#{@string};\" if @inline\n @string\n end",
"title": ""
},
{
"docid": "1a589177dcc06ee743d16d92e5b263e0",
"score": "0.56563",
"text": "def to_s\n inspect.to_s\n end",
"title": ""
},
{
"docid": "1a589177dcc06ee743d16d92e5b263e0",
"score": "0.56563",
"text": "def to_s\n inspect.to_s\n end",
"title": ""
},
{
"docid": "ac37d0a6f60bde6eb03792fe18f73e02",
"score": "0.56486696",
"text": "def inspect\n\tto_s\n end",
"title": ""
},
{
"docid": "17316a4f09495c837dbda7bf4ca44448",
"score": "0.56466067",
"text": "def inspect\n to_s.delete_suffix('>') + \" @rep=#{@rep}>\"\n end",
"title": ""
},
{
"docid": "043fdbcef6ceedbab2097d9648a3ab7a",
"score": "0.5643503",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.5624456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a68aaa23ea28823afa4442863a9b16e0",
"score": "0.5619293",
"text": "def sinspect\n kind_of?(Numeric) ? inspect : \"#<#{__desc__}>\"\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.5617493",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.5617493",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.5617493",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "7292ab116b5cd6d3530cdb41350f2d38",
"score": "0.5607811",
"text": "def _inspect(indent=\"\")\n em = extension_modules\n interesting_methods = methods-[em.last ? em.last.methods : nil]-self.class.instance_methods\n im = interesting_methods.size > 0 ? \" (#{interesting_methods.join(\",\")})\" : \"\"\n tv = text_value\n tv = \"...#{tv[-20..-1]}\" if tv.size > 20\n\n indent +\n self.class.to_s.sub(/.*:/,'') +\n em.map{|m| \"+\"+m.to_s.sub(/.*:/,'')}*\"\" +\n \" offset=#{interval.first}\" +\n \", #{tv.inspect}\" +\n im +\n (elements && elements.size > 0 ?\n \":\" +\n (elements.select { |e| !e.is_a?(LogStash::Config::AST::Whitespace) && e.elements && e.elements.size > 0 }||[]).map{|e|\n begin\n \"\\n\"+e.inspect(indent+\" \")\n rescue # Defend against inspect not taking a parameter\n \"\\n\"+indent+\" \"+e.inspect\n end\n }.join(\"\") :\n \"\"\n )\n end",
"title": ""
},
{
"docid": "2a32bef5a20f7253467c844272738fa0",
"score": "0.5605152",
"text": "def to_s\n #This might seem a little obscure, but this will find and print the attributes with get methods defined,\n #not having prior knowledge of what those attributes are.\n s = ''\n self.instance_variables.each do |v| #look at each of the instance variables\n if self.class.method_defined?(v_sym = v[1..-1].to_sym) #see if there is a method defined for this symbol (strip the :)\n s += \"#{v} = \" + pv_byname(v_sym).to_s + \"\\n\" #print it\n end\n end\n s\n end",
"title": ""
},
{
"docid": "2cebded833be9e89c8352ca76388ab64",
"score": "0.56033933",
"text": "def should_to_s(v)\n puts 'should'\n v.inspect\n end",
"title": ""
},
{
"docid": "7ad40078bf3b91530c7769cb365b2bc7",
"score": "0.5602587",
"text": "def inspect\n str = Inspect.dashed_line(self.class, 1)\n self.class.class_eval { @attributes }.each do |attr|\n str << Inspect.inspect_asn1_attribute(attr, self[attr], 1)\n end\n str\n end",
"title": ""
},
{
"docid": "72a8ccaa948a41e0ed207df6576c35ea",
"score": "0.5594325",
"text": "def inspect\n if taint_relevant?\n match_array = String.match_taints(self,taint)\n new_matched_array = Array.new\n match_array.each do |pair|\n new_pair = pair.clone\n new_pair[0] = new_pair[0].old_inspect\n new_pair[0] = new_pair[0][1..new_pair[0].length-2] #get rid of inter-chunk quotes\n new_matched_array << new_pair\n end\n return ('\"' + String.generate(new_matched_array) + '\"')\n else\n old_inspect\n end\n end",
"title": ""
},
{
"docid": "db9048918ad0218c684b39961980141c",
"score": "0.5575676",
"text": "def to_s\n booleans = []\n values = []\n\n @directives.each do |key, value|\n if value == true\n booleans << key\n elsif value\n values << \"#{key}=#{value}\"\n end\n end\n\n (booleans.sort + values.sort).join(', ')\n end",
"title": ""
},
{
"docid": "12f7299aa4bad5aed2ed64d7212ab518",
"score": "0.5569053",
"text": "def to_string\n \"#{object_id} : #{rhs.to_string}.\"\n end",
"title": ""
},
{
"docid": "0ec71b847c6aad2215e3616676bc3241",
"score": "0.55647796",
"text": "def to_s()\n\t\"String representation of the object is #{@Variable1} and #{@Variable2}\"\n\tend",
"title": ""
},
{
"docid": "36a96665d643c35bfcd5e0bc6c3ef38f",
"score": "0.5564435",
"text": "def inspect\n return \"\" unless full?\n return @value.inspect if empty_val?\n return @value.to_s if plain?\n return delim(@value.to_s) if useful_to_s?\n\n useful_inspect\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "7522494abddadaa13755eb0e4a00c1d5",
"score": "0.5554592",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "8e33a436a94ed78aa20968b6dda8e19c",
"score": "0.555403",
"text": "def single_eq(other)\n Sass::Script::String.new(\"#{self.to_s}=#{other.to_s}\")\n end",
"title": ""
},
{
"docid": "8e33a436a94ed78aa20968b6dda8e19c",
"score": "0.555403",
"text": "def single_eq(other)\n Sass::Script::String.new(\"#{self.to_s}=#{other.to_s}\")\n end",
"title": ""
},
{
"docid": "829c131310ead3500f29868fa808d48d",
"score": "0.55486065",
"text": "def inspect\n \"(#{value.inspect} #{cdr.inspect})\"\n end",
"title": ""
},
{
"docid": "d6c314c24ad7b3fb373665accd114ca0",
"score": "0.5544227",
"text": "def to_s\n constants = instance_eval self.class.to_s + \"::constants\"\n constants.each do |constant|\n const = self.class.to_s + \"::\" + constant.to_s\n if @attrs == instance_eval(const)\n return const\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.5534899",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.5534899",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.5534899",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.5534899",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "6968f71f244010333978cf338d297b96",
"score": "0.5532885",
"text": "def inspect_details\n [inspect_added, inspect_changed].compact.join(', ')\n end",
"title": ""
},
{
"docid": "92175452657e51c44591a1c7015b72fd",
"score": "0.55321884",
"text": "def inspect\n to_s!\n end",
"title": ""
},
{
"docid": "d4585808bfd351c4532eb9dba1010a54",
"score": "0.5528106",
"text": "def variable_inspect_string(target_binding, options = {})\n\t\t\tif options[:scopes]\n\t\t\t\tscopes = [options[:scopes]].flatten\n\t\t\tend\n\t\t\treturn [\"exception_details: Variable inspection unavailable (no binding captured)\"] if target_binding.nil?\n\t\t\tvariable_scopes = scopes || SCOPES\n\t\t\tdump_arrays = []\n\t\t\tvariable_scopes.each do |variable_scope|\n\t\t\t\tvariable_string_array = dump_variables(target_binding, variable_scope.to_s)\n\t\t\t\tdump_arrays << variable_string_array if variable_string_array.length > 0\n\t\t\tend\n\t\t\tdump_arrays.join(\"\\n\")\n\t\tend",
"title": ""
},
{
"docid": "16c8eaf609f3d7c9fffbc8d7e0901af0",
"score": "0.5519273",
"text": "def to_s\n plural = false\n tmp_vals = @@ord_aspects.map do |type| \n val = self.send type\n if type == :number\n plural = ( @@abbrev[val].to_i > 1 )\n @@abbrev[val]\n else\n val.to_s\n end\n end\n (tmp_vals.join ' ') + ('s' if plural).to_s\nend",
"title": ""
},
{
"docid": "5b43c33c896bd4389009b56fc8301bb4",
"score": "0.5518778",
"text": "def inspect\n return to_s\n end",
"title": ""
},
{
"docid": "9f38011c56a5b40794afc64cdf340211",
"score": "0.55025023",
"text": "def inspect\n str = ''\n @variables.each_value do |value|\n str << \"\\t#{value}\\n\"\n str << value.inspect\n end\n # Return the string.\n str\n end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "63d4c77735fc4e7b27a3acf5b5c7460b",
"score": "0.54988176",
"text": "def readable_inspect; end",
"title": ""
},
{
"docid": "16a29c9ab78144d99ca8f1dfdd500bb9",
"score": "0.548949",
"text": "def dump_directives\n content = \"\"\n content << \"$ORIGIN #{origin}\\n\" unless origin.to_s.empty?\n content << \"$TTL #{ttl}\\n\" unless ttl.to_s.empty?\n content\n end",
"title": ""
},
{
"docid": "619cf499b12c5079f8f9bde1c5727954",
"score": "0.54776835",
"text": "def inspect\n '\"\"'\n end",
"title": ""
},
{
"docid": "7afff1fe29a723559f396d1a76e5de97",
"score": "0.5469886",
"text": "def to_s\n \"#@a/#@b\"\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.54630566",
"text": "def inspect\n to_s\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "d23a5ff6261fd3b337d631e8c4a68818",
"score": "0.0",
"text": "def task_params\n params.require(:task).permit(:name, :description, :start_date, :end_date, :completed_at, :completed)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74968386",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958337",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69237196",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6895035",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6787112",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6745602",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6683643",
"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.6638232",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6630457",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6628529",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65637696",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.64917076",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6479415",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6455687",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6400469",
"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.63837224",
"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.6364913",
"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.6341023",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336676",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.632594",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63209516",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63157374",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63150436",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6307892",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6302733",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6300768",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.62979907",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6293644",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6293644",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62795895",
"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.6274884",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.626915",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256255",
"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.6255966",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62533283",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.62366754",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62303895",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6229292",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6228921",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62272227",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6202016",
"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.6192254",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61834604",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179201",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61642444",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.61629325",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6156991",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61561215",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.613715",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61347073",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6120685",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61168665",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61168665",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6115135",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61118466",
"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.6104071",
"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.6104071",
"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.60990196",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60990196",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6087115",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6086125",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60847986",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6079096",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60765314",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60691494",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6068547",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.60680497",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60678715",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6065353",
"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.6063699",
"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.6062299",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.6058447",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60495216",
"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.60495216",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6049383",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6047766",
"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.6042084",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6036135",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.603078",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6026199",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60226476",
"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.602105",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6018039",
"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.6016154",
"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.60098565",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60080767",
"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.60080767",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.60066646",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.6004359",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6003022",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60029835",
"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.600259",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.600259",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.6000775",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59989756",
"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.59989756",
"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.59950405",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5995033",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5994783",
"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": "6af3741c8644ee63d155db59be10a774",
"score": "0.5992111",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.5991984",
"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": ""
}
] |
2d7e7c34e4d5e3d6090a436e0a846c04
|
Get Invoice Email Templates
|
[
{
"docid": "f8a5d11684968b37c40352b730772c82",
"score": "0.6857376",
"text": "def finance_invoice_email_templates_get(opts = {})\n data, _status_code, _headers = finance_invoice_email_templates_get_with_http_info(opts)\n return data\n end",
"title": ""
}
] |
[
{
"docid": "4dd1b854963123b58e4f579d4c079fc0",
"score": "0.78701353",
"text": "def retrieve_email_templates()\n start.uri('/api/email/template')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "bbf5e1d03d93e331b782ac3429a90c95",
"score": "0.78583574",
"text": "def retrieve_email_templates()\n start.uri('/api/email/template')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "ac6cf6b5e3f23b2baf054521223c72f0",
"score": "0.77342075",
"text": "def email_templates\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # Get all Email Templates For the App\n @templates = EmailTemplate.where(app_id: @app.id, is_archived: 0)\n\n end",
"title": ""
},
{
"docid": "7a00b5d72b51116c306642b3bb9284dd",
"score": "0.7357284",
"text": "def get_email_templates\n url = ApiRequest.base_path(\"questionpro.survey.getEmailTemplates\")\n result = self.class.get(url, body: self.options)\n\n self.full_response = result\n self.status = result['status']\n \n email_templates = []\n result_email_templates = result['response']['emailTemplates']\n result_email_templates.each do |email_template|\n email_templates.push(EmailTemplate.new(email_template))\n end\n \n return email_templates\n end",
"title": ""
},
{
"docid": "0b91a09d13343bcca46fa87f71852837",
"score": "0.6900848",
"text": "def get_all_email_templates\n templates = []\n next_token, templates = list_email_templates\n until next_token.nil?\n next_token, templates_set = list_email_templates(next_token)\n templates += templates_set\n end\n\n templates\n end",
"title": ""
},
{
"docid": "147404f7e0672c5566732b66a85394b0",
"score": "0.6868426",
"text": "def templates\n call(\"campaignTemplates\")\n end",
"title": ""
},
{
"docid": "ef2215905aa78eb81fd119c7e740d9d2",
"score": "0.68564576",
"text": "def grouped_mail_templates\n client.mail_templates + user.mail_templates\n end",
"title": ""
},
{
"docid": "d8f9603f3192ab2c486d5e628986f461",
"score": "0.6671952",
"text": "def get_email_template\n url = ApiRequest.base_path(\"questionpro.survey.getEmailTemplate\")\n result = self.class.get(url, body: self.options)\n\n self.full_response = result\n self.status = result['status']\n \n email_template = EmailTemplate.new(result['response']['emailTemplate'])\n \n return email_template\n end",
"title": ""
},
{
"docid": "5f2ea2775608c5dcb5c56faeb4cef1a4",
"score": "0.66481644",
"text": "def email_template(email_template,tenant_id)\n email = Email.find_by_email_type_and_tenant_id(email_template,tenant_id)\n #If tenant has not set his custom email template then load default lionsher's email templates\n if email.nil? or email.blank?\n email = Email.find_by_email_type(email_template,:conditions => \"tenant_id IS NULL\")\n end\n return email\n end",
"title": ""
},
{
"docid": "8b4958646f02219cdb6737bfa6e4c314",
"score": "0.6611158",
"text": "def retrieve_message_templates()\n start.uri('/api/message/template')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "f683624be3c7a06fff261027756d30dd",
"score": "0.66079456",
"text": "def get_template_items\n template_regex = /\\{{\\K[^\\s}]+(?=}})/\n subject =\n 'Subscription Preferences for {{contact.firstName}} {{contact.lastName}}'\n html_part =\n \"<!doctype html><html><head><meta charset='utf-8'></head><body><h1>Your Preferences</h1> <p>You have indicated that you are interested in receiving information about the following subjects:</p> <ul> {{#each subscription}} <li>{{interest}}</li> {{/each}} </ul> <p>You can change these settings at any time by visiting the <a href=https://www.example.com/preferences/i.aspx?id={{meta.userId}}> Preference Center</a>.</p></body></html>\"\n text_part =\n \"Your Preferences\\n\\nYou have indicated that you are interested in receiving information about the following subjects:\\n {{#each subscription}} - {{interest}}\\n {{/each}} \\nYou can change these settings at any time by visiting the Preference Center at https://www.example.com/prefererences/i.aspx?id={{meta.userId}}\"\n # to get first occurance\n # @subject_match = subject.match(template_regex)\n # to get all occurances\n @subject_match = subject.scan(template_regex)\n @html_part_match = html_part.scan(template_regex)\n @text_part_match = text_part.scan(template_regex)\n end",
"title": ""
},
{
"docid": "4f6c8cca587bfb938ec3d5889924d0f5",
"score": "0.65747344",
"text": "def templates\n @templates\n end",
"title": ""
},
{
"docid": "b9aaf3825be35795a971e6d6a53696ce",
"score": "0.6562919",
"text": "def templates\n fetch(:templates)\n end",
"title": ""
},
{
"docid": "3616fac7bb104f30fe03e233bea6d405",
"score": "0.65457404",
"text": "def index\n @email_templates = EmailTemplate.all\n end",
"title": ""
},
{
"docid": "5ffcd94b5fa17198f2f34a3b44f345bc",
"score": "0.654298",
"text": "def index\n @email_templates = current_user.admin? ? EmailTemplate.all : EmailTemplate.non_default\n end",
"title": ""
},
{
"docid": "502e048cee855a6cbfcc7d2e5bd804c3",
"score": "0.6486703",
"text": "def index\n @email_templates = current_scope.email_templates.all\n\n respond_with(@email_templates)\n end",
"title": ""
},
{
"docid": "31435e6bce7a1203a0e884063dd58ea2",
"score": "0.6438956",
"text": "def email_get_template(id)\n response = xmlrpc('APIEmailService.getEmailTemplate', id)\n end",
"title": ""
},
{
"docid": "7301e7b31b8d01f50ffd8520406f3ddd",
"score": "0.64218813",
"text": "def templates\n\t\t@message_templates = current_user.message_templates\n\tend",
"title": ""
},
{
"docid": "264fb2664c7e606394797a101dc76353",
"score": "0.64136535",
"text": "def get_templates_in_envelope(envelope_id)\n uri = build_uri(\"/accounts/#{acct_id}/envelopes/#{envelope_id}/templates\")\n\n http = initialize_net_http_ssl(uri)\n request = Net::HTTP::Get.new(uri.request_uri, headers({ 'Content-Type' => 'application/json' }))\n JSON.parse(http.request(request).body)\n end",
"title": ""
},
{
"docid": "497ff396dbfcb0010788697b6e2b3f15",
"score": "0.6401477",
"text": "def get_email_template\n return self.email_template || \n Template.find_by(email_default: true) || \n Template.first\n end",
"title": ""
},
{
"docid": "b86dacd98400d7fa4e62c816abe03933",
"score": "0.63998276",
"text": "def get_email_template\n return self.email_template ||\n Template.find_by(email_default: true) ||\n Template.first\n end",
"title": ""
},
{
"docid": "50620f73b27cb68ccd3144049254dd23",
"score": "0.6372845",
"text": "def template\n @_template ||= EmailTemplate.find(params[:etid])\n end",
"title": ""
},
{
"docid": "34b098c6b3b2c5dbf0edeac221bd8817",
"score": "0.6368445",
"text": "def templates\n @templates ||= filtered_templates(client.templates)\n end",
"title": ""
},
{
"docid": "899ca1ce84147f416889e8796d05f945",
"score": "0.63331336",
"text": "def templates\n return @templates\n end",
"title": ""
},
{
"docid": "899ca1ce84147f416889e8796d05f945",
"score": "0.63331336",
"text": "def templates\n return @templates\n end",
"title": ""
},
{
"docid": "a3d9f895564eac17e1c221bb7ab5ce65",
"score": "0.6245044",
"text": "def get_templates\n uri = build_uri(\"/accounts/#{acct_id}/templates\")\n\n http = initialize_net_http_ssl(uri)\n request = Net::HTTP::Get.new(uri.request_uri, headers({ 'Content-Type' => 'application/json' }))\n JSON.parse(http.request(request).body)\n end",
"title": ""
},
{
"docid": "d394fbbcea40aff7ce11a77942d632c5",
"score": "0.62374204",
"text": "def templates\n self[:templates]\n end",
"title": ""
},
{
"docid": "dcab7bff2789169d64df4971f0fd1869",
"score": "0.6231647",
"text": "def get_templates\n return @templates\n end",
"title": ""
},
{
"docid": "1cf8258a36b71142e4e286ab89f77f76",
"score": "0.6181512",
"text": "def template()\n HTTP.get(\"#{@urlAPI}/v2/domainTemplates/providers/#{@providerId}/services/#{@serviceId}\")\n end",
"title": ""
},
{
"docid": "b2797a289968364c82273cc18103335c",
"score": "0.61798173",
"text": "def email_template\n template = File.read('./lib/sprint_master/email_template.liquid')\n Liquid::Template.parse(template)\n end",
"title": ""
},
{
"docid": "156b216753e9e243e8b89b47b26fb0ef",
"score": "0.61785156",
"text": "def templates\n ConfigData.list_of_type 'templates'\n end",
"title": ""
},
{
"docid": "a5d610d6f2fc4f366595e56d91207e27",
"score": "0.61707574",
"text": "def index\n @automation_series_email_templates = AutomationSeriesEmailTemplate.all\n end",
"title": ""
},
{
"docid": "e57fce2994c0ef29908cac7c08938746",
"score": "0.6169601",
"text": "def search_email_templates(request)\n start.uri('/api/email/template/search')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "36be4e16505fe2c2fc96880f00aa91df",
"score": "0.6165685",
"text": "def get_template(company, slug, dev_preview = false)\n if dev_preview\n # if it's a preview, let's just grab any vendor's template\n email_template = Spree::EmailTemplate.find_by_slug(slug)\n else\n email_template = company.email_templates.find_by_slug(slug)\n\n # if email template wasn't previously set up but mailer is trying to send, let's create it\n if email_template.nil?\n email_template = company.find_or_create_email_template(self.class.name, slug)\n end\n end\n return email_template\n end",
"title": ""
},
{
"docid": "096bb6f9e9db977c2c02a07283839189",
"score": "0.6143556",
"text": "def templates\n @templates ||= []\n end",
"title": ""
},
{
"docid": "d6b9b0d466eced675b2293b330b1a1e0",
"score": "0.61434495",
"text": "def index\n @email_templates = EmailTemplate.all.order(updated_at: :desc).page(params[:page]).per(10)\n @et = if params[:et].present?\n EmailTemplate.find(params[:et].to_i)\n else\n EmailTemplate.find(Setting.find_by_key('email_template').value.to_i)\n end\n end",
"title": ""
},
{
"docid": "ab61d960f4febafa356a1c9ad5ff2cf5",
"score": "0.6139484",
"text": "def find_email_template(name)\n templates = get_all_email_templates\n template = new_template({})\n unless templates.empty?\n templates.each { |t| template = new_template(t) if t[:name] == name }\n end\n\n template\n end",
"title": ""
},
{
"docid": "4fab5bbb0450e48f8a3765b876937eee",
"score": "0.612693",
"text": "def notification_message_templates\n return @notification_message_templates\n end",
"title": ""
},
{
"docid": "601884bc5a8ab238c20296ac38042e2b",
"score": "0.61266136",
"text": "def get_templates\n ensure_client && ensure_uri\n self.class.find_with_pagination(@client, @data['uri'] + '/templates')\n end",
"title": ""
},
{
"docid": "5d41c59e75aff011d56f88b0bf8a8c4f",
"score": "0.6100235",
"text": "def all_templates\n TEMPLATES\n end",
"title": ""
},
{
"docid": "48701ef60467f04795b50ce370eb610d",
"score": "0.6099891",
"text": "def get_subject_template\n\t\tend",
"title": ""
},
{
"docid": "722560e6ff01b9e6ba7fa03a500748c4",
"score": "0.6089084",
"text": "def list_email_templates(token = nil)\n options = { next_token: token, page_size: 10 }\n tmpl_hash = {}\n templates = []\n next_token = nil\n begin\n template_list = ses_client_v2.list_email_templates(options)\n next_token = template_list.next_token\n index = 0\n while template_list.size.positive? &&\n index < template_list.templates_metadata.count\n resp =\n ses_client_v2.get_email_template(\n {\n template_name:\n template_list.templates_metadata[index].template_name\n }\n )\n tmpl_hash = {\n id: index,\n name: resp.template_name,\n subject: resp.template_content.subject,\n text_part: resp.template_content.text,\n html_part: resp.template_content.html\n }\n templates.push(tmpl_hash)\n index += 1\n end\n rescue Aws::SES::Errors::ServiceError, StandardError => e\n Rails.logger.error \" Unable to fetch templates. Error message: #{e.message}\"\n end\n\n [next_token, templates]\n end",
"title": ""
},
{
"docid": "85f36bca9ad55f608b7f64ddbb2e1efd",
"score": "0.60745627",
"text": "def retrieve_email_template(email_template_id)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "62353aeda6e315160cb74a629073f188",
"score": "0.6070307",
"text": "def templates\n @templates.merge\n end",
"title": ""
},
{
"docid": "704e47e4d2ace13983af13eee37a0521",
"score": "0.6052617",
"text": "def retrieve_email_template(email_template_id)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "2a4ae45ece83b4395a2af2fee69273bb",
"score": "0.60513866",
"text": "def template_paths\n paths = [\"#{ActivityNotification.config.mailer_templates_dir}/default\"]\n paths.unshift(\"#{ActivityNotification.config.mailer_templates_dir}/#{@target.to_resources_name}\") if @target.present?\n paths\n end",
"title": ""
},
{
"docid": "a262008edcfa1d1848bc76253d40cd0b",
"score": "0.6033092",
"text": "def load_template(name, surname, email, year, maker, model, phone_number)\n { personalizations: [\n {\n to: [email: '[email protected]'],\n dynamic_template_data: {\n first_n: name,\n last_n: surname,\n year: year,\n maker: maker,\n model: model,\n email: email,\n phone_number: phone_number\n }\n }\n ], from: { email: '[email protected]' },\n template_id: 'd-c56ac8c69ce64a00a740a1d9dc1872fc' }\n end",
"title": ""
},
{
"docid": "0ea60a340870c2b9007047b3602bdb36",
"score": "0.60317856",
"text": "def finance_invoice_email_templates_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InvoiceEmailTemplatesApi.finance_invoice_email_templates_get ...\"\n end\n # resource path\n local_var_path = \"/finance/invoiceEmailTemplates\"\n\n # query parameters\n query_params = {}\n query_params[:'conditions'] = opts[:'conditions'] if !opts[:'conditions'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'childconditions'] = opts[:'childconditions'] if !opts[:'childconditions'].nil?\n query_params[:'customfieldconditions'] = opts[:'customfieldconditions'] if !opts[:'customfieldconditions'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].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 = ['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 => 'Array<InvoiceEmailTemplate>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InvoiceEmailTemplatesApi#finance_invoice_email_templates_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a1446cf00699f16a56131ec7b40f9b11",
"score": "0.60292923",
"text": "def get_inline_signers(signers, sequence)\n signers_array = []\n signers.each do |signer|\n signers_hash = Hash[:email, signer[:email], :name, signer[:name], \\\n :recipientId, signer[:recipient_id], :roleName, signer[:role_name], \\\n :clientUserId, signer[:client_id] || signer[:email]]\n signers_array << signers_hash\n end\n template_hash = Hash[:sequence, sequence, :recipients, { signers: signers_array } ]\n [template_hash]\n end",
"title": ""
},
{
"docid": "c954f7e5699e5c86bdee320faeb13620",
"score": "0.6026255",
"text": "def templates\n @conn.templates\n end",
"title": ""
},
{
"docid": "8e2e838edd55c835cfac1a4807e7df34",
"score": "0.6019204",
"text": "def template\n @template = current_user.client.templates.where(is_email: true).last\n @template_sms = current_user.client.templates.where(is_email: false).last\n location_id = current_user.locations.ids rescue nil\n @reviews = GoogleReview.where(location_id: location_id).count rescue nil\n request_count_and_request_pending\n end",
"title": ""
},
{
"docid": "27d7eb2ef1edec24c32fb472fe8afcaf",
"score": "0.60088265",
"text": "def index\n @templates = Template.where([\"user_email = ?\", current_user.email])\n end",
"title": ""
},
{
"docid": "a2ce8ca516cd09a3bee0605cb514742a",
"score": "0.59804773",
"text": "def get_templates(extended = false)\n # get templates\n if extended\n doe = get_doe_templates(true)\n deer = get_deer_templates(true)\n else\n doe = get_doe_templates\n deer = get_deer_templates\n end\n\n # combine templates\n array = OpenStudio::StringVector.new\n temp_array = doe.to_a + deer.to_a\n temp_array.each do |i|\n array << i\n end\n\n return array\n end",
"title": ""
},
{
"docid": "131e603f4d57ef717b37759509361d8a",
"score": "0.5975782",
"text": "def templates\n configuration.templates\n end",
"title": ""
},
{
"docid": "9a613c9dcb6aad517aff38a1040b7cb5",
"score": "0.59695655",
"text": "def templates\n 'lib/templates/pico/'\n end",
"title": ""
},
{
"docid": "988e8d17eb0d9c74293c1a0f9966958b",
"score": "0.596209",
"text": "def template_path\n self.views_path.each do |path|\n template = Dir[File.join(path, self.class.name.underscore.split(\"/\").last, \"#{@mail_name}.*\")].first\n return template if template\n end\n end",
"title": ""
},
{
"docid": "f2cda6c36a05311c4915a171e91aea01",
"score": "0.59600663",
"text": "def index\n @mailtemplates = Mailtemplate.all\n end",
"title": ""
},
{
"docid": "88c544c265ccbafeced4b371a73363e4",
"score": "0.59456533",
"text": "def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "88c544c265ccbafeced4b371a73363e4",
"score": "0.59456533",
"text": "def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "ec2e32213d74357ee8f27ad8a9ef39c5",
"score": "0.59239644",
"text": "def available_templates\n ActiveSupport::OrderedHash[AVAILABLE_TEMPLATE_OPTIONS[receipt_printer_type].map { |id|\n {id=>RECEIPT_PRINTER_TEMPLATES[id]}\n }.inject(:merge).invert.sort]\n end",
"title": ""
},
{
"docid": "e5f0104d9569c8a289a388b69e46cf7e",
"score": "0.59073544",
"text": "def index\n @mail_templates = policy_scope(MailTemplate).order(:name).page(params[:page])\n end",
"title": ""
},
{
"docid": "d6a9b0822673c1e383689e161da6d00b",
"score": "0.5870835",
"text": "def editor_templates(type, uuid)\n http_get(uri: \"/editor/#{type}/templates/#{uuid}\", fields: x_cookie)\n end",
"title": ""
},
{
"docid": "cdfb820c65a143b616308c2fb9115119",
"score": "0.5868155",
"text": "def get_email_base_templates(storefront_oid, opts = {})\n data, _status_code, _headers = get_email_base_templates_with_http_info(storefront_oid, opts)\n data\n end",
"title": ""
},
{
"docid": "b465dba6444747f735d5fd5641f83f0c",
"score": "0.5857284",
"text": "def find_many(options = {})\n client.find_many(Spire::Production::Template, \"/production/templates/\", options)\n end",
"title": ""
},
{
"docid": "547bef8c75f8e70269505fc07207f86d",
"score": "0.58391625",
"text": "def list_templates\n %w(pin tag).each do |type|\n templates = configuration.send(\"#{ type }_templates\")\n messenger.section(\"AVAILABLE #{ type.upcase } TEMPLATES:\")\n if templates\n templates.each_with_index do |template, index|\n template_name, template = template.first\n puts \"#{ index + 1 }.\\tName: \".blue + \"#{ template_name }\"\n puts \"Opener:\".blue.rjust(22) + \"\\t#{ template[:opener] }\".truncate(80)\n puts \"Item:\".blue.rjust(22) + \"\\t#{ template[:item] }\".truncate(80)\n puts \"Closer:\".blue.rjust(22) + \"\\t#{ template[:closer] }\".truncate(80)\n end\n else\n messenger.warn('No templates defined...')\n end\n end\n end",
"title": ""
},
{
"docid": "5ec2278de71c6c1e1bb069c030ca9d4d",
"score": "0.5828354",
"text": "def get_policy_templates\n @command = :get_policy_templates\n if @web_command && @prev_args.peek(0) != \"templates\"\n not_found_error = \"(use of aliases not supported via REST; use '/policy/templates' not '/policy/#{@prev_args.peek(0)}')\"\n raise ProjectRazor::Error::Slice::NotFound, not_found_error\n end\n # We use the common method in Utility to fetch object templates by providing Namespace prefix\n # print_object_array get_child_templates(ProjectRazor::PolicyTemplate), \"\\nPolicy Templates:\"\n print_object_array @client.get_policy_templates\n end",
"title": ""
},
{
"docid": "8eae57281c5fa726e5a2f2b15c38852a",
"score": "0.58256984",
"text": "def customer_notification_booking_request_template\n\n file = File.expand_path(File.join(File.dirname(__FILE__), \"..\", \n \"templates\", \"customer_notification_booking_request_template.erb\"))\n\n File.read(file)\n\n end",
"title": ""
},
{
"docid": "58a39662f761029dc3e8def889054c82",
"score": "0.58226794",
"text": "def templates\n @jobs.values\n end",
"title": ""
},
{
"docid": "c54a45f185000fb34aca5e97fdfcbc1c",
"score": "0.58220243",
"text": "def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"title": ""
},
{
"docid": "bc05dfb97c2247ce6f068cc2981ae8df",
"score": "0.5821301",
"text": "def index\n @message_templates = @message_config.message_templates\n end",
"title": ""
},
{
"docid": "696ef50a226022b637d724d695f18171",
"score": "0.58120537",
"text": "def templates\n actions(:templates)\n end",
"title": ""
},
{
"docid": "12527040317e5f53f09018fb5f2ecf74",
"score": "0.58117056",
"text": "def api_email_get_template(id)\n Thread.current[:api_conn].api_perform('APIEmailService', 'getEmailTemplate', id)\n end",
"title": ""
},
{
"docid": "1c84da3f5caa46c705a9844ec1970294",
"score": "0.58115226",
"text": "def get_templates\n array = OpenStudio::StringVector.new\n array << 'DOE Ref Pre-1980'\n array << 'DOE Ref 1980-2004'\n array << '90.1-2004'\n array << '90.1-2007'\n # array << '189.1-2009' # if turn this on need to update space_type_array for RetailStripmall\n array << '90.1-2010'\n array << '90.1-2013'\n array << 'NREL ZNE Ready 2017'\n\n return array\n end",
"title": ""
},
{
"docid": "14b819fe24849432fb0006e48d5a4d37",
"score": "0.5806803",
"text": "def templates\n url = \"http://#{Delphix.server}/resources/json/delphix/database/template\"\n Delphix.get(url).body.result\n end",
"title": ""
},
{
"docid": "84b8f121494db025103fe86260174c80",
"score": "0.5788989",
"text": "def view_email_template\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # Get the current user\n @user = User.find(@app.user_id)\n\n # Get the EmailTemplate We want to View\n @template = EmailTemplate.find(params[:template_id])\n\n end",
"title": ""
},
{
"docid": "04d8a87ce86fec0f527c297484ce9a4f",
"score": "0.57872003",
"text": "def set_email_template\n @email_template = @company.email_templates.find(params[:id])\n end",
"title": ""
},
{
"docid": "c69874d2be37ca750e3ea6da3a7bc2fa",
"score": "0.57867414",
"text": "def index\n # @email_templates = current_user.email_templates\n @email_templates = EmailTemplate.where(\"user_id = ?\", current_user).paginate(page: params[:page], per_page: 5)\n @public_templates = EmailTemplate.where(\"is_private = ? AND user_id <> ?\", false, current_user).paginate(page: params[:page], per_page: 5)\n # @email_templates = EmailTemplate.paginate(page: params[:page], per_page: 5)\n end",
"title": ""
},
{
"docid": "64d8895f65a2a182b38e7990000777b0",
"score": "0.5782343",
"text": "def get_emails_hook_info(client_id, template, emails)\n emails_hook_info = {}\n return emails_hook_info if template.blank? || emails.blank?\n\n EmailServiceApiCallHook.where(client_id: client_id, email: emails, event_type: GlobalConstant::EmailServiceApiCallHook.send_transactional_mail_event_type).\n all.each do |h|\n next if h.params[:template_name] != template\n emails_hook_info[h.email] = true\n end\n\n emails_hook_info\n end",
"title": ""
},
{
"docid": "216feaabafaf7722ed0c8ffceec67dd3",
"score": "0.5776643",
"text": "def index\n @templates = Template.where(company_id: current_user.client_id)\n end",
"title": ""
},
{
"docid": "95d386656d41e2e611d270c4d7bcc6ac",
"score": "0.5771357",
"text": "def get_policy_templates\n # We use the common method in Utility to fetch object templates by providing Namespace prefix\n print_object_array get_child_templates(ProjectRazor::PolicyTemplate), \"\\nPolicy Templates:\"\n end",
"title": ""
},
{
"docid": "8392b183a7c0461622c2eecf21347b09",
"score": "0.5769786",
"text": "def index\n @prizzm_mail_templates = current_company.prizzm_mail_templates.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @prizzm_mail_templates }\n end\n end",
"title": ""
},
{
"docid": "64860395b1c136f29696356475ef0cdc",
"score": "0.5765428",
"text": "def get_vapp_templates(name)\n get_nodes(\"ResourceEntity\",\n {\"type\"=>MEDIA_TYPE[:VAPP_TEMPLATE], \"name\"=>name})\n end",
"title": ""
},
{
"docid": "9d09386585101e4dc6510eb3669bf6de",
"score": "0.5760973",
"text": "def customer_notification_booking_request_template\n\n file = File.expand_path(File.join(File.dirname(__FILE__), \"..\",\"..\", \"..\", \"..\", \n \"templates\", \"customer_notification_request_template.erb\"))\n\n File.read(file)\n\n end",
"title": ""
},
{
"docid": "91adc1d70c4a87878cad2492416375a5",
"score": "0.5760735",
"text": "def templates\n @templates = Ingredient.select {|i| i.application_root? && i.is_template}\n\n respond_to do |format|\n format.html\n format.json {render json: @templates}\n end\n end",
"title": ""
},
{
"docid": "9e264ec500acad1002581ef1b56043b9",
"score": "0.5760546",
"text": "def show_templates\n @@TEMPLATE_SET.keys\n end",
"title": ""
},
{
"docid": "c790914295181a62dd85a2f446fc76ca",
"score": "0.57556474",
"text": "def get_templates()\n array = OpenStudio::StringVector.new\n array << 'DOE Ref Pre-1980'\n array << 'DOE Ref 1980-2004'\n array << '90.1-2004'\n array << '90.1-2007'\n # array << '189.1-2009' # if turn this on need to update space_type_array for stripmall\n array << '90.1-2010'\n array << '90.1-2013'\n\n return array\n end",
"title": ""
},
{
"docid": "82e3d73174131ea9ef2cba9ae759b603",
"score": "0.5751076",
"text": "def templates()\n return MicrosoftGraph::Identity::ConditionalAccess::Templates::TemplatesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "bfd5d61b453490039111322b0dfed8bc",
"score": "0.57480294",
"text": "def get_templates(limit = 100, offset = 0)\n params = { limit: limit, offset: offset }\n\n request :get,\n '/v3/templates.json',\n params\n end",
"title": ""
},
{
"docid": "242a47686a0287c9bf0c69e1dcd868ee",
"score": "0.57377857",
"text": "def template_provisioners\n select_messages('template-provisioner').map { |fields| Packer::Message::TemplateProvisioner.from_fields(fields) }\n end",
"title": ""
},
{
"docid": "5c906bae46f712886d5dc6638aa8bf38",
"score": "0.57329756",
"text": "def find_email_template_by_filename(filename)\n template = nil\n if @publisher\n template ||= template_root[\"themes/#{@publisher.label}/#{mailer_name}/#{filename}\"]\n template ||= template_root[\"themes/#{@publisher.publishing_group.label}/#{mailer_name}/#{filename}\"] if @publisher.publishing_group\n end\n template ||= template_root[\"#{mailer_name}/#{filename}\"]\n template\n end",
"title": ""
},
{
"docid": "fc2c43c218d63b2d89d5fcd85dc93e0b",
"score": "0.57262045",
"text": "def pdf_template\n 'participation_request/invoices.pdf.haml'\n end",
"title": ""
},
{
"docid": "338cee58ab4d317268fb98d884b2205b",
"score": "0.57216454",
"text": "def retrieve_email_template_preview(request)\n start.uri('/api/email/template/preview')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "2af71f794b481e1818b5a8cac93937f4",
"score": "0.57194835",
"text": "def retrieve_email_template_preview(request)\n start.uri('/api/email/template/preview')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "bc8cafd0c1912b7bc26c05f8c54a20c7",
"score": "0.5708462",
"text": "def tmpl(template, type)\n path = ::File.join(Lynr.root, 'views/email', \"#{template}.#{type.to_s}\")\n Sly::View::Erb.new(path, data: @mail_data)\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.5702093",
"text": "def template\n @template\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.5702093",
"text": "def template\n @template\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.57020664",
"text": "def template\n @template\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.57020664",
"text": "def template\n @template\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.57020664",
"text": "def template\n @template\n end",
"title": ""
},
{
"docid": "f81a19bb51d02e4fd0a976ab300cd714",
"score": "0.57020664",
"text": "def template\n @template\n end",
"title": ""
}
] |
2693a7ff3a2c58bba87ba92b579dd8fc
|
Removes the current key from the cache store
|
[
{
"docid": "700569807ae246bd12cc3d5051f8724a",
"score": "0.0",
"text": "def delete(method, *args)\n self.method = method\n self.args = args\n MethodCacheable.store.delete(key, options)\n end",
"title": ""
}
] |
[
{
"docid": "052aa53d7254791a358b017c36b321cc",
"score": "0.8169341",
"text": "def remove(key)\n cache.delete(key)\n end",
"title": ""
},
{
"docid": "8c67b6877f590151ba2961de05797838",
"score": "0.8043955",
"text": "def remove(key)\n decode(cache.remove(encode(key)))\n end",
"title": ""
},
{
"docid": "296f04ad53c69cc1601388df3d8bbc5d",
"score": "0.78388166",
"text": "def delete_cached(key)\n key = cache_store_key(key)\n\n @store.transaction do |s|\n s.delete(key)\n end\n end",
"title": ""
},
{
"docid": "49ff02168633987774e3d069663e9db5",
"score": "0.7830189",
"text": "def remove(key)\n `#{store}.removeItem(#{key})`\n end",
"title": ""
},
{
"docid": "7493f906cf569e8db75807787d21bd01",
"score": "0.77970827",
"text": "def remove(key)\n @store.delete key\n end",
"title": ""
},
{
"docid": "a7fa1562413541ce8a8e77b4852633fa",
"score": "0.77374214",
"text": "def delete(key)\n @cache.delete(key)\n end",
"title": ""
},
{
"docid": "cc9816a369f3c960ff1e4cbb2ade2fef",
"score": "0.7733992",
"text": "def delete_from_cache(key)\n cache_class.delete(key)\n end",
"title": ""
},
{
"docid": "01f72964d825fadd0a844a86cd828cef",
"score": "0.7588019",
"text": "def remove_key\n File.unlink key_path\n end",
"title": ""
},
{
"docid": "469bec26006a0e3fcd062b749d1b51e2",
"score": "0.75640523",
"text": "def remove_entry(key)\n @hash_storage.delete(key)\n end",
"title": ""
},
{
"docid": "ec3e3dce20fc055b43e69d75c35f2ea4",
"score": "0.749275",
"text": "def delete key\n File.delete( cache_file(key) ) if File.exists?( cache_file(key) )\n end",
"title": ""
},
{
"docid": "b0a86e3c8b4035b31c296ad6d48ba450",
"score": "0.74708974",
"text": "def forget(key)\n key = key.to_s\n __remove(key)\n end",
"title": ""
},
{
"docid": "9408bd362df3b09651f388d7b91b7222",
"score": "0.7445841",
"text": "def delete( k )\n cache.delete( k.hash )\n end",
"title": ""
},
{
"docid": "663e16367dc822bc0de2a8973f2be7a3",
"score": "0.74409777",
"text": "def remove(key)\n# @store[index(key)].select { |entry| entry.key == key }\n entry = get(key)\n @store.delete(entry) unless entry == -1\n end",
"title": ""
},
{
"docid": "b8d3a627c5c116e323ed837f441e2ff8",
"score": "0.74403596",
"text": "def cache_clear(key)\n delete_cached_object(key)\n end",
"title": ""
},
{
"docid": "6b05d965a20430e86c2597c859e95650",
"score": "0.74201",
"text": "def clear_key(key)\n @redis.del(key)\n end",
"title": ""
},
{
"docid": "523d727ce11241eff4ace40effe4f855",
"score": "0.7419402",
"text": "def delete key\n self.hash.delete key\n end",
"title": ""
},
{
"docid": "4649dbc73aebd18ebd4b5702368c9dc0",
"score": "0.74060804",
"text": "def cache_del\n db.log_info(\"CACHE DEL: #{cache_key}\")\n cache_driver.del(cache_key)\n end",
"title": ""
},
{
"docid": "a582b5de317c6af17a4def5d96d29f1b",
"score": "0.74007124",
"text": "def decr(key); end",
"title": ""
},
{
"docid": "a582b5de317c6af17a4def5d96d29f1b",
"score": "0.74007124",
"text": "def decr(key); end",
"title": ""
},
{
"docid": "2c5de3f651e373808629f278a0f5a9f6",
"score": "0.73506457",
"text": "def delete(_key) end",
"title": ""
},
{
"docid": "a77b49b0cf56368d5625cafb0ee3052e",
"score": "0.73444724",
"text": "def del(key)\n redis.del(key)\n end",
"title": ""
},
{
"docid": "7ae1923b9c8acba2b58199dcf750b515",
"score": "0.73314816",
"text": "def delete(key)\n @cache.del @prefix + key\n end",
"title": ""
},
{
"docid": "9954ad883198965e35e2005b8600ac36",
"score": "0.7324603",
"text": "def delete(key)\n @cache.delete(key)\n File.delete(path_to(hash(key))) if disk_cache_enabled?\n end",
"title": ""
},
{
"docid": "748d943e4958c0bac90ed971484014e1",
"score": "0.7321702",
"text": "def remove(key)\n storage.remove(\"#{@prefix}:#{key}\")\n end",
"title": ""
},
{
"docid": "9ef75d2da5444b3dc2936b38ab53ef0b",
"score": "0.7316581",
"text": "def del(key)\n validate_key(key)\n\n mdel([key])\n end",
"title": ""
},
{
"docid": "9ef75d2da5444b3dc2936b38ab53ef0b",
"score": "0.7316581",
"text": "def del(key)\n validate_key(key)\n\n mdel([key])\n end",
"title": ""
},
{
"docid": "611ef221cffd3306492d8a7bdc9a6bf7",
"score": "0.7315691",
"text": "def remove(*key)\n @cache.delete(key)\n end",
"title": ""
},
{
"docid": "2f430be9be82b565e75150acbef95f66",
"score": "0.73081684",
"text": "def forget(key)\n lock_memory do\n @memories[key] = nil\n store_memories\n end # \n nil\n end",
"title": ""
},
{
"docid": "c45547345d5289c2c9d847ed649b2bfa",
"score": "0.7306604",
"text": "def purge(key)\n @hash.delete(key)\n nil\n end",
"title": ""
},
{
"docid": "f82e3925ad45438c342c4c9e2c44386a",
"score": "0.72970235",
"text": "def remove(key); end",
"title": ""
},
{
"docid": "f82e3925ad45438c342c4c9e2c44386a",
"score": "0.72970235",
"text": "def remove(key); end",
"title": ""
},
{
"docid": "f07ad8e10ca8082568309c61640d38e9",
"score": "0.728068",
"text": "def delete(key)\n @store.delete(key_path_string(key.to_s))\n end",
"title": ""
},
{
"docid": "18522cc19d9879e8f9f2a8de8d105e37",
"score": "0.7251467",
"text": "def delete(keyname)\n keyname = keyname.to_s\n @@cache.delete(namespace_keyname(keyname), nil)\n end",
"title": ""
},
{
"docid": "04385f3775998fcb225a001e1a205796",
"score": "0.72482324",
"text": "def delete(key)\n `#@storage.removeItem(key)`\n end",
"title": ""
},
{
"docid": "bb90fd6ab284de48c1f527028b129037",
"score": "0.7244254",
"text": "def reset\n safe { redis.rem(key) }\n end",
"title": ""
},
{
"docid": "e79545b24fe7de9135c9bef346025ca3",
"score": "0.72426015",
"text": "def purge(key)\n @hash.delete(key)\n nil\n end",
"title": ""
},
{
"docid": "5bff877cf5d7ab1c8abba43640833df9",
"score": "0.72366464",
"text": "def delete_key(key)\n store.delete(key)\n save_to_file\n load_from_file\n end",
"title": ""
},
{
"docid": "59ec0734902814d58deeeed980870f56",
"score": "0.723531",
"text": "def remove(key)\n @hash.delete(key)\n end",
"title": ""
},
{
"docid": "59ec0734902814d58deeeed980870f56",
"score": "0.723531",
"text": "def remove(key)\n @hash.delete(key)\n end",
"title": ""
},
{
"docid": "ceaae4c4c9fa3802433f143d5b4353b1",
"score": "0.72194993",
"text": "def delete(keyname)\n keyname = keyname.to_s\n Rails.cache.delete(namespace_keyname(keyname))\n end",
"title": ""
},
{
"docid": "dac732450a090261af2a8ae6ca2d44f1",
"score": "0.7216003",
"text": "def delete(key)\n\t\t\t\tdo_finalization(key,@cache[key])\n\t\t\t\[email protected] key\n\t\t\t\t@ttl_cache.delete key\n\t\t\tend",
"title": ""
},
{
"docid": "a8235aaa875203f66b399aaa889fa1a6",
"score": "0.72138447",
"text": "def clear\n @redis.del(@key)\n end",
"title": ""
},
{
"docid": "193e52d497a33e1bae0a7476ea32746c",
"score": "0.7193109",
"text": "def clear\n @redis.del(@key)\n end",
"title": ""
},
{
"docid": "f366fa4dc8add6c2b39bf8ac7b464373",
"score": "0.7178374",
"text": "def remove_key hash, key\n\t\[email protected] hash,key\n\tend",
"title": ""
},
{
"docid": "23bea2e512d0a8f67193a07919bb7272",
"score": "0.71756977",
"text": "def delete_key(key)\n key_list_set = self.key_list_set.reload\n key_list_set.remove(key)\n end",
"title": ""
},
{
"docid": "458214dab59913f1d6b13b855f65edd9",
"score": "0.7152962",
"text": "def delete(key)\n @provider.delete(key) # Delete key from cache provider\n end",
"title": ""
},
{
"docid": "93a2569c8f35bdb443e15bc0d0b3519f",
"score": "0.7146173",
"text": "def delete(key)\n storage.del key\n end",
"title": ""
},
{
"docid": "2e6ab9b94dcf0af408cff118e0298026",
"score": "0.71400553",
"text": "def purge(key); end",
"title": ""
},
{
"docid": "4784560d4c5d46fa6e5a1420da0ce2d5",
"score": "0.7126354",
"text": "def del(key)\n @hash.delete(key)\n end",
"title": ""
},
{
"docid": "dba742c401a4942a25d5585c137e7743",
"score": "0.71260935",
"text": "def remove(key)\n @count -= 1\n bucket = @set[key.hash % @size]\n bucket.delete(key)\n end",
"title": ""
},
{
"docid": "80a44b84096f8d9b467ce3a3458df086",
"score": "0.7117427",
"text": "def delete(key)\n @backend.del(key)\n end",
"title": ""
},
{
"docid": "0f6eb289178a248e971b68d5f16272fb",
"score": "0.71172106",
"text": "def delete(key)\n begin\n @store.transaction(false) do\n @store.delete(key)\n end\n rescue PStore::Error\n # Unable to delete object from the cache.\n # Create a new store.\n initialize_store\n end\n end",
"title": ""
},
{
"docid": "1d27eba1a70dc44899aa132c098ab5a8",
"score": "0.7114792",
"text": "def reset\n redis.rem(key)\n end",
"title": ""
},
{
"docid": "173e720a05c4e1c880a975234074aae4",
"score": "0.71134907",
"text": "def delete(key)\n redis.del _key(key)\n end",
"title": ""
},
{
"docid": "173e720a05c4e1c880a975234074aae4",
"score": "0.71134907",
"text": "def delete(key)\n redis.del _key(key)\n end",
"title": ""
},
{
"docid": "5d711d96edeff50f9b0f2233482e760b",
"score": "0.71128726",
"text": "def remove_key(key)\n request(:remove_key, 'Key' => key)\n end",
"title": ""
},
{
"docid": "5d450926be7768e01c6af8f270c0d2c7",
"score": "0.7095323",
"text": "def clear!(key = nil)\n key = key.to_sym unless key.nil?\n @store.clear! key\n end",
"title": ""
},
{
"docid": "272ed0bdc4c38bd470cb02e3afb908d2",
"score": "0.70782864",
"text": "def delete(key)\n @redis.hdel(@path, key)\n return nil\n end",
"title": ""
},
{
"docid": "1cc9c9d73ef3dd19b078879aa825daf6",
"score": "0.7076653",
"text": "def delete(key)\n @redis.del(key)\n end",
"title": ""
},
{
"docid": "c6acff3d6ec15c204b28be3f09bbc2aa",
"score": "0.70765775",
"text": "def remove(key)\n end",
"title": ""
},
{
"docid": "c6acff3d6ec15c204b28be3f09bbc2aa",
"score": "0.70765775",
"text": "def remove(key)\n end",
"title": ""
},
{
"docid": "2b79366e6905d9d861afa39684a68719",
"score": "0.70703727",
"text": "def delete(key)\n @backend.del(key)\n end",
"title": ""
},
{
"docid": "8b3cd9969896044be3a7b139af85479f",
"score": "0.707018",
"text": "def purge_key(key)\n synchronize do\n puts \"PURGE KEY: #{key}\"\n @storage.delete(key)\n end\n end",
"title": ""
},
{
"docid": "6caad844e3e47779c57b227f387c3a41",
"score": "0.706452",
"text": "def remove(key)\n @h.delete(key)\n nil\n end",
"title": ""
},
{
"docid": "08bea026a677570d523d053d57f5b007",
"score": "0.70630884",
"text": "def delete_key(key)\n end",
"title": ""
},
{
"docid": "f5367dba617a0ffed22cb045f76e0521",
"score": "0.7061091",
"text": "def erase(key)\n end",
"title": ""
},
{
"docid": "a23cc5faf741aae0a6f974cdfb7628ff",
"score": "0.70603997",
"text": "def delete(key)\n removeObjectForKey(key.to_s)\n sync\n end",
"title": ""
},
{
"docid": "5a7e73c26052822ad485707251cab7aa",
"score": "0.70560914",
"text": "def delete(key)\n redis.del(key)\n end",
"title": ""
},
{
"docid": "880bb562e385bf682c4e76d2ef40c35c",
"score": "0.7055433",
"text": "def evict(key)\n @data_expires_at.delete(key)\n cache_value = @data.delete(key)\n @current_size_bytes -= size_of(key, cache_value)\n end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.70508134",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "cf474ee0dd4e7246fedc55d6fbeab9f2",
"score": "0.7041842",
"text": "def destroy\n @key.destroy\n end",
"title": ""
},
{
"docid": "64b384703e3ab5cf10728b4ae780ccd5",
"score": "0.7027296",
"text": "def delete(key)\n storage.delete(key)\n end",
"title": ""
},
{
"docid": "854eee9f57516d37ad3ebc92fc6b36ff",
"score": "0.7014125",
"text": "def [](key)\n key = key.to_sym\n cache[key] ||= store.delete(key)\n end",
"title": ""
},
{
"docid": "c475bc656c0e310a041f678f5914480f",
"score": "0.7013976",
"text": "def flush(key)\n Rails.cache.delete key\n end",
"title": ""
},
{
"docid": "dc50b3565f53af8db743288d2fd33936",
"score": "0.70087487",
"text": "def delete_cache\n Rails.cache.delete(Service.get_key_cache_key)\n end",
"title": ""
},
{
"docid": "cb15cb71e0bb93fce6591f0bfd8746ac",
"score": "0.70066303",
"text": "def delete key\n\t\t\tkey = key.to_s\n\t\t\tif (conn=Plezi.redis)\n\t\t\t\tconn.expire @id, SESSION_LIFETIME\n\t\t\t\tret = conn.hget @id, key\n\t\t\t\tconn.hdel @id, key\n\t\t\t\treturn ret\n\t\t\tend\t\t\t\t\n\t\t\tfailed\n\t\tend",
"title": ""
},
{
"docid": "bb55e9d3c98f014410137e8a4b4c87ba",
"score": "0.69953626",
"text": "def remove(key)\n \n end",
"title": ""
},
{
"docid": "bb55e9d3c98f014410137e8a4b4c87ba",
"score": "0.69953626",
"text": "def remove(key)\n \n end",
"title": ""
},
{
"docid": "192702ba167b71fb289643fe69b37359",
"score": "0.69864213",
"text": "def clear!(key = nil)\n key.nil? ? @store.clear : @store.delete(key)\n end",
"title": ""
},
{
"docid": "4f4c2406d76aa7e942f23db68b64dc55",
"score": "0.69844466",
"text": "def delete(key)\n begin\n value = self[key]\n\n @memcached.delete key\n\n return value\n rescue Dalli::DalliError => e\n Wrest.logger.error \"Error deleting #{key} from cache: #{e.inspect}\"\n return nil\n end\n end",
"title": ""
},
{
"docid": "a5376aede92e2406eaaf4adc06363512",
"score": "0.6983266",
"text": "def remove_key key\n key_cache.remove(conditional_output_key_column, key)\n end",
"title": ""
},
{
"docid": "a17ebe18574502de18690c8132efd064",
"score": "0.6982706",
"text": "def delete(key)\n @backend.delete(key)\n end",
"title": ""
},
{
"docid": "54e38c13fccdbc2a13454ff82c7e7b9e",
"score": "0.6981491",
"text": "def decr(key)\n\t\t\t\t\tcall('DECR', key)\n\t\t\t\tend",
"title": ""
},
{
"docid": "7bb180a962a3577907aa62ad949bf300",
"score": "0.6981126",
"text": "def clear!(key = nil)\n key.nil? ? @store.clear : @store.delete(key)\n end",
"title": ""
},
{
"docid": "f17e2b70112198a740f5c0ce2fdb8753",
"score": "0.6980586",
"text": "def clear\r\n RedisConnection.del( key )\r\n end",
"title": ""
},
{
"docid": "239d813f57ed05343fcd3933849f7a62",
"score": "0.6979084",
"text": "def destroy\n keys = rcache.keys(\"%s/*\" % key_prefix)\n unless keys.nil? || keys.empty?\n rcache.del(*keys)\n end\n end",
"title": ""
},
{
"docid": "7dd6903ffcc1fdfbcd4aecb311f06936",
"score": "0.6978181",
"text": "def remove(key)\n if @container[key]\n @container[key] = nil\n end\n end",
"title": ""
},
{
"docid": "274d0acb4672977700c9e93d9202808f",
"score": "0.6975878",
"text": "def remove_lru\n key = @__key_stack.shift\n @__cache.delete(key)\n end",
"title": ""
},
{
"docid": "de6f28d711d92ddebcf733073fe74a7d",
"score": "0.69725025",
"text": "def invalidate_key(key)\n @meta_mutex.synchronize { @keys.delete(key) }\n end",
"title": ""
},
{
"docid": "8183f7643798dfd505ba354925a47d58",
"score": "0.6970159",
"text": "def cache_delete\n model.send(:cache_delete, cache_key)\n end",
"title": ""
},
{
"docid": "be071f63abc1e1ec5e10a1a1f2cd589e",
"score": "0.69515693",
"text": "def remove_key(key)\n @access_keys.delete(key)\n end",
"title": ""
},
{
"docid": "2e66d1eb9b64edb2ec578799284fbef9",
"score": "0.6948463",
"text": "def delete(key)\n @backend.delete(key)\n end",
"title": ""
},
{
"docid": "1e477ead5ff52a8b36b3da01edf1c946",
"score": "0.6941291",
"text": "def destroy_key(key)\n @engine.destroy_key key.to_s\n end",
"title": ""
}
] |
3a4be52f01c25cf6c6d9721bed740d83
|
Operates on the game hash to return an array of the team names
|
[
{
"docid": "2f6957a04d7236fc0a21feaa958d6712",
"score": "0.0",
"text": "def team_colors(color)\n game_hash.each do |location, data|\n if data[:team_name] == color\n return data[:colors]\n end\n end\nend",
"title": ""
}
] |
[
{
"docid": "91f9c02c7285e52b3663991d4336439a",
"score": "0.887519",
"text": "def team_names\n\tarray_of_team_names = []\n\tgame_hash.collect do |team, team_info|\n\t\tteam_info[:team_name]\n\tend\nend",
"title": ""
},
{
"docid": "c7572ede3574155a844f467425121c9e",
"score": "0.87192494",
"text": "def team_names #operates on the hash to to return an array of team names\n\tarray = []\n\tgame_hash.each do |team_playing, data|\n\t\tdata.each do |key, value|\n\t\t\tif key == :team_name \n\t\t\t\tarray.push(value)\n\t\t\tend \n\t\tend \n\tend\n\treturn array\nend",
"title": ""
},
{
"docid": "aec9ed8b46bc88befbc41553f803caf5",
"score": "0.8709232",
"text": "def team_names\n \n game = game_hash\n \n teams = [game[:home][:team_name], game[:away][:team_name]]\n \n return teams\n\nend",
"title": ""
},
{
"docid": "850d90a9e45d10ea6e10f3f0218ba065",
"score": "0.8683789",
"text": "def team_names\n game_hash.collect do |location, team_data|\n team_data[:team_name]\n end\n end",
"title": ""
},
{
"docid": "c94f83a717e5bf8cf3a1946c903c0531",
"score": "0.86437565",
"text": "def team_names()\n gh = game_hash\n output = []\n output << gh[:home][:team_name]\n output << gh[:away][:team_name]\n return output\nend",
"title": ""
},
{
"docid": "b3baae69bce6d98884c64e1bb8737009",
"score": "0.8636051",
"text": "def team_names #operates on the hash to to return an array of team names\r\n\tarray = []\r\n\tgame_hash.each do |team_playing, data|\r\n\t\tdata.each do |key, value|\r\n\t\t\tif key == :team_name \r\n\t\t\t\tarray.push(value)\r\n\t\t\tend \r\n\t\tend \r\n\tend\r\n\treturn array\r\nend",
"title": ""
},
{
"docid": "528e6fa61dcc57939508f86ca7b92f2e",
"score": "0.86099064",
"text": "def team_names()\n hash = game_hash\n home_team_name = hash[:home][:team_name]\n away_team_name = hash[:away][:team_name]\n team_name_array = [home_team_name, away_team_name]\n\n return team_name_array\nend",
"title": ""
},
{
"docid": "e9e088f66f553218d8d84a54067e2ce2",
"score": "0.8608826",
"text": "def team_names\n return game_hash.reduce([]) do |memo, (teams, info)|\n memo << info[:team_name]\n end\nend",
"title": ""
},
{
"docid": "1f5429df1a72d97945029f4dafed5287",
"score": "0.8599581",
"text": "def team_names()\n teams = []\n game_hash.each do |home_or_away, team|\n teams.push(team[:team_name])\n end\n teams\nend",
"title": ""
},
{
"docid": "a8d4a26068835337a771c1c6a23fe7a3",
"score": "0.8584052",
"text": "def team_names\n team_name_array = []\n game_hash.each do |key, team_data|\n team_name_array << team_data[:team_name]\n end\n team_name_array\nend",
"title": ""
},
{
"docid": "ccc162ad7176362071a18c9ec2c587ba",
"score": "0.8577689",
"text": "def team_names\n versus = []\n game_hash.each do |a,b|\n versus << b[:team_name]\n end\n versus\nend",
"title": ""
},
{
"docid": "f54e4b91ec6096352a36cff6fe462b73",
"score": "0.85634995",
"text": "def team_names\n game_hash.keys.map do |team_key|\n game_hash[team_key][:team_name]\n end\nend",
"title": ""
},
{
"docid": "b4e44da0c446eb75df311feab32d26cd",
"score": "0.85577196",
"text": "def team_names\n teams = []\n game_hash.each do |key, value|\n teams.push(game_hash[key][:team_name])\n end\n teams\nend",
"title": ""
},
{
"docid": "c7d9f999ea7c27021e3bead6a15db006",
"score": "0.8555585",
"text": "def team_names\n game_hash.values.map {|team_data| team_data[:team_name] }\nend",
"title": ""
},
{
"docid": "b46864371dcb292c2df96e1635366ac8",
"score": "0.8551897",
"text": "def team_names\n names = []\n game_hash.each do |location, team_data|\n names.push(team_data[:team_name])\n end\n return names\nend",
"title": ""
},
{
"docid": "1854da5e692d7806363e631413b41652",
"score": "0.85492533",
"text": "def team_names\n team = []\n game_hash.each do |team_location, values|\n team << values[:team_name]\n end\n team\nend",
"title": ""
},
{
"docid": "31180eb45ef297e32c740077c36451a3",
"score": "0.8548933",
"text": "def team_names\n team_array = []\n game_hash.values.each do |team|\n team_array << team[:team_name]\n end\n team_array\nend",
"title": ""
},
{
"docid": "624e25fd5b8264df6ce2db657ab01657",
"score": "0.8530841",
"text": "def team_names\n game_hash.keys.map do |team_key| \n game_hash[team_key][:team_name]\n end\nend",
"title": ""
},
{
"docid": "71e56387cd641750a6d1a2a9c318e7cb",
"score": "0.8503703",
"text": "def team_names \n teams = []\n game_hash.each do |key, value| \n teams.push(game_hash[key][:team_name])\n end \n teams\nend",
"title": ""
},
{
"docid": "2ad7af6a57b13f4d0c64e8673bc94953",
"score": "0.849474",
"text": "def team_names\n team_names = []\n game_hash.each do |team, team_stats|\n team_names << team_stats[:team_name]\n end\n team_names\nend",
"title": ""
},
{
"docid": "eeb6ab9d1d2cbe915badb7ddde88e19e",
"score": "0.8458975",
"text": "def team_names\n teams = []\n \n game_hash.each do |location, team_data|\n teams.push(team_data[:team_name])\n end\n teams\nend",
"title": ""
},
{
"docid": "b60d68160a718dd4a36a0829385b33f2",
"score": "0.84553444",
"text": "def team_names\n teams = []\n game_hash.each do |location, team_data|\n teams << team_data[:team_name]\n end\n teams\nend",
"title": ""
},
{
"docid": "02606e414bb9e0c3e21a197e18425678",
"score": "0.8452985",
"text": "def team_names\n name_array = []\n game_hash.each { |location, team_data| name_array << team_data[:team_name] }\n name_array\nend",
"title": ""
},
{
"docid": "9c9d7ae162d27c0ab587e097a27a7391",
"score": "0.8430308",
"text": "def team_names\n teams = []\n game_hash.each do |location, team_data|\n teams.push team_data[:team_name]\n end\n teams\nend",
"title": ""
},
{
"docid": "45990ec14aad43ec2d1ff70ae2ca034d",
"score": "0.8426333",
"text": "def team_names\n game_hash.map {|location, keys| \n \tkeys[:team_name]\n }\nend",
"title": ""
},
{
"docid": "54be74f883d280b9ffb0c19ce056f651",
"score": "0.84123904",
"text": "def team_names\n array_team_names = []\n game_hash.collect do |team, team_details|\n array_team_names << team_details[:team_name]\n end\n array_team_names\nend",
"title": ""
},
{
"docid": "6473b70c80248e75a646d4ec5061216e",
"score": "0.838181",
"text": "def team_names\n game_hash.map { |k, v| v[:team_name] }\nend",
"title": ""
},
{
"docid": "dcb7e550a81716fff7a187c17f91a9ed",
"score": "0.83757794",
"text": "def team_names\n arr = []\n game_hash.each do |location, team|\n arr << team[:team_name]\n end\n arr\nend",
"title": ""
},
{
"docid": "bd9dc7946694045f7ada348f75a0c3c9",
"score": "0.8346489",
"text": "def team_names\n game_hash.map {|location, team_data| team_data[:team_name]}\nend",
"title": ""
},
{
"docid": "a5713203db2ad0d05ff7b86d0cdc276f",
"score": "0.8326355",
"text": "def team_names\n team_arr = []\n game_hash.each do |location, team_info |\n team_arr << team_info[:team_name]\n end\n team_arr\nend",
"title": ""
},
{
"docid": "b4f211ba242f535021aee51af91e26a3",
"score": "0.8300456",
"text": "def team_names\narray = []\n array << game_hash[:home][:team_name]\n array << game_hash[:away][:team_name]\n return array\n end",
"title": ""
},
{
"docid": "6764246e5f275d1179eaa5d0f79933c0",
"score": "0.82985497",
"text": "def team_names\n game_hash.map do |place, team|\n team[:team_name]\n end\nend",
"title": ""
},
{
"docid": "6764246e5f275d1179eaa5d0f79933c0",
"score": "0.82985497",
"text": "def team_names\n game_hash.map do |place, team|\n team[:team_name]\n end\nend",
"title": ""
},
{
"docid": "5710f889eb80e11313ace69fff388adc",
"score": "0.8272277",
"text": "def team_names\n array = []\n array << game_hash[:home][:team_name]\n array << game_hash[:away][:team_name]\nend",
"title": ""
},
{
"docid": "ad803c9f6e5d579b671c217d1bcc0430",
"score": "0.82660407",
"text": "def team_names\n [game_hash[:home][:team_name], game_hash[:away][:team_name]]\nend",
"title": ""
},
{
"docid": "ad803c9f6e5d579b671c217d1bcc0430",
"score": "0.82660407",
"text": "def team_names\n [game_hash[:home][:team_name], game_hash[:away][:team_name]]\nend",
"title": ""
},
{
"docid": "ad803c9f6e5d579b671c217d1bcc0430",
"score": "0.82660407",
"text": "def team_names\n [game_hash[:home][:team_name], game_hash[:away][:team_name]]\nend",
"title": ""
},
{
"docid": "f5bbd670f59e26394ad2e075d633f7c6",
"score": "0.82444364",
"text": "def team_names\n team_names = []\n game_hash.each do |location, team_data|\n team_names.push(game_hash[location][:team_name])\n end\n team_names\nend",
"title": ""
},
{
"docid": "c91a22c7d177c04a6650a63f4e0f26c0",
"score": "0.8243592",
"text": "def team_names\n game_hash.collect do |location, team_data|\n team_data[:team_name]\n end\nend",
"title": ""
},
{
"docid": "91dbf3de226f4b597f8426b30ef258b6",
"score": "0.8211183",
"text": "def team_names\n game_hash.collect do |location, team|\n team[:team_name]\n end\nend",
"title": ""
},
{
"docid": "45a50483db573353b05d56ef2e8b44b1",
"score": "0.8201104",
"text": "def team_names\n team_names = []\n game_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n if attribute == :team_name\n team_names << data\n end\n end\n end\n team_names\nend",
"title": ""
},
{
"docid": "72f52cd374f5112139a5fe356d7a6806",
"score": "0.8183735",
"text": "def team_names\n [game_hash[:home][:team_name],game_hash[:away][:team_name]]\nend",
"title": ""
},
{
"docid": "2348fec60a0d2a6a1720d3f1e376d036",
"score": "0.8168982",
"text": "def team_names\n team_names_array = []\n game_hash.each do |location, info|\n team_names_array << game_hash[location][:team_name]\n end\n team_names_array\nend",
"title": ""
},
{
"docid": "8c4cc3df26af0fa2e77e96ed544d41ec",
"score": "0.8098761",
"text": "def team_names(game)\n game.collect do |team, team_hash|\n team_hash[:name]\n end\nend",
"title": ""
},
{
"docid": "a46960ec43bebba408fdc6a09dab2ce8",
"score": "0.8085358",
"text": "def team_names\n team_arr = []\n team_arr << game_hash[:home][:team_name]\n team_arr << game_hash[:away][:team_name]\n return team_arr\nend",
"title": ""
},
{
"docid": "edcb35e118d0c937d9b0c01e86553f1a",
"score": "0.8073908",
"text": "def team_names(game_data)\n game_data.map do |team|\n team[:team_name]\n end\nend",
"title": ""
},
{
"docid": "24fd69113a45fbb08b91dafc452f3787",
"score": "0.8069558",
"text": "def team_names\n teams = []\n game_hash.each do |key, value|\n if !teams.include?(value[:team_name])\n teams << value[:team_name]\n end\n end\n teams\nend",
"title": ""
},
{
"docid": "4e7d2f3ac52bfe210ff340b41cb6837d",
"score": "0.8067357",
"text": "def team_names\n game_hash.map do |team, team_info|\n #inside of our game hash we will return a new array using .map\n team_info[:team_name]\n #inside of our array will be the team names\n end\nend",
"title": ""
},
{
"docid": "87b1271cbfb10c23c0ff49446cfef76b",
"score": "0.8035815",
"text": "def team_names\n game_hash.collect do |location, team_info|\n team_info[:team_name]\n end\nend",
"title": ""
},
{
"docid": "eb03a849b2d82d371564bd7898fe5d6d",
"score": "0.8024782",
"text": "def team_names\n team_names_array = []\n game_hash.each{|home_or_away,team_properties|\n team_names_array << game_hash[home_or_away][:team_name]\n }\n team_names_array\nend",
"title": ""
},
{
"docid": "82fe9fdc1e09d9397b34ae1e6a245f04",
"score": "0.80015695",
"text": "def team_names\n game_hash.collect do |location, attribute|\n game_hash[location][:team_name]\n end\nend",
"title": ""
},
{
"docid": "04e2dd10fad0014e59b939b1992f4878",
"score": "0.79921",
"text": "def team_names\n game_hash.map do |location, attributes|\n attributes[:team_name]\n end\nend",
"title": ""
},
{
"docid": "b464814cbe33c8d880b47051bc93b706",
"score": "0.7991928",
"text": "def team_names\n team_array = []\n team_array << game_hash[:home][:team_name] \n team_array << game_hash[:away][:team_name] \n\n team_array\n\nend",
"title": ""
},
{
"docid": "ac63e3fd42657acfae2a6d0bae7b15c0",
"score": "0.798495",
"text": "def team_names \n team_names = []\n\n game_hash.each { |home_or_away, attributes|\n if attributes.has_key?(:team_name)\n team_names << attributes[:team_name]\n end\n }\n\n team_names\nend",
"title": ""
},
{
"docid": "5d857ace461a5e58d7afdbe42afeb36e",
"score": "0.79540545",
"text": "def team_names(game)\n teams = []\n teams << game[:home][:teamname]\n teams << game[:away][:teamname]\n puts teams \nend",
"title": ""
},
{
"docid": "038134548b8adecaa0c67597d68f590f",
"score": "0.7931352",
"text": "def team_names()\n game_hash.each do |attribute, values|\n x = values[\":team_name\"]\n return x\n end \n end",
"title": ""
},
{
"docid": "2a60cd2f526470425555861876b05d73",
"score": "0.79164934",
"text": "def team_names\n both_teams = []\n both_teams << game_hash[:home][:team_name]\n both_teams << game_hash[:away][:team_name]\nboth_teams\n end",
"title": ""
},
{
"docid": "2a1312127052c5e9820a6c7ed6c52724",
"score": "0.79150057",
"text": "def team_names\n game_hash.map do |location, team_data|\n #go through data, access value from :team_name keys\n team_data[:team_name]\n end\nend",
"title": ""
},
{
"docid": "67aedf93eb2e062eff5303a2f2fe7b2c",
"score": "0.7889692",
"text": "def team_names\n game_hash\n #Creates a new teams array and adds both team names to it and returns the new teams array\n teams = []\n teams << game_hash[:away][:team_name]\n teams << game_hash[:home][:team_name]\n return teams \nend",
"title": ""
},
{
"docid": "066222887a637983ea85fb722c891a86",
"score": "0.77978235",
"text": "def all_team_players(team_name, game)\n game.each do |team, team_hash|\n if team_hash[:name] == team_name\n return (team_hash[:players].collect do |player, player_hash|\n player_hash[:name]\n end)\n end\n end\nend",
"title": ""
},
{
"docid": "c7e99b0b3f400f643a41b2554dd8cf35",
"score": "0.76326704",
"text": "def team_names\n team_names_array = []\n game_hash.each do |home_away, value|\n value.each do |team_atts, inner_value|\n # binding.pry\n if team_atts == :team_name\n team_names_array.push(inner_value)\n end \n end\n end\n team_names_array\nend",
"title": ""
},
{
"docid": "e0d43a2bf9b85fc58a9ea27b8a84c197",
"score": "0.7565322",
"text": "def players_on_team(team, game)\n team_name = team.to_sym\n \n team_members = []\n game[team_name][:players].each_key do |player|\n team_members << player\n end\n\n team_string = team_members.join(\", \")\n\n puts \"The players on the #{team_name} are #{team_string}.\"\nend",
"title": ""
},
{
"docid": "8f08f0c7f8cc0f7b27b663de3cacb7e9",
"score": "0.75591403",
"text": "def player_numbers(team_name)\n player_numbers_array = []\n game_hash.each do |key, team_data|\n if team_data[:team_name] === team_name\n team_data[:players].each do |name, player_data|\n player_numbers_array << player_data[:number]\n end\n end\n end\n player_numbers_array\nend",
"title": ""
},
{
"docid": "6d092b41943dd69b518014f7f0f53622",
"score": "0.75507516",
"text": "def player_data_by_team(team)\n players = []\n if team == game_hash[:home][:team_name]\n players << game_hash[:home][:players]\n else\n players << game_hash[:away][:players]\n end\n return players.flatten\nend",
"title": ""
},
{
"docid": "82d35c9a93fc72bd19f7e72f361f121d",
"score": "0.7544541",
"text": "def team_names\n @teams.keys\n \n end",
"title": ""
},
{
"docid": "b6998f43d4cdfbf2c9df7b7d00174d9f",
"score": "0.7536752",
"text": "def get_players \n players = game_hash.keys.map do |team|\n game_hash[team][:players] \n end\n players.flatten\nend",
"title": ""
},
{
"docid": "00be5b1c80a161da308648aac9068f78",
"score": "0.7532593",
"text": "def player_numbers(team_name)\n team_numbers = []\n game_hash.each do |key, team_info|\n if team_info[:team_name] == team_name\n team_info[:players].each do |names, stats|\n team_numbers << stats[:number]\n end\n end\n end\n team_numbers\nend",
"title": ""
},
{
"docid": "0bd4b4a5cb40cdcde9df473d29fc483c",
"score": "0.7530923",
"text": "def teams_and_players\n teams = game_hash.values\nend",
"title": ""
},
{
"docid": "9c285c3d9d9049f08fe525e12c5b3906",
"score": "0.7520271",
"text": "def player_numbers(team_name)\n # declare a variable that holds the player numbers for the team\n array = []\n game_hash.keys.each do |team_key|\n # binding.pry\n if team_name == game_hash[team_key][:team_name]\n game_hash[team_key][:players].each do |player|\n array << player[:number]\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "141281ec81925cbe9d7a7e02bcfb4b78",
"score": "0.7498987",
"text": "def who_is_playing(game)\n team_names = []\n team_names << game[:home][:team_name]\n team_names << game[:away][:team_name]\n team_names\nend",
"title": ""
},
{
"docid": "ab5ff19de7e28eaafd1bdfa69f8763ff",
"score": "0.7467055",
"text": "def team_names#didit!\ngame_hash.map do |location, team_data|\nteam_data[:team_name]\nend\nend",
"title": ""
},
{
"docid": "f98a9a87c56bb9b2bdabddd8b3e3f018",
"score": "0.7454701",
"text": "def team_names\n team_name_file = []\n game_hash.each {|location, team_data| team_name_file << team_data[:team_name]} \n team_name_file \nend",
"title": ""
},
{
"docid": "0e9d29f2d14b4c24e1b954cdaa87b552",
"score": "0.7420129",
"text": "def team_names\n TEAMS.collect { |team| team[:team_name] }\nend",
"title": ""
},
{
"docid": "e82e529d79ac7c819219d8857373b180",
"score": "0.74114156",
"text": "def player_names\n join_teams.map do |player|\n player[:player_name]\n end\nend",
"title": ""
},
{
"docid": "0d3d37236fe701803d9c48f8bceb6e41",
"score": "0.7388159",
"text": "def player_numbers(team_name)\n player_numbers_array=[]\n game_hash.each{|home_or_away,team_properties|\n game_hash[home_or_away][:players].each{|player|\n if game_hash[home_or_away][:team_name] === team_name\n player_numbers_array << player[:number]\n end\n}\n}\nplayer_numbers_array\nend",
"title": ""
},
{
"docid": "285efe9eb21010837a9917cf4f54c3c8",
"score": "0.7336028",
"text": "def player_numbers(name_of_team)\n arr = []\n game_hash.each do |location, team|\n if team[:team_name] == name_of_team\n team[:players].each do |player, stats|\n arr << stats[:number]\n end\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "4f5191109ebe26ff1a4f87f5943e1a5a",
"score": "0.73223",
"text": "def player_numbers (team_name)\n team_numbers = []\n game_hash.each do |loc, data|\n data[:players].each do |player_stats|\n if data[:team_name] == team_name\n team_numbers << player_stats[:number]\n end\n end\n end\n team_numbers\nend",
"title": ""
},
{
"docid": "6c20fc256911dbead4218a06c912851f",
"score": "0.7318623",
"text": "def player_numbers(team_name)\n numbers = []\n game_hash.each do |home_or_away, team|\n if team[:team_name] == team_name\n team[:players].each do |key, player|\n numbers.push(player[:number])\n end\n end\n end\n numbers\nend",
"title": ""
},
{
"docid": "62eaa8fecc6b9bf0f77fbd84142958b2",
"score": "0.73111683",
"text": "def player_numbers(team_name)\n list_of_numbers = []\n game_hash.each do |team, team_details|\n if team_details[:team_name] == team_name\n team_details[:players].each do |player_name, player_details|\n list_of_numbers << player_details[:number]\n end\n end\n end\n list_of_numbers\nend",
"title": ""
},
{
"docid": "28e8e928d08ba312e6c5c2a78c911b22",
"score": "0.7302325",
"text": "def player_numbers(team_name)\n array_of_numbers = []\n game_hash.values.each do |team|\n team[:players].each do |player|\n array_of_numbers << player[:number] if team.has_value?(team_name)\n end\n end\n array_of_numbers\nend",
"title": ""
},
{
"docid": "f64a7510127bce8c3f347d11e360ae87",
"score": "0.7296809",
"text": "def player_data\n players = []\n game_hash.each do |home_away, team_details|\n players << team_details[:players]\n end\n return players.flatten\nend",
"title": ""
},
{
"docid": "f146b10ce731617bfc18563cbaec96d2",
"score": "0.72848964",
"text": "def team_helper(team)\n game_hash.map {|key, value| if value[:team_name] === team \n return value end }\nend",
"title": ""
},
{
"docid": "f146b10ce731617bfc18563cbaec96d2",
"score": "0.72848964",
"text": "def team_helper(team)\n game_hash.map {|key, value| if value[:team_name] === team \n return value end }\nend",
"title": ""
},
{
"docid": "46e0dc1b9c34a97d7c8cd98129c18341",
"score": "0.7283793",
"text": "def gets_all_players\n array_of_player_hashes = []\n game_hash.each do |location, team|\n team[:players].each do |player|\n array_of_player_hashes << player\n end\n end\n array_of_player_hashes\nend",
"title": ""
},
{
"docid": "bbfebc3894c5b0b0bd7d272d16ba0394",
"score": "0.7277029",
"text": "def players\n #Return a list of the players\n players = game_hash.collect do |location, team_info|\n \tteam_info[:players].keys.flatten\n end \nend",
"title": ""
},
{
"docid": "04e9e86551471dd17cb4aca2e7de1fc8",
"score": "0.72553164",
"text": "def join_teams\n game_hash.values.map do |team_hash|\n team_hash[:players]\n end.flatten\nend",
"title": ""
},
{
"docid": "7cfa8ba86a62a125e0891c5eb78f7f09",
"score": "0.72478515",
"text": "def all_players \n game_hash.values.collect do |team|team[:players]\n end.flatten\nend",
"title": ""
},
{
"docid": "27eee0076c5e4960a2090a25f864f2fe",
"score": "0.7212025",
"text": "def home_players\n \n info = game_hash\n \n return info[:home][:players].map{|hash| hash.fetch(:player_name)}\n \nend",
"title": ""
},
{
"docid": "92137858f73b3d7cb4a774881c799af5",
"score": "0.7211748",
"text": "def player_numbers(team)\n team_numbers = []\n game_hash.each do |location, team_data|\n if team_data[:team_name] == team\n team_data[:players].each do |player, stats|\n team_numbers << stats[:number]\n end\n end\n end\n team_numbers\nend",
"title": ""
},
{
"docid": "dba57c0e43bfc7b558862feb88fdd4e8",
"score": "0.7182406",
"text": "def player_numbers(team_name)\n jersey_arr = []\n game_hash.each do |location, team_info |\n if team_info[:team_name] == team_name\n team_info[:players].each do | key, data |\n jersey_arr << data[:number]\n end\n end\n end\n jersey_arr\nend",
"title": ""
},
{
"docid": "ef9e72f9df7c90e5a05423ad608d857c",
"score": "0.717784",
"text": "def team_names\n game_hash\n team_names_array = []\n#team_colors_hash = {}\nleveltwo_array = []\n game_hash.reduce({}) do |memo, (home_away, second_layer)|\n #puts memo #empty hash\n \n second_layer.reduce({}) do |memo, (key, value)|\n# key # team_color_players\n # value #nets_horns_bw_tp_arrayofplayers\n leveltwo_array << {key => value} \nmemo\nend\nmemo\nend\nleveltwo_array.uniq!\nleveltwo_array.delete_at(2)\nleveltwo_array.pop\n\n leveltwo_array.each do |k , v|\n k.each do |name_color , team_color_v|\n \n team_names_array << team_color_v \nend\nend\nteam_names_array.delete_at(1)\nteam_names_array.pop\n team_names_array\n #returned an Array of the team names.
\nend",
"title": ""
},
{
"docid": "53dcaf8df5cc198480b35d888be92f56",
"score": "0.7174255",
"text": "def player_numbers(team_name)\n player_numbers = []\n game_hash.each do |team, team_stats|\n if team_stats[:team_name] == team_name\n team_stats.each do |stat, data|\n data.each {|player, pstats| player_numbers << pstats[:number]} if stat == :players\n end\n end\n end\n player_numbers\nend",
"title": ""
},
{
"docid": "8288f23200d2e4383866f689189f275d",
"score": "0.71278024",
"text": "def player_numbers(team_name)\n all_numbers = []\n game_hash.each do |location, team_info|\n if team_info[:team_name] == team_name\n team_info[:players].each {|name, stats| all_numbers << stats[:number] }\n return all_numbers\n end\n end\nend",
"title": ""
},
{
"docid": "84693c95662c66b43f75a990db534554",
"score": "0.7125682",
"text": "def player_numbers(team_name)\n array =[]\n game_hash.each do |location, team| #check first section hash :home,:away & :team_name, :colors:, :players (everything inside them all)\n if team_name == team[:team_name] #team_name array == :team_name (\"Brooklyn Nets\" or \"Charlotte Hornets\")\n team[:players].each do |name, info| #iterate block of team[:players] \"Alan Anderson\" => {:number => 0, :shoe => 16, :points => 22, :rebounds => 12, :assists => 12, :steals => 3, :blocks => 1, :slam_dunks => 1},\n # binding.pry # \"Reggie Evans\" => {:number => 30, :shoe => 14, :points => 12, :rebounds => 12, :assists => 12, :steals => 12, :blocks => 12, :slam_dunks => 7},\n array << info[:number]\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "0fad74ee740daf6135e97d2212277753",
"score": "0.71196437",
"text": "def first_tier_team_name(find_it)\n team_names = []\n game_hash.map do |location, team_data|\n if !team_names.include?(team_data[find_it])\n team_names.push(team_data[find_it])\n end\n end\n return team_names\nend",
"title": ""
},
{
"docid": "b4e3158b98e6844d38226b4fd7f059fd",
"score": "0.71169865",
"text": "def player_numbers(name)\n jersy_array = []\n game_hash[:home][:players].each {|player|\n if game_hash[:home][:team_name] == name\n jersy_array << player[:number]\n end \n }\n game_hash[:away][:players].each {|player|\n if game_hash[:away][:team_name] == name\n jersy_array << player[:number]\n end \n }\n jersy_array\nend",
"title": ""
},
{
"docid": "a9cabfe7ed6aebd4bad3cea924ea0ad4",
"score": "0.71123487",
"text": "def player_numbers(team_name)\n players_nums = []\n game_hash.each do |team,data|\n if data[:team_name] == team_name\n data[:players].each do |player,player_stats|\n players_nums << player_stats[:stats][:number]\n end\n end\n end\n return players_nums\nend",
"title": ""
},
{
"docid": "84a5c0150405675baf291f092d2e5762",
"score": "0.7105866",
"text": "def player_numbers(name)\n nums = []\n game_hash.each do |place, team|\n if team[:team_name] == name\n team.each do |attribute, data|\n if attribute == :players\n data.each do |info, x|\n nums << x[:number]\n end\n end\n end\n end\n end\n nums\nend",
"title": ""
},
{
"docid": "83068593d71e5df8d72783649bc4bdfd",
"score": "0.71051675",
"text": "def player_numbers(team_name)\n array = []\n game_hash.collect do |location, team_hash|\n if team_name == team_hash[:team_name]\n team_hash[:players].collect do |player_name, stats_hash| # .each works too\n array << stats_hash[:number]\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "fd3171afdce52e051f27fabb4fcf39d6",
"score": "0.71041715",
"text": "def return_team_with_players_stats\n teams_information = {}\n hold_name = \"\"\n hold_players = {}\n game_hash.each do |site, team_hash|\n team_hash.each do |team_info, team_trait|\n case team_info.to_s\n when \"team_name\"\n hold_name = team_trait.to_s\n when \"players\"\n hold_players = team_trait\n end\n teams_information[hold_name.to_sym] = hold_players\n end\n end \nteams_information\nend",
"title": ""
},
{
"docid": "f564ddcf55f8cf5c3e00f2891e2905f5",
"score": "0.70981467",
"text": "def player_numbers team_name\n jersey_numbers = []\n game_hash.each do |location, team_info|\n if team_name == team_info[:team_name]\n team_info[:players].each do |player_hash|\n jersey_numbers << player_hash[:number]\n end\n end\n end\n jersey_numbers\nend",
"title": ""
}
] |
e857809edf446cda2528191ca6276522
|
Loads the given environment from the config file or error if the environment doesn't exist. If the ConfigFile isn't environmentbased, the environment is ignored. If the config file was initialized with keys checks to see that all of the specified keys exist in the final configuration.
|
[
{
"docid": "7aaf2438eba3a51076d7ed820754dc27",
"score": "0.564434",
"text": "def load(environment=nil)\n load_from_file(file, environment)\n end",
"title": ""
}
] |
[
{
"docid": "e5f0b9843f0a7807c2109382e34b90e5",
"score": "0.708336",
"text": "def load_from_file(filename, environment)\n if File.exist?( filename ) then\n @loaded_from = filename\n configuration = YAML.load_file(filename)\n if environment_based?\n configuration = configuration[environment] or raise Error, \"environment #{environment} \" +\n \"not found in #{filename}\"\n configuration\n end\n keys.each do |k|\n raise Error, \"key missing: #{k}\" unless configuration.has_key?( k )\n end\n configuration.extend(AlternateConfig)\n configuration.config_file = self\n configuration\n else\n raise Error, \"file not found: #{filename}\"\n end\n end",
"title": ""
},
{
"docid": "3b70107a84349406555c4a95c617571c",
"score": "0.68868333",
"text": "def load_environment_file(name, fail_on_missing = false)\n unless File.exists?(name)\n abort(\"Unable to read environment: #{name}\") if fail_on_missing\n return nil\n end\n\n load_env = EC2Launcher::DSL::Environment.new\n load_env.load(File.read(name))\n load_env\n end",
"title": ""
},
{
"docid": "e61f372a128ce1865e210af6b66ffd46",
"score": "0.6871078",
"text": "def load_config_file_for_environment_key( file_name, options )\n load_config_file( options.merge(:env => true) )\n end",
"title": ""
},
{
"docid": "eff173a0a123bdbcd03910e73e6903be",
"score": "0.6839521",
"text": "def load_config(filename, environment)\n\t\t\tyaml = YAML.load_file(filename)[environment.to_s]\n\t\t\traise ArgumentError, \"The #{environment} environment does not exist in #{filename}\" if yaml.nil?\n\t\t\tyaml.each { |k, v| config[k.to_sym] = v }\n\t\tend",
"title": ""
},
{
"docid": "8a484e5e30e398c901ca205e6f9b14f1",
"score": "0.6823025",
"text": "def load_environment(filename)\n config_file = Pathname.new(__FILE__).dirname.parent + filename\n config = YAML.load_file(config_file)\n puts \"Loaded environment file #{config_file}\"\n return config\nend",
"title": ""
},
{
"docid": "8fb3824a3b6e1ba69956e230e200e8b1",
"score": "0.6772699",
"text": "def load_environment(*args)\n\t\t\tpath = environment_path(*args)\n\t\t\t\n\t\t\tif File.exist?(path)\n\t\t\t\t# Load the YAML environment file:\n\t\t\t\t@environment = YAML.load_file(path)\n\t\t\t\t\n\t\t\t\t# We update ENV but only when it's not already set to something:\n\t\t\t\tENV.update(@environment) do |name, old_value, new_value|\n\t\t\t\t\told_value || new_value\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3a3dfe7c625089c88d2232f63092e42e",
"score": "0.67564464",
"text": "def load_file(config_file)\n return unless File.exists?(config_file)\n\n file_data = YAML.load_file(config_file) || {}\n\n # set up required keys\n file_data['required'] ||= []\n file_data['required'].each do |key|\n required.push(Util.normalize(key))\n end\n\n # load up the environment-specific data\n file_data['environments'] ||= {}\n @data = file_data['environments'][environment] || {}\n end",
"title": ""
},
{
"docid": "ae003d615d7a0c051126b322a2e8b837",
"score": "0.6738694",
"text": "def load_environment_file(f)\n do_or_die(File.exists?(f),\"Loading environments from #{f}\",\n \"Environment file #{f} does not exist\")\n supp_envs = YAML.load_file(f)\n supp_envs.each_with_object([]) do |(name,options),envs|\n\n # store the environment name inside its configuration hash\n options[:name] = name\n \n # translate alternative keywords for export filters\n %w(filter filters export-filters).each do |f|\n if options.include?(f) \n options[:export_filters] = options[f].split(/[ ,]/)\n options.delete(f) \n end \n end \n\n options = options.each_with_object({}){|(k,v),h| h[k.to_sym] = v} # symbolise keys\n\n # convert arrays into comma-delimited strings\n options = options.each_with_object({}) do |(k,v),h|\n h[k] = v.is_a?(Array) ? v.join(',') : v\n end\n\n # convert space-delimited into comma-delimited strings\n %i(destination with_tags without_tags).each do |f|\n options[f] = options[f].split(/[ ,]/).join(',') if options.include?(f)\n end\n\n envs << options # add hash to environments array\n end\n end",
"title": ""
},
{
"docid": "a13f0cc210b29d19167978d60acc3d2f",
"score": "0.6605752",
"text": "def load_config!\n config = YAML.load_file @config_path\n\n unless config.key? @environment\n raise ClientError, \"No configuration found for specified environment `#{@environment}'\"\n end\n\n @config = config[@environment]\n @config.deeper_merge! DEFAULT_CONFIG\n\n emit :config_load\n end",
"title": ""
},
{
"docid": "f69ed2cf333f5407eee2803494e62387",
"score": "0.6454551",
"text": "def config_file\n env_config['config_file'] || raise('environment problem:environment information not loaded')\n end",
"title": ""
},
{
"docid": "96131db3ead2c94ab2916ce5aa6bbcc5",
"score": "0.6410036",
"text": "def _load_env\n require 'yaml'\n r_var = _open_sefile('env3.yml') { |f| YAML.load(f) }\n @var.delete :file_open_raised\n r_var.each { |k,v| @var[k] = v } if r_var\nend",
"title": ""
},
{
"docid": "fc4046bce3b556cb7fff86ecbc00cf6c",
"score": "0.63946444",
"text": "def load_enviroment(file = nil)\n file ||= \".\"\n\n if File.directory?(file) && File.exists?(File.expand_path(\"#{file}/config/environment.rb\"))\n require 'rails'\n require File.expand_path(\"#{file}/config/environment.rb\")\n if defined?(::Rails) && ::Rails.respond_to?(:application)\n # Rails 3\n ::Rails.application.eager_load!\n elsif defined?(::Rails::Initializer)\n # Rails 2.3\n $rails_rake_task = false\n ::Rails::Initializer.run :load_application_classes\n end\n elsif File.file?(file)\n require File.expand_path(file)\n end\n end",
"title": ""
},
{
"docid": "d2f885ccccffd365d98fa4936d617950",
"score": "0.63857317",
"text": "def load(config_file)\n @config = YAML.load_file(config_file)\n @config = config[::Rails.env] if defined? ::Rails\n check_config_and_export_to_env\n end",
"title": ""
},
{
"docid": "d6683a3b1395fd554d953bdeaeb7474f",
"score": "0.63678426",
"text": "def load_config(config_file, env_key = :test)\n config_file = File.expand_path(config_file)\n config_hash = symbolize_keys(YAML.load(ERB.new(File.read(config_file)).result))[env_key]\n configure_ports(config_hash)\n self.config = config_hash || {}\n rescue Errno::ENOENT\n raise Riak::TestServer::MissingConfiguration.new(config_file)\n end",
"title": ""
},
{
"docid": "f967c81d3ceadf06b29c0490d554001b",
"score": "0.63150847",
"text": "def load_environment!(opts=nil)\n env_path = File.join(root_path, 'sc-config')\n env_path = File.join(root_path, 'sc-config.rb') if !File.exists?(env_path)\n \n @environment = {}\n if File.exists?(env_path)\n f = File.read(env_path)\n eval(f) # execute the config file as if it belongs.\n end\n\n # Override any all options with load_opts\n if build_numbers = @load_opts[:build_numbers]\n @load_opts.delete(:build_numbers)\n build_numbers.each do | bundle_name, build_number |\n env = @environment[bundle_name.to_sym] ||= {}\n env[:build_number] = build_number\n end\n end\n \n (@environment[:all] ||= {}).merge!(@load_opts)\n\n end",
"title": ""
},
{
"docid": "11658bc2dec4aa7555beb63dc73ecece",
"score": "0.63095176",
"text": "def config_from_file(path, mode:)\n multi_env_config = load_json(path)\n multi_env_config.fetch('all', {})\n .merge(multi_env_config.fetch(mode, {}))\n rescue Errno::ENOENT => error\n warn \"Check that your vite.json configuration file is available in the load path:\\n\\n\\t#{ error.message }\\n\\n\"\n {}\n end",
"title": ""
},
{
"docid": "4a066aad406070214aa79b0069e3e0ac",
"score": "0.62491393",
"text": "def load_env!(options = {})\n source = load_yaml_file(\"env.yml\")\n source = source.fetch(options[:env_section] || env_section, {})\n \n source.each do |key, value|\n if !ENV.has_key?(key) || options[:overwrite] == true\n ENV[key.to_s.upcase] = value.to_s\n end\n end\n end",
"title": ""
},
{
"docid": "7ee577add1330ed382b9a54c08c9f471",
"score": "0.6244782",
"text": "def load_env(environment=nil)\n environment ||= \"production\"\n load_dot_env \".env\" if environment == \"production\"\n load_dot_env \".env.#{environment}\"\nend",
"title": ""
},
{
"docid": "12a0c460d03d52100a07d7f45d4ae1dd",
"score": "0.6224516",
"text": "def load(name)\n yml_file(\"#{name}/#{environment}\") ||\n yml_file_with_key(\"#{name}\", environment) ||\n yml_file(\"#{name}/default\") ||\n yml_file_with_key(\"#{name}\", 'default') ||\n raise(NotFound.new(name, environment))\n end",
"title": ""
},
{
"docid": "8262af87cf754b8e2dca9e0bb7875d48",
"score": "0.6223793",
"text": "def config\n @config ||=\n begin\n raise(ConfigError, \"Cannot find config file: #{file_name}\") unless File.exist?(file_name)\n\n env_config = self.class.load_yaml(ERB.new(File.new(file_name).read).result)[env]\n raise(ConfigError, \"Cannot find environment: #{env} in config file: #{file_name}\") unless env_config\n\n env_config = self.class.send(:deep_symbolize_keys, env_config)\n self.class.send(:migrate_old_formats!, env_config)\n end\n end",
"title": ""
},
{
"docid": "31c84e5716468487e6025956964cbb9a",
"score": "0.62189215",
"text": "def read_env(file_path, crypted)\n begin\n env = Cryptenv.new()\n\n if crypted \n env.load_crypted_file(file_path)\n else\n env.load_file(file_path)\n end\n \n rescue Exception => e\n puts \"\\nERROR: #{file_path} file seems to be missing.\\n\"\n raise\n end\nend",
"title": ""
},
{
"docid": "5897a9e1c63f04634c55067e1f468754",
"score": "0.6217771",
"text": "def fetch_config\n Rails.logger.debug \"Loading #{@file}::#{@env}\" if Object.const_defined?('Rails') && Rails.logger.present?\n YAML::load_file(@file)[@env.to_s]\n end",
"title": ""
},
{
"docid": "54a9d2db5eebb8a7953f54003896b919",
"score": "0.61880404",
"text": "def read_env\n dir_path = Dir.pwd\n DataCache.env_hash ||= {}\n loop do\n path = File.join dir_path, TddDeploy::Environ::ENV_FNAME\n if File.exists? TddDeploy::Environ::ENV_FNAME\n line_no = 0\n if f = File.new(path, 'r')\n begin\n f.each do |line|\n line_no += 1\n if line =~ /^\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/\n key = $1.downcase\n if self.env_types.keys.include? key\n self.send \"#{key}=\".to_sym, $2\n # self.env_hash[key] = self.env_types[key] == :list ? self.str_to_list($2) : $2.to_s\n else\n raise ::ArugmentError.new(\"TddDeploy::Environ#read_env: Error in #{TddDeploy::Error::ENV_FNAME}: #{line_no}: Illegal Key: #{key}\")\n end\n else\n raise ::ArugmentError.new(\"TddDeploy::Environ#read_env: Error in #{TddDeploy::Error::ENV_FNAME}: #{line_no}: Unmatched Line: #{line}}\")\n end\n end\n ensure\n f.close\n end\n # add any missing env keys\n (self.env_types.keys - self.env_hash.keys).each do |key|\n case self.env_types[key]\n when :pseudo then next\n when :capfile then next\n when :list\n self.env_hash[key] = str_to_list(self.env_defaults[key])\n else\n self.env_hash[key] = self.env_defaults[key]\n end\n end\n return self.env_hash\n else\n raise ::RuntimeError.new(\"Unable to open #{path} for reading\")\n end\n elsif dir_path.length <= 1\n # reached root level, so initialize to defaults and exit\n return nil\n else\n # move to parent directory\n dir_path = File.expand_path('..', dir_path)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "c60aeb74cbefaf63e117828dd6d3b0a6",
"score": "0.6187283",
"text": "def alternate_config(environment)\n if loaded_from && environment_based?\n load_from_file(loaded_from, environment)\n else\n raise \"config is not environment-based or was not loaded from a file,\" +\n \" cannot select an alternate configuration!\"\n end\n end",
"title": ""
},
{
"docid": "f292dc267a796daa5fdb39966bdc461f",
"score": "0.6117812",
"text": "def load_environment(file)\n if File.directory?(file) && File.exists?(File.expand_path(\"#{file}/config/environment.rb\"))\n require \"rails\"\n require File.expand_path(\"#{file}/config/environment.rb\")\n if defined?(::Rails) && ::Rails.respond_to?(:application)\n # Rails 3\n ::Rails.application.eager_load!\n elsif defined?(::Rails::Initializer)\n # Rails 2.3\n $rails_rake_task = false\n ::Rails::Initializer.run :load_application_classes\n end\n elsif File.file?(file)\n require File.expand_path(file)\n end\n end",
"title": ""
},
{
"docid": "f77538051e40a227e9da37a9c5018612",
"score": "0.61149013",
"text": "def load(environment = nil)\n if !ENV[@env_name].nil?\n @yaml = Zlib::Inflate.inflate(\n Base64.strict_decode64(ENV[@env_name])\n )\n else\n if environment\n env_specific_file_path = \"#{@dir}/#{environment}.yml\"\n if File.exist?(env_specific_file_path)\n file_path = env_specific_file_path\n end\n end\n file_path ||= \"#{@dir}/default.yml\"\n\n @yaml = open(file_path).read\n end\n\n self\n end",
"title": ""
},
{
"docid": "4a095e7a8728b6d18cec03a696ac2192",
"score": "0.61146754",
"text": "def load!\n if !loaded?\n @loaded = true\n\n logger.info(\"environment\") { \"Loading configuration...\" }\n load_config!\n\n self\n end\n end",
"title": ""
},
{
"docid": "c682494a16a6622f22b103380ea76c53",
"score": "0.60997444",
"text": "def load_env(filename)\n Foreman::Env.new(filename).entries do |name, value|\n @env[name] = value\n end\n end",
"title": ""
},
{
"docid": "aea4126dc20f33f40861482599db5763",
"score": "0.6079432",
"text": "def load_enviroment\n file = ResqueMaster.config['environment'] || '.'\n\n if File.directory?(file) && File.exist?(File.expand_path(\"#{file}/config/environment.rb\"))\n require 'rails'\n require File.expand_path(\"#{file}/config/environment.rb\")\n\n if defined?(::Rails) && ::Rails.respond_to?(:application)\n # Rails 3\n ::Rails.application.eager_load!\n end\n elsif File.file?(file)\n require File.expand_path(file)\n end\n end",
"title": ""
},
{
"docid": "497c025984d347655ec5255684e2f43b",
"score": "0.60750777",
"text": "def config\n @config ||= YAML.load_file(config_file)[environment]\n end",
"title": ""
},
{
"docid": "6aa8119ab602f09e6d07549d9990e0e0",
"score": "0.60197",
"text": "def load_environment(environment_name)\n environment_name.strip!\n puts \"Attempting to load details of environment '#{environment_name}' from environment directory '#{@environments_directory}'\"\n environment = load_environments.select { | environment | environment.environment_name == environment_name && environment.is_valid_environment?}.first\n\n if !environment.nil?\n puts \"Successfully loaded environment '#{environment.environment_name}' from directory '#{environment.environment_directory}'\"\n else\n puts \"Cannot load environment '#{environment_name}' from directory '#{@environments_directory}'\"\n end\n\n environment\n end",
"title": ""
},
{
"docid": "08e5fb24f84e8c9382951cc52bb52bda",
"score": "0.60141325",
"text": "def setup_config(environment, config_file, applicaton_root)\n begin\n config = YAML::load(File.open(config_file))[environment]\n @api_key = config['api-key'] unless config['api-key'].nil?\n @ssl_enabled = config['ssl'] unless config['ssl'].nil?\n @log_level = config['log-level'] unless config['log-level'].nil?\n @enabled = config['enabled'] unless config['enabled'].nil?\n @remote_port = config['remote-port'].to_i unless config['remote-port'].nil?\n @remote_host = config['remote-host'] unless config['remote-host'].nil?\n @adapter_name = config['adapter'] unless config['adapter'].nil?\n @work_dir = config['work_dir'] unless config['work_dir'].nil?\n @send_user_data = config['send-user-data'] unless config['send-user-data'].nil?\n\n @applicaton_root = applicaton_root\n\n log_config_info\n rescue Exception => e\n raise ConfigurationException.new(\"Unable to load configuration #{config_file} for environment #{environment} : #{e.message}\")\n end\n end",
"title": ""
},
{
"docid": "dfed4ed49633d6d618b2f9e2216cb414",
"score": "0.60008353",
"text": "def load_config_files_for_enviroment( *args )\n options = args.extract_options\n\n args << File.join(\n File.dirname( args.first ), \":env.#{File.extension( args.first )}\"\n ) unless args.length > 1\n\n load_config_files( *(args << options) )\n end",
"title": ""
},
{
"docid": "1071425e8c68ed05dd36318a669f4b67",
"score": "0.5951827",
"text": "def parse_config_file\n if !File.exist?(options[:config_file])\n puts \"Configuration file is not found\"\n exit 1\n end\n\n configs = YAML.load_file(options[:config_file]).deep_symbolize_keys\n options.reverse_merge!(configs[environment.to_sym] || {})\n end",
"title": ""
},
{
"docid": "98c2d124a75c787f7cdba4afbebae5cb",
"score": "0.5942386",
"text": "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in parent directory, and no global config present\"\n end\n end\n begin\n @config = YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "d2d8156402f306b426b61df656c40b20",
"score": "0.59239256",
"text": "def prepare_environment(env)\n load_environment_properties(env)\n raise 'environment problem:environment not found' if @env_config.nil?\n create_required_files @env_config\n load_master_config @env_config['config_file']\n end",
"title": ""
},
{
"docid": "a166d1f3ef9b9aba4a8df10907856054",
"score": "0.5916362",
"text": "def ensure_has_environment_files()\n\n end",
"title": ""
},
{
"docid": "d9902b05083c5a6450373efe49bb56c0",
"score": "0.5909542",
"text": "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in current directory, and no global config present\"\n end\n end\n begin\n @config = ::YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "b5598e5c82b76d3bd93ddf45b6a24f94",
"score": "0.58774793",
"text": "def load_config(config_names)\n # Go trough each config_name\n config_names.each do |config_name|\n files = []\n # Split the filename\n ext = File.extname(config_name)\n dir, filename = File.split(config_name)\n basename = File.basename(filename, ext)\n\n # What are the suffixes to check\n suffixes = %w(debug test local)\n\n if ENV[\"TEST_ENV\"]\n @env = ENV[\"TEST_ENV\"]\n end\n\n # Do we have an environment\n unless @env.nil?\n # Add it to the suffixes\n suffixes.unshift(@env)\n end\n\n # Turn suffixes into files to try\n suffixes.each do |suffix|\n files << \"#{dir}#{File::SEPARATOR}#{basename}-#{suffix}#{ext}\"\n end\n files << config_name\n # Try all files in order\n files.each do |file|\n # Check if files exist\n if File.file?(file)\n begin\n # Try to load a config file\n self.add_config_from_file(file)\n break\n rescue Exception => e\n raise e\n end\n end\n end\n end\n # If we have an environment, the config should contain it\n if not @env.nil? and not self.has_config?(@env)\n raise \"Environment `#{@env}` doesn't exist in any of the config files\"\n end\n\n # If we don't have one then load the default\n if @env.nil? and self.has_config?(\"default_env\")\n tmp = self.config(\"default_env\")\n if self.has_config?(tmp)\n @env = tmp\n ENV['TEST_ENV'] = tmp\n else\n raise \"Default environment not present in any of the config files\"\n end\n end\n end",
"title": ""
},
{
"docid": "c7c2be03d3f81ec029c25d35884aafd5",
"score": "0.5854398",
"text": "def load_integ_environment_vars\n env_file = File.join(__dir__, 'config/local_env_integ.yml')\n env_key_vals = YAML.load_file(env_file)\n %w[\n SqsQueueIntegTests_QueueUrl\n SqsQueueIntegTests_QueueRegion\n SqsQueueIntegTests_AccessId\n SqsQueueIntegTests_SecretKey\n ].each { |var| ENV[var] = env_key_vals.fetch(var) }\nend",
"title": ""
},
{
"docid": "ad6defef8fa34d2e6aae55c828285cac",
"score": "0.5825082",
"text": "def load_yml_config(project)\r\n @saf_env = ENV[\"SAF_ENV\"] || \"default\"\r\n puts(\"SAF_ENV = #{@saf_env}\")\r\n\r\n env_yml_path = File.join(SAF::PROJECTS, project, SAF::PROJECT_ENV_YAML)\r\n\r\n unless File.exist?(env_yml_path) then\r\n # TODO: File not found error class\r\n raise \"#{msg_prefix} > Could not find #{env_yml_path}\"\r\n end\r\n\r\n all_yml_config = YAML.load(File.read(env_yml_path))\r\n # Throw an error if they specified an illegal install key.\r\n unless all_yml_config.key?(@saf_env) then\r\n raise ArgumentError.new(\"#{caller.first}\\n\"\\\r\n \"SAF env #{@saf_env} not found in project \"\\\r\n \"#{project}.\")\r\n end\r\n @yml_config = all_yml_config[@saf_env]\r\n end",
"title": ""
},
{
"docid": "1284bd5bda613e7c09b773d71b0544a0",
"score": "0.5799632",
"text": "def load_config_file(config_file = nil)\n curated_file = nil\n\n if config_file\n f = File.expand_path(config_file)\n if File.exists?(f)\n curated_file = f\n else\n raise \"Supplied config file (#{config_file}) doesn't seem to exist\"\n end\n else\n locations_to_try.each do |possible_conf_file|\n f = File.expand_path(possible_conf_file)\n if File.exists?(f)\n curated_file = f\n break\n end\n end\n\n if curated_file.nil?\n return HashWithIndifferentAccess.new\n end\n end\n\n YAML.load_file(curated_file).tap do |config|\n raise \"This is an invalid configuration file!\" unless config.class == Hash\n end\n end",
"title": ""
},
{
"docid": "ca23056f43a2638bc4e3d1a563ee9941",
"score": "0.5794615",
"text": "def load(config_file = nil)\n config_file ||= File.join(APP_DIR, \"config.rb\")\n if File.exists? config_file\n require config_file\n check_requirements\n else\n puts \"Could not find config.rb file in directory: #{APP_DIR}\"\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "3a5bb942669e91dbb53ced87f0f54210",
"score": "0.57819325",
"text": "def load_config( filename )\n\n fullname = \"#{Rails.application.root}/config/#{filename}\"\n begin\n config_erb = ERB.new( IO.read( fullname ) ).result( binding )\n rescue StandardError => ex\n raise( \"#{filename} could not be parsed with ERB. \\n#{ex.inspect}\" )\n end\n\n begin\n yml = YAML.load( config_erb )\n rescue Psych::SyntaxError => ex\n raise \"#{filename} could not be parsed as YAML. \\nError #{ex.message}\"\n end\n\n config = yml.symbolize_keys\n @configuration = config[ Rails.env.to_sym ].symbolize_keys || {}\n end",
"title": ""
},
{
"docid": "158adce30c84a3720367e951a2be8855",
"score": "0.5767804",
"text": "def load!(config_file)\n @config = YAML.load(config_file)\n\n # Ensure the Slack URL key is set.\n if @config[APPLICATION_URL_KEY].nil?\n raise Exception.new(\"Ruh roh, you need to define a an application URL using #{APPLICATION_URL_KEY} in your configuration!\")\n end\n\n # Ensure the Slack URL key is set.\n if @config[SLACK_URL_KEY].nil?\n raise Exception.new(\"Ruh roh, you need to define a Slack endpoint using #{SLACK_URL_KEY} in your configuration!\")\n end\n end",
"title": ""
},
{
"docid": "4313414630a15c8922bc718c5f5e5de5",
"score": "0.5734965",
"text": "def load_config\n conf = YAML.load_file(File.expand_path('../config.yml', File.dirname(__FILE__)))\n\n unless %w[basedir master filesync_cert filesync_cert_key filesync_ca_cert].all? { |s| conf.key?(s) && !conf[s].nil? }\n Pem.log_error('Missing required settings in config.yml', @logger)\n raise\n end\n\n conf['envdir'] = \"#{conf['basedir']}/environments\"\n conf['mod_dir'] = \"#{conf['basedir']}/modules\"\n\n return conf\n rescue StandardError\n err = 'Missing config file, or required configuration values - check config.yml'\n Pem.log_error(err, @logger)\n raise(err)\n end",
"title": ""
},
{
"docid": "f2b571c894ea19850261c8d6b4f25c7c",
"score": "0.5723819",
"text": "def validate_config()\n error_msg = help_string()\n if @config['env'] == nil then raise error_msg end\n fail = false\n @required_env_vars.each do |v|\n if @config['env'][v] == nil\n error_msg += \"\\n--->Missing env var #{v}\\n\"\n fail = true\n end\n end\n @required_config_sections.each do |v|\n if @config[v] == nil\n error_msg += \"\\n--->Missing config file section #{v}\\n\"\n fail = true\n end\n end\n if fail then raise error_msg end\n end",
"title": ""
},
{
"docid": "9cf061afe5fb302e8eb378c54ce69c5c",
"score": "0.5709058",
"text": "def config_file\n path = File.join 'config/frenetic.yml'\n config = YAML.load_file( path )\n env = ENV['RAILS_ENV'] || ENV['RACK_ENV']\n\n config[env] || {}\n rescue Errno::ENOENT, NoMethodError\n {}\n end",
"title": ""
},
{
"docid": "4a049c7d6be3bdae01e69d045ed8b642",
"score": "0.5686589",
"text": "def load_overrides\n if ENV['PARAMS_FILE'] && ENV['PARAMS_FILE'] != ''\n if File.readable?(ENV['PARAMS_FILE'])\n project_root = self.instance_variable_get(\"@project_root\")\n packaging_root = self.instance_variable_get(\"@packaging_root\")\n self.config_from_yaml(ENV['PARAMS_FILE'])\n self.instance_variable_set(\"@project_root\", project_root) if project_root\n self.instance_variable_set(\"@packaging_root\", packaging_root) if packaging_root\n else\n fail \"PARAMS_FILE was set, but not to the path to a readable file.\"\n end\n end\n end",
"title": ""
},
{
"docid": "0273338cb4d4d870c6a836ecef6b033b",
"score": "0.5685672",
"text": "def load_config(files)\n vconfig = {}\n files.each do |config_file|\n if File.exist?(config_file)\n optional_config = YAML.load_file(config_file)\n vconfig.merge!(optional_config) if optional_config\n end\n end\n resolve_jinja_variables(vconfig)\n end",
"title": ""
},
{
"docid": "8facbfb16cb59124a0055ff7a578efb3",
"score": "0.5675178",
"text": "def read_dot_env(envs_root)\n defaultEnvFile = '.env.development'\n puts \"going to read env file from root folder #{envs_root}\"\n\n env_files = get_env_files(envs_root, defaultEnvFile)\n target_env_file_path = ''\n\n for path in env_files\n if File.exist?(path)\n target_env_file_path = path\n break\n end\n end\n\n dotenv = begin\n # https://regex101.com/r/cbm5Tp/1\n dotenv_pattern = /^(?:export\\s+|)(?<key>[[:alnum:]_]+)=((?<quote>[\"'])?(?<val>.*?[^\\\\])\\k<quote>?|)$/\n\n if File.exist?(target_env_file_path)\n raw = File.read(target_env_file_path)\n else\n defaultEnvPath = File.expand_path(File.join(envs_root, \"../#{defaultEnvFile}\"))\n unless File.exist?(defaultEnvPath)\n # try as absolute path\n defaultEnvPath = defaultEnvFile\n end\n defaultRaw = File.read(defaultEnvPath)\n raw = defaultRaw + \"\\n\" + raw if defaultRaw\n end\n\n raw.split(\"\\n\").inject({}) do |h, line|\n m = line.match(dotenv_pattern)\n next h if m.nil?\n\n key = m[:key]\n # Ensure string (in case of empty value) and escape any quotes present in the value.\n val = m[:val].to_s.gsub('\"', '\\\"')\n h.merge(key => val)\n end\n rescue Errno::ENOENT\n puts('**************************')\n puts(\"*** Missing #{defaultEnvFile} file ****\")\n puts('**************************')\n return [{}, false] # set dotenv as an empty hash\n end\n\n [dotenv, false]\nend",
"title": ""
},
{
"docid": "a67310c0870fb559a25ec629908a1b87",
"score": "0.5672594",
"text": "def load_config\n config_file = File.join(Dir.home, \".assemblotron\")\n if File.exists? config_file\n @log.debug \"config file found at #{config_file}\"\n config = YAML::load_file(config_file)\n if config.nil?\n @log.warn \"config file malformed or empty\"\n return\n end\n @config = config.deep_symbolize\n end\n end",
"title": ""
},
{
"docid": "27429830b525f58c59bbee5c30c3b97a",
"score": "0.56476",
"text": "def read_env(file = '.env')\n if !ENV['ENV']\n File.open(file, \"r\").each_line do |line|\n a = line.chomp(\"\\n\").split('=',2)\n a[1].gsub!(/^\"|\"$/, '') if ['\\'','\"'].include?(a[1][0])\n eval \"ENV['#{a[0]}']='#{a[1] || ''}'\"\n end\n end\n end",
"title": ""
},
{
"docid": "0b704e38c0a37b33aa29bce0b76e8834",
"score": "0.56410754",
"text": "def env_exists? env\n return false if config.nil?\n config.has_key? env\n end",
"title": ""
},
{
"docid": "342c40e6783a31dca9ce5122daf522ba",
"score": "0.56380194",
"text": "def load_config\n cfg = File.open(CONFIG) { |yf| YAML::load( yf ) } if File.exists?(CONFIG)\n # => Ensure loaded data is a hash. ie: YAML load was OK\n if cfg.class != Hash\n raise \"ERROR: Configuration - invalid format or parsing error.\"\n else\n if cfg['login'].nil?\n raise \"ERROR: Configuration: login not defined.\"\n end\n end\n\n return cfg\nend",
"title": ""
},
{
"docid": "f0aee85194ff5269be62a4aee1c58e48",
"score": "0.561981",
"text": "def load(options = {})\n @provider_dir = Path.provider\n\n # load base\n @base_services = load_all_json(Path.named_path([:service_config, '*'], Path.provider_base), Config::Tag)\n @base_tags = load_all_json(Path.named_path([:tag_config, '*'], Path.provider_base), Config::Tag)\n @base_common = load_json( Path.named_path(:common_config, Path.provider_base), Config::Object)\n @base_provider = load_json( Path.named_path(:provider_config, Path.provider_base), Config::Provider)\n\n # load provider\n @nodes = load_all_json(Path.named_path([:node_config, '*'], @provider_dir), Config::Node)\n @common = load_json( Path.named_path(:common_config, @provider_dir), Config::Object)\n @secrets = load_json( Path.named_path(:secrets_config, @provider_dir), Config::Secrets)\n @common.inherit_from! @base_common\n\n # For the default environment, load provider services, tags, and provider.json\n log 3, :loading, 'default environment...'\n env('default') do |e|\n e.services = load_all_json(Path.named_path([:service_config, '*'], @provider_dir), Config::Tag, :no_dots => true)\n e.tags = load_all_json(Path.named_path([:tag_config, '*'], @provider_dir), Config::Tag, :no_dots => true)\n e.provider = load_json( Path.named_path(:provider_config, @provider_dir), Config::Provider, :assert => true)\n e.services.inherit_from! @base_services\n e.tags.inherit_from! @base_tags\n e.provider.inherit_from! @base_provider\n validate_provider(e.provider)\n end\n\n # create a special '_all_' environment, used for tracking the union\n # of all the environments\n env('_all_') do |e|\n e.services = Config::ObjectList.new\n e.tags = Config::ObjectList.new\n e.provider = Config::Provider.new\n e.services.inherit_from! env('default').services\n e.tags.inherit_from! env('default').tags\n e.provider.inherit_from! env('default').provider\n end\n\n # For each defined environment, load provider services, tags, and provider.json.\n environment_names.each do |ename|\n next unless ename\n log 3, :loading, '%s environment...' % ename\n env(ename) do |e|\n e.services = load_all_json(Path.named_path([:service_env_config, '*', ename], @provider_dir), Config::Tag, :env => ename)\n e.tags = load_all_json(Path.named_path([:tag_env_config, '*', ename], @provider_dir), Config::Tag, :env => ename)\n e.provider = load_json( Path.named_path([:provider_env_config, ename], @provider_dir), Config::Provider, :env => ename)\n e.services.inherit_from! env('default').services\n e.tags.inherit_from! env('default').tags\n e.provider.inherit_from! env('default').provider\n validate_provider(e.provider)\n end\n end\n\n # apply inheritance\n @nodes.each do |name, node|\n Util::assert! name =~ /^[0-9a-z-]+$/, \"Illegal character(s) used in node name '#{name}'\"\n @nodes[name] = apply_inheritance(node)\n end\n\n # do some node-list post-processing\n cleanup_node_lists(options)\n\n # apply control files\n @nodes.each do |name, node|\n control_files(node).each do |file|\n begin\n node.eval_file file\n rescue ConfigError => exc\n if options[:continue_on_error]\n exc.log\n else\n raise exc\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "38833adc7c59a55c5b18cee00c952d1d",
"score": "0.5600682",
"text": "def environment\n return @vars unless @vars.nil?\n\n # If not set, Try to find them...\n glob_path = File.join(@deployment_home, @settings.env_file_glob_path)\n regexp_find = glob_path.gsub(/\\*/, '(.*)')\n Dir[glob_path].each do | file_name |\n # Get the environment name from the file part of the glob path:\n # e.g. given ./environments/ci_mgt/kb8or.yaml\n # get ci_mgt from ./environments/*/kb8or.yaml\n /#{regexp_find}/.match(file_name)\n env_name = $1\n if env_name == @env_name\n debug \"env=#{env_name}\"\n # Ensure we set the defaults as vars BEFORE we add environment specifics:\n @vars = @settings.defaults\n env_vars = Context.resolve_env_file(file_name)\n @vars = @vars.merge(env_vars)\n @vars = @vars.merge(@overridden_vars)\n @vars['env'] = env_name\n @environment_file = file_name\n break\n end\n end\n # Now finaly, update the settings now we know the environment!\n unless @vars\n @vars = {}\n end\n @settings = @settings.new(@vars)\n update_k8context\n debug \"vars=#{vars}\"\n @vars\n end",
"title": ""
},
{
"docid": "0827bb4820716797f61d4b3a93c6c68b",
"score": "0.5589606",
"text": "def config_load(key, may_be_nil=false)\n conf = File.join(DIR_NAME, '..', 'config.private.yaml')\n conf = File.join(DIR_NAME, '..', 'config.yaml') unless File.exists?(conf)\n value = YAML.load_file(conf)[key]\n assert_not_nil(value, \"#{key} is set in config.yaml\") unless may_be_nil\n value\n end",
"title": ""
},
{
"docid": "501b3f46936dbd7f32e5203ec6c40299",
"score": "0.55875766",
"text": "def look_for_environment_variables\n unless ENV[\"GOOGLE_CLOUD_KEYFILE\"].nil?\n return File.read(ENV[\"GOOGLE_CLOUD_KEYFILE\"])\n end\n\n ENV[\"GOOGLE_CLOUD_KEYFILE_JSON\"]\n end",
"title": ""
},
{
"docid": "62a2b7c51280130fd86c73bef94d1208",
"score": "0.5582046",
"text": "def load\n Dotenv.load(\n root.join(\".env.local\"),\n root.join(\".env.#{Rails.env}\"),\n root.join(\".env\")\n )\n end",
"title": ""
},
{
"docid": "00b93f915a56ce179e8d886a3632208d",
"score": "0.55758095",
"text": "def load_config_file\n \tproject_name = ENV['PROJECT_NAME']\n \tconfig_file_path = \"#{@configs_folder_path}#{project_name}.yaml\"\n\tif !File.exists?(config_file_path)\n log_message(\"No '#{project_name}.yaml' file found in configs directory.\")\n exit\n end\n @config = YAML.load_file(config_file_path)\n end",
"title": ""
},
{
"docid": "e0fd7561bf97bc9e4a622f45bf9d167c",
"score": "0.5563929",
"text": "def read\n unless File.exist?(config_file)\n raise UserError, \"Kitchen YAML file #{config_file} does not exist.\"\n end\n\n Util.symbolized_hash(combined_hash)\n end",
"title": ""
},
{
"docid": "1c36ab74e64e46b0d3f260c271f46200",
"score": "0.5554109",
"text": "def with_env_vars(filename = nil, &_block)\n original_env_vars = ENV.to_hash\n Dotenv.load(filename) if filename\n yield\nensure\n ENV.replace(original_env_vars)\nend",
"title": ""
},
{
"docid": "07486820e924bb79eb19377c175f4449",
"score": "0.55524147",
"text": "def load_config!\n cfg_data = begin\n YAML.load(File.open(CONFIG_DIR + GLOBAL_CONFIG))\n rescue Errno::ENOENT\n Hash.new\n end\n __load_config(DEFAULTS.merge(cfg_data))\n end",
"title": ""
},
{
"docid": "0d33729d807e9acbacc6b15a4855f11c",
"score": "0.5548833",
"text": "def initialize\n # Load configuration file\n require 'yaml'\n @env = HashWithIndifferentAccess.new(YAML.load_file(File.join(File.dirname(__FILE__), '..', 'config', 'environments', \"#{ENV['RACK_ENV']}.yml\")))\n end",
"title": ""
},
{
"docid": "97bc349aff8f3cc2489073b86f8076be",
"score": "0.55382395",
"text": "def load_env\n Inq::Text.puts \"Using configuration from environment variables.\"\n\n gh_token = ENV[\"INQ_GITHUB_TOKEN\"] || ENV[\"HOWIS_GITHUB_TOKEN\"]\n gh_username = ENV[\"INQ_GITHUB_USERNAME\"] || ENV[\"HOWIS_GITHUB_USERNAME\"]\n\n raise \"INQ_GITHUB_TOKEN environment variable is not set\" \\\n unless gh_token\n raise \"INQ_GITHUB_USERNAME environment variable is not set\" \\\n unless gh_username\n\n load({\n \"sources/github\" => {\n \"username\" => gh_username,\n \"token\" => gh_token,\n },\n })\n end",
"title": ""
},
{
"docid": "4898da9351ea1af748d9194b3bfa87b4",
"score": "0.5509011",
"text": "def load!(*filenames)\n with(*filenames) do |f|\n env = Environment.new(f, true)\n instrument(\"dotenv.load\", env: env) { env.apply }\n end\n end",
"title": ""
},
{
"docid": "145babda1bb345c09d3bce1d830ee0cc",
"score": "0.5507405",
"text": "def load_yml\n cfg_file=\"#{::Rails.root}/config/mcommunity.yml\"\n\n begin\n mcommunity_erb = ERB.new(IO.read(cfg_file)).result(binding)\n rescue StandardError, SyntaxError => e\n raise(\"#{cfg_file} could not be parsed with ERB. \\n#{e.inspect}\")\n end\n\n begin\n mcommunity_yml = YAML::load(mcommunity_erb)\n rescue => e\n raise(\"#{cfg_file} was found, but could not be parsed.\\n#{e.inspect}\")\n end\n\n if mcommunity_yml.nil? || !mcommunity_yml.is_a?(Hash)\n raise(\"#{cfg_file} was found, but was blank or malformed.\\n\")\n end\n\n begin\n raise \"The #{::Rails.env} environment settings were not found in #{cfg_file}\" unless mcommunity_yml[::Rails.env]\n mcommunity_cfg = mcommunity_yml[::Rails.env].symbolize_keys\n end\n\n mcommunity_cfg\nend",
"title": ""
},
{
"docid": "90aa6285741e0e3afe45e5600bc71745",
"score": "0.55073845",
"text": "def load_app_config\n user_configs = read_yaml_file(USER_CONFIGS)\n environment_configs = Maybe(ENV).or_else({})\n\n # Order: user, env\n config_order = [user_configs, environment_configs]\n\n configs = config_order.inject { |a, b| a.merge(b) }\n OpenStruct.new(configs.symbolize_keys)\n end",
"title": ""
},
{
"docid": "377378fd1bd5a884c24f7a0ee090ba11",
"score": "0.5506635",
"text": "def check_config_and_export_to_env\n check_config\n export_config_to_env\n end",
"title": ""
},
{
"docid": "8a3e74227a7662a9ff74bcf71aab948b",
"score": "0.5502032",
"text": "def load_config_file\n raise \"No config file set\" if config_file.nil?\n raise \"File #{config_file} does not exist\" unless File.file?(config_file)\n @config = YAML.load_file(config_file)\n @config_file_loaded = true\n @config.each { |k, v| send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "bfb2fd7da576f8c14769eb7e70d305d3",
"score": "0.54993767",
"text": "def load_config_hash(provided_config)\n @config = provided_config\n if @config[:filename].nil? && !default_config_filename.nil?\n @config[:filename] = default_config_filename\n create_config_file(@config[:filename]) unless File.file?(@config[:filename])\n end\n end",
"title": ""
},
{
"docid": "94812e5bb0e8f4bbd96ac608d3aafe02",
"score": "0.5495864",
"text": "def load_environment!\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "913bc295b2fed1ad518f65d30b738446",
"score": "0.5490374",
"text": "def config_from_env\n CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env_vars|\n if value = option_from_env(option)\n env_vars[option] = value\n end\n end\n end",
"title": ""
},
{
"docid": "f369edff00612cd035f0c13997a4122d",
"score": "0.5462382",
"text": "def fetch\n cfg = {}\n cfg = YAML.load_file(@default) if File.file?(@default)\n\n local = {}\n if File.file?(@local)\n # Check for bad user input in the local config.yml file.\n local = YAML.load_file(@local)\n unless local.is_a?(Hash)\n raise StandardError, \"Wrong format for the config-local file!\"\n end\n end\n\n hsh = strict_merge_with_env(cfg, local)\n add_enabled(hsh)\n end",
"title": ""
},
{
"docid": "2fb8b2477671e5be2b9328b01ff79f31",
"score": "0.54479015",
"text": "def load_from_alternate(global_environment, alternate)\n return nil unless alternate # handles nil/false values\n if alternate.kind_of?(Hash)\n @loaded_from = nil # can't retrieve alternate configs if it's been overridden!\n config = alternate.dup\n config.extend(AlternateConfig)\n config.config_file = self\n config\n elsif File.exist?(alternate)\n load_from_file(alternate, global_environment)\n else\n load_from_file(file, alternate)\n end\n end",
"title": ""
},
{
"docid": "83012d7508e7970e18ec89405cff9ca1",
"score": "0.54426724",
"text": "def example_env_vars\n Parser.call(read)\n rescue Errno::ENOENT, FormatError\n {}\n end",
"title": ""
},
{
"docid": "d6e5f42921a5557277e1503e1045d8b9",
"score": "0.5434643",
"text": "def env_config\n @env_config ||= {}\n end",
"title": ""
},
{
"docid": "279ff500412893d6b366aab6cf2ee9e1",
"score": "0.5430664",
"text": "def load(rails_env)\n @settings = YAML.load(ERB.new(File.read(@config_filepath)).result)[rails_env].symbolize_keys\n end",
"title": ""
},
{
"docid": "741f4033b65a3848e5ff07bbaf1670aa",
"score": "0.5429275",
"text": "def load_environment(tasks)\n environment = tasks[:environment]\n if environment.nil?\n Kernel.abort(\"Unable to load details of environment '#{tasks[:environment_name]}'\")\n end\n environment\nend",
"title": ""
},
{
"docid": "9e62f566325d6baa2b351c90c4f5d0dc",
"score": "0.54210174",
"text": "def config options={}\n options = DEFAULT_OPTS.merge(options)\n config = Path.yaml_file(options[:file])\n unless options[:environment].nil? || options[:environment].empty?\n config[options[:environment]]\n else\n config\n end\n end",
"title": ""
},
{
"docid": "ae0d914241f8c8d071a1a8260b18a04a",
"score": "0.5394171",
"text": "def parse_cloud_config(env = nil)\n cloud_config = YAML.load(File.read('config/cloud.yml'))\n check_cloud_config(cloud_config)\n\n if env\n unless cloud_config[env]\n fail \"Environement `#{env}` missing in config/cloud.yml\"\n end\n return cloud_config[env]\n end\n return cloud_config\n end",
"title": ""
},
{
"docid": "9ad47ab2409786dc491197bb98288b2d",
"score": "0.53854895",
"text": "def ensure_config\n return if @config_found\n found = CONFIG_FILES.all? {|f| File.exists? \"#{@options[:config_path]}/#{f}\" }\n found ? @config_dir = true : config_not_found\n end",
"title": ""
},
{
"docid": "757e332bfab2533aebe65baa9bc67c0a",
"score": "0.538054",
"text": "def validate(environment, cookbooks) # rubocop:disable CyclomaticComplexity\n env = nil\n file = %W{environments/#{environment}.rb environments/#{environment}.json}.find { |f| File.exist?(f) }\n environment = environment.split(\"/\").last if environment =~ /\\// # pull out directories\n if file\n case file\n when /\\.json$/\n env = Chef::JSONCompat.from_json(IO.read(file))\n when /\\.rb$/\n env = do_ruby_environment_file(file)\n end\n if env.name != environment\n STDERR.puts \"ERROR: Environment '#{environment}' listed in the manifest does not match the name '#{env.name}' within the #{file} file.\"\n exit(-1)\n end\n env.cookbook_versions.keys.each do |dep|\n do_cookbook_version(cookbooks, dep, environment)\n end\n else # environment is not here\n STDERR.puts \"ERROR: Invalid Environment '#{environment}' listed in the manifest but not found in the environments directory.\"\n exit(-1)\n end\n end",
"title": ""
},
{
"docid": "df9e8ad35576cbe84d99cf04630e4c32",
"score": "0.53795856",
"text": "def load(filename, dontValidateDirs = false)\n rc = true\n if File.exists?(filename)\n File.open(filename){ |fh|\n yaml = YAML::load(fh)\n return handleYaml(yaml, dontValidateDirs)\n }\n else\n $logger.info \"Loading config file failed: file '#{filename}' doesn't exist.\"\n end\n rc\n end",
"title": ""
},
{
"docid": "66d39f0697e9323f2b3cddc0af03371f",
"score": "0.53390735",
"text": "def load_config()\n rspec_file = '.rspec' \n env = ENV['ENV_NAME']\n puts \"\\n>Loading RSpec configuration for: \" + env.to_s\n full_config = YAML::load(File.open('./config/rspec.yaml')) # full YML\n puts \"\\n>Loaded RSpec configuration: \" + full_config[env].to_s # only section of YML that is relevant for the particular environment\n return full_config[env] # only section of YML that is relevant for the particular environment\nend",
"title": ""
},
{
"docid": "8d8892632c4137436c14b4eda65b6bd7",
"score": "0.53373957",
"text": "def initialize(filename, environment = nil)\n raise \"Config #{filename} not found\" unless File.exist? filename\n @filename = filename\n @environment = environment || current_environment\n end",
"title": ""
},
{
"docid": "3d11851daec0df56bca2057a7f92a1c6",
"score": "0.5328632",
"text": "def load_config\n path = File.expand_path(@config_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n load_default_config\n end\n end",
"title": ""
},
{
"docid": "9f5c0b346782a251cbd19489607b765f",
"score": "0.5326355",
"text": "def required_keys_and_proper_remote_configuration_repo?\n return @setup_correctly unless @setup_correctly.nil?\n\n unless no_missing_keys?\n logger.debug(\"Missing environment variables.\")\n return false\n end\n\n unless remote_configuration_repository_valid?\n logger.debug(\"remote configuration repo is not valid\")\n return false\n end\n\n @setup_correctly = true\n return @setup_correctly\n end",
"title": ""
},
{
"docid": "d4172d2f49478a496de53fc1368b2236",
"score": "0.53228223",
"text": "def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end",
"title": ""
},
{
"docid": "a7467ffdaf33580d70cc37b9e23e632f",
"score": "0.5322071",
"text": "def config_read\n f = File.expand_path(CONFIG_FILE)\n return unless File.readable? f\n\n hash = loadYML(f)\n @used_dirs = hash['DIRS']\n @visited_files = hash['FILES']\n @bookmarks = hash['BOOKMARKS']\n @used_dirs.concat get_env_paths\nend",
"title": ""
},
{
"docid": "afcb571262da46a2745a70862197971e",
"score": "0.5313866",
"text": "def load_env(path)\n File.readlines(path).each do |l|\n next if l.empty? || l[0] == '#'\n\n m = l.match(/(export)?[[:blank:]]*([^=]+)=([^[[:blank:]]]+)$/)\n\n next unless m\n\n ENV[m[2]] = m[3].delete(\"\\n\") if m[2] && m[3]\n end\n rescue StandardError\n end",
"title": ""
},
{
"docid": "105d5162805389d6852914af33d479f7",
"score": "0.5310343",
"text": "def load_config(global)\n config_file_path = File.join(Dir.home, CONFIG_FILE_NAME)\n\n if File.exists?(config_file_path)\n require 'yaml'\n file_settings = YAML.load_file(config_file_path)\n global[:config].merge!(file_settings)\n end\n\nend",
"title": ""
},
{
"docid": "876a75a3606ed36cdcd99f906a497721",
"score": "0.53073204",
"text": "def load(config_filename)\n eval(IO.read(config_filename), binding, config_filename)\n (local_variables - [\"config_filename\"]).each { |v| self[v] = eval(v, binding) }\n self\n end",
"title": ""
},
{
"docid": "d4d7937fde6569a62b21db2dc7172a37",
"score": "0.5304795",
"text": "def load_config\n if params[:config].given?\n @config = File.open(File.expand_path(params[:config].value)) { |f| JSON.load(f) }\n\n @config.each do |key, value|\n if params.has_key?(key) and params[key].values == params[key].defaults\n params[key].values = [*value]\n params[key].given = true\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "62170802afeb67fd23a3a493b6a9f6b6",
"score": "0.52919155",
"text": "def has_env?(variable)\n # Make sure the configured configuration is loaded, if possible\n init\n\n if @env.nil?\n return false\n end\n return self.has_config?(\"#{@env}.#{variable}\")\n end",
"title": ""
},
{
"docid": "a5c0380d9d4c72be1e1298fa217f12b6",
"score": "0.52864647",
"text": "def read_config(loc)\n if PDK::Util::Filesystem.file?(loc) && PDK::Util::Filesystem.readable?(loc)\n require 'yaml'\n\n begin\n YAML.safe_load(PDK::Util::Filesystem.read_file(loc), [], [], true)\n rescue Psych::SyntaxError => e\n PDK.logger.warn _(\"'%{file}' is not a valid YAML file: %{problem} %{context} at line %{line} column %{column}\") % {\n file: loc,\n problem: e.problem,\n context: e.context,\n line: e.line,\n column: e.column,\n }\n {}\n end\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "92f36d2e331b57a659ccc55ad13b1b6d",
"score": "0.52825516",
"text": "def load_rails_environment(base_path)\n Dir.chdir(base_path) do\n require File.join(base_path, 'config/environment')\n require 'action_mailer/ar_mailer'\n end\n rescue LoadError => e\n puts e\n raise RailsEnvironmentFailed\n end",
"title": ""
},
{
"docid": "99cf448bd56c6cf0ee74c3aa916fe5fb",
"score": "0.52743334",
"text": "def load_config\n if !File.exists?('config.yml')\n raise \"The config.yml file is not present in the current directory. Run -setup to configure this file.\"\n end\n\n # Load the config.yml configuration file.\n config = YAML::load_file('config.yml')\n\n # Create the ars models context given values from the config.yml file.\n context = ArsModels::Context.new({\n :username => config['username'],\n :password => config['password'],\n :server => config['server'],\n :port => config['port']\n })\n context\nend",
"title": ""
},
{
"docid": "47d666e1fd8a305188673146ac599472",
"score": "0.52690566",
"text": "def validate_keys\n return if Util::Configuration.is_valid?\n logger.error('==== Please set all environment variables before starting the server ====')\n exit\n end",
"title": ""
}
] |
48e58220f8f51e4a1743dacddb0ae248
|
Returns all duplicates, including the first instance of the duplicated elements.
|
[
{
"docid": "255be5810735caa70ee771c3344e2f7a",
"score": "0.74754757",
"text": "def duplicates(collection)\n grouped_duplicates(collection).flatten\n end",
"title": ""
}
] |
[
{
"docid": "e1e75e3db6268ab7deadc7f808efa560",
"score": "0.7317296",
"text": "def grouped_duplicates(collection)\n collection.group_by { |item| item }.values.reject(&:one?)\n end",
"title": ""
},
{
"docid": "d9eb96d42c29f0af0963919a413461a4",
"score": "0.7310139",
"text": "def all_duplicates(a)\n a.uniq.select{|v| a.select{|b| b == v}.count > 1}\n end",
"title": ""
},
{
"docid": "eb005fe7c175b0172fffa1c466349d00",
"score": "0.72974604",
"text": "def nondupes(array)\n new_array = []\n array.each do |elem| \n if array.count(elem) == 1\n new_array << elem \n end\n end\n new_array\nend",
"title": ""
},
{
"docid": "562ac2f4dd4eee38fed621b464c4a5fd",
"score": "0.7288036",
"text": "def duplicates(arr)\n values = Set.new\n copies = Set.new\n\n arr.each do |value|\n if values.include?(value)\n copies << value\n else\n values << value\n end\n end\n\n return copies\nend",
"title": ""
},
{
"docid": "42ebe01af43cab616edf8b3d69a40210",
"score": "0.7274486",
"text": "def find_dups2\n uniq.select{ |e| (self-[e]).size < self.size - 1 }\n end",
"title": ""
},
{
"docid": "42ebe01af43cab616edf8b3d69a40210",
"score": "0.7274486",
"text": "def find_dups2\n uniq.select{ |e| (self-[e]).size < self.size - 1 }\n end",
"title": ""
},
{
"docid": "5acdcb2be3adae0682955c2e27d559c5",
"score": "0.7055772",
"text": "def grouped_duplicates(collection); end",
"title": ""
},
{
"docid": "2ee2b42c81954d1e8813adc91d9b5f02",
"score": "0.6959955",
"text": "def ext_repeat_values\n group_by { |e| e }.select { |_, v| v.size > 1 }.map(&:first)\n end",
"title": ""
},
{
"docid": "b10d7d6d6c5e86b7e8f981aa708f975b",
"score": "0.6910229",
"text": "def duplicates(collection); end",
"title": ""
},
{
"docid": "447615ef3a8725bff41c4e4107b07b33",
"score": "0.6907403",
"text": "def find_duplicate(arr)\n\tarr.select{|e| arr.count(e) > 1}.uniq\nend",
"title": ""
},
{
"docid": "d4c3549f9c24c8619f7b7f6872e2a5ec",
"score": "0.68235475",
"text": "def consecutive_duplicates(collection); end",
"title": ""
},
{
"docid": "2d78dd6550099e1dd15b8a066d2d7e43",
"score": "0.68105894",
"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": "4d7d2eec137ff2283e56504c2d2bd77d",
"score": "0.6794778",
"text": "def duplicate_names\n array = all.pluck(:name)\n array.select{|element| array.count(element) > 1 }.uniq\n end",
"title": ""
},
{
"docid": "4d7d2eec137ff2283e56504c2d2bd77d",
"score": "0.6793923",
"text": "def duplicate_names\n array = all.pluck(:name)\n array.select{|element| array.count(element) > 1 }.uniq\n end",
"title": ""
},
{
"docid": "aae5fd654b3989a0f47072379a3bc707",
"score": "0.67768145",
"text": "def just_once(original_array)\n unique = []\n i = 0\n while i < original_array.length\n unique.push(original_array[i]) unless unique.include?(original_array[i])\n i += 1\n end\n return unique\n end",
"title": ""
},
{
"docid": "70ce7f01a12f8299b3a0246761a839e8",
"score": "0.6772147",
"text": "def dupitems(arr)\n puts arr.reject { |e| arr.rindex(e) == arr.index(e) }.uniq\nend",
"title": ""
},
{
"docid": "8c55906ba694b1fc898465340154043f",
"score": "0.67673635",
"text": "def non_duplicated_values(values)\n results = []\n values.each do |value|\n results << value if values.count(value) == 1\n end\n results\nend",
"title": ""
},
{
"docid": "b32954e0b813fb4eaf53d79ba3127684",
"score": "0.6743372",
"text": "def remove_duplicates(list)\n list.inject({}){ |ele, n| ele[n] = nil; ele }.keys\nend",
"title": ""
},
{
"docid": "944368e768fe2c856d4ef42b55e1b420",
"score": "0.67302036",
"text": "def remove_duplicates(list)\n d = list.clone\n dups = find_duplicates(list).each_with_object([]) { |(k, v), a| a << k if v > 1 }\n dups.each { |i| d.delete(i) }\n d\nend",
"title": ""
},
{
"docid": "ec28c1fca74f3e4f8735e5591068ec87",
"score": "0.6704864",
"text": "def first_duplicate(a)\n a.uniq.each do |i|\n return i if a.select {|j| i == j}.count > 1\n end\n nil\n end",
"title": ""
},
{
"docid": "71ee3ca1144dd3407ff5f596a36ac438",
"score": "0.66923547",
"text": "def my_uniq\n unique = []\n self.each do |ele|\n unique << ele if !unique.include?(ele)\n end\n unique\n end",
"title": ""
},
{
"docid": "4f17b3921141faffeedd1444d48976bf",
"score": "0.66710585",
"text": "def nondupes(array)\n array.map do |elem| \n array.count(elem) == 1\n \n end\n \nend",
"title": ""
},
{
"docid": "6ffa0447593a08fd0a0e3efd4a604e3d",
"score": "0.66376495",
"text": "def find_dup(array)\n checked_array = []\n array.each do |el|\n if checked_array.include?(el)\n return el\n else\n checked_array << el\n end\n end\nend",
"title": ""
},
{
"docid": "3e17d65a8e6a9b0aac4bc54b16fad7bb",
"score": "0.6635467",
"text": "def remove_duplicates(array)\n uniq_array = []\n array.each {|value| uniq_array << value unless uniq_array.include?(value) }\n return uniq_array\nend",
"title": ""
},
{
"docid": "e4f506b4ad7e44893c2342882a4b026c",
"score": "0.6604302",
"text": "def consecutive_duplicates(collection)\n grouped_duplicates(collection).flat_map { |items| items[1..-1] }\n end",
"title": ""
},
{
"docid": "6adcf425b339f7033e2f2109c7045e66",
"score": "0.65792763",
"text": "def distinct\n self.map('lambda{|x| [x, nil]}')\n .reduce_by_key('lambda{|x,_| x}')\n .map('lambda{|x| x[0]}')\n end",
"title": ""
},
{
"docid": "425f9078356b86bc86b9eff42d21870f",
"score": "0.65761185",
"text": "def find_duplicates_set_approach(array)\n duplicates = []\n set = Set.new(array)\n \n set\n \nend",
"title": ""
},
{
"docid": "d797b48f1e7f8e09f3a53e3f2a3d46f8",
"score": "0.6567767",
"text": "def non_duplicated_values(values)\n values.select{|item| values.count(item) == 1}.uniq\nend",
"title": ""
},
{
"docid": "b976032561e253919c579a77271fab70",
"score": "0.6557498",
"text": "def distinct\n result = empty_dup\n uniq_rows = rows.uniq\n uniq_rows.each do |row|\n result << row\n end\n result\n end",
"title": ""
},
{
"docid": "00e7a5671b30a5e6ce28436106249244",
"score": "0.65453947",
"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": "8e4c4f0a8f8ac339c66b424a4a722de5",
"score": "0.65425646",
"text": "def single_values\n repeats.select { |value, repeats| repeats.count == 1 }.map(&:first).sort.reverse\n end",
"title": ""
},
{
"docid": "7dd09428104881475d37813775b03766",
"score": "0.6516705",
"text": "def remove_duplicates(list)\n list.sort!\n first_element = list.first\n previous_element = list.first\n list[1..-1].map do |element|\n element = nil if element == previous_element\n previous_element = element\n end.compact.unshift(list.first)\nend",
"title": ""
},
{
"docid": "d734000bb62b10a3a107fc9df69cc253",
"score": "0.6515625",
"text": "def non_duplicated_values(values)\n values.find_all do |e|\n if values.count(e) > 1\n values.delete(e)\n end\n end\n values\nend",
"title": ""
},
{
"docid": "0f6efb7c4986c05b40b5b7f3fb43049a",
"score": "0.6515088",
"text": "def find_dup(array)\n array.each_with_index do |el, idx|\n array.slice(idx+1..-1).each { |val| return el if el == val }\n end\nend",
"title": ""
},
{
"docid": "b42b672ca6d1ee37fc0a6fc628db5bb7",
"score": "0.64983046",
"text": "def remove_duplicates(array)\nend",
"title": ""
},
{
"docid": "584db259e408dba9433067dcc2a7ac89",
"score": "0.6489095",
"text": "def get_non_duplicated(given_array)\n non_repeated_values=[\"\"]\n non_repeated_index=0\n outer_index=0\n given_array.each do |first_num|\n flag_for_a_duplicate=true\n inner_index=0\n given_array.each do |second_num|\n if (first_num == second_num) && (inner_index \\\n != outer_index)\n flag_for_a_duplicate=false \n end \n inner_index +=1\n end\n if flag_for_a_duplicate\n non_repeated_values[non_repeated_index]=first_num\n non_repeated_index +=1\n end\n outer_index +=1\n end\n non_repeated_values \nend",
"title": ""
},
{
"docid": "13e6cd50c024eb49d93acb167c90ae41",
"score": "0.6487022",
"text": "def rem_dup(list)\n list.uniq!\n return list\nend",
"title": ""
},
{
"docid": "8737cf13365eb21e4d49840ed675e4de",
"score": "0.64869547",
"text": "def non_duplicated_values(values)\n uniques = []\n for number in values.uniq.each do\n if values.count(number) == 1\n uniques.push(number)\n end\n end\n return uniques\nend",
"title": ""
},
{
"docid": "0689d0054266588123b81e937af8ab6a",
"score": "0.64789855",
"text": "def non_duplicated_values(values)\n values.find_all { |x| values.count(x) == 1 }\nend",
"title": ""
},
{
"docid": "b5ac8597fb0f5d2a9ce77470de8f7bca",
"score": "0.6468389",
"text": "def preserving_uniq(sorted)\n result = []\n elements = sorted.uniq\n sorted.each do |element|\n if elements.include?(element)\n result << element\n elements.delete(element)\n end\n end\n result\n end",
"title": ""
},
{
"docid": "e3457dde9066e7495b83a5754f327afe",
"score": "0.64367574",
"text": "def uniq\n distinct\n end",
"title": ""
},
{
"docid": "c006da688e7ac70837bf448aa76e0449",
"score": "0.6408387",
"text": "def uniq(array)\n finalArray = []\n array.each do |element|\n if !finalArray.include?(element)\n finalArray.push(element)\n end\n end\n return finalArray\nend",
"title": ""
},
{
"docid": "6ebf1ba95f12b9f2ec9794666f339f62",
"score": "0.6402168",
"text": "def make_uniq_by(&block)\n result = []\n self.each do |e|\n unless result.any?{|x| yield(x,e)} then result.push(e) end\n end\n return result\n end",
"title": ""
},
{
"docid": "2a618d60b097a91ed0657fbbf79be0ff",
"score": "0.6401436",
"text": "def find_dup(array)\n while array.size > 0\n el = array.shift\n array.each do |val|\n return el if val == el\n end\n end\nend",
"title": ""
},
{
"docid": "cc12c1d0986c19fa8603dfb9ed96eff4",
"score": "0.63998276",
"text": "def duplicate(array)\n array.uniq!\nend",
"title": ""
},
{
"docid": "96526b0048bae8dcfdfd7191435300a3",
"score": "0.6384714",
"text": "def my_uniq\n unique = []\n each_index { |i| unique << self[i] unless unique.include?(self[i]) }\n unique\n end",
"title": ""
},
{
"docid": "89897cbb87c8811ff11c1a374abd9da0",
"score": "0.6379959",
"text": "def dupe_indices(arr)\n idxs = Hash.new { |h, k| h[k] = [] }\n \n arr.each_with_index do |ele, i|\n idxs[ele] << i\n end\n\n return idxs.select { |ele, arr| arr.length > 1 }\nend",
"title": ""
},
{
"docid": "b21be560079b79775c8eee7ce27ce861",
"score": "0.6379366",
"text": "def non_duplicated_values(values)\n duplicates = values.find_all { |item| values.count(item) > 1 }.uniq\n duplicates.each do |item|\n values.delete(item)\n end\n return values\nend",
"title": ""
},
{
"docid": "08e9f4a57d200bc246f89af01d0407e6",
"score": "0.6361607",
"text": "def find_dupes\n @hathi_report_filtered.find_all.with_index do |row, index|\n row if (row['local_id'] == @hathi_report_filtered.at(index + 1)&.[]('local_id')) || (row['local_id'] == @hathi_report_filtered.at(index - 1)['local_id'])\n end.compact\n end",
"title": ""
},
{
"docid": "a16763a80985aaf7da9b95298a4a4294",
"score": "0.6352624",
"text": "def remove_dups(arr)\n new_arr = []\n arr.each do |x|\n unless new_arr.include? x\n new_arr.push x\n end\n end\n new_arr\nend",
"title": ""
},
{
"docid": "f39a7d07a7017846239d86329b1bf6b3",
"score": "0.6342189",
"text": "def unique_items(ary)\r\n ary.select {|x| ary.count(x) == 1}\r\nend",
"title": ""
},
{
"docid": "6485d1b5887ec13164ef5e7504bb0888",
"score": "0.6337922",
"text": "def subsets_with_dup(nums)\n result = []\n nums.sort!\n subsets_helper(nums, [], result, 0, {})\n result\nend",
"title": ""
},
{
"docid": "a24fd0b39c3cc16cdd45415409013862",
"score": "0.6336089",
"text": "def remove_duplicates\n return @remove_duplicates if @set_remove_duplicates\n @remove_duplicates ||= true\n end",
"title": ""
},
{
"docid": "e2436b556b2c946eb8a7754b9cbc2ff1",
"score": "0.6326024",
"text": "def test_removes_duplicates\n stream = FromArray.new([2, 2, 3, 4, 1, 1, 2, 5, 4, 3, 6])\n collected = stream.distinct.collect\n assert(collected == collected.uniq)\n assert(collected.length == collected.uniq.length)\n end",
"title": ""
},
{
"docid": "622b67b4097444011530b05d62952b38",
"score": "0.63226074",
"text": "def find_dup(array)\n array.each { |x| return x if array.count(x) == 2 }\nend",
"title": ""
},
{
"docid": "9f215926243fff632fc528ce8cc6394d",
"score": "0.63165265",
"text": "def uniq\n dup.uniq! or dup\n end",
"title": ""
},
{
"docid": "f6cf2801e4a9aea875d99f099cb2228c",
"score": "0.63057876",
"text": "def unique(array)\n unique_array = []\n\n array.each do |original_element|\n found = false\n\n unique_array.each do |unique_element|\n if original_element == unique_element\n found = true\n break\n end\n end\n\n if !found\n unique_array << original_element\n end\n end\n\n unique_array\nend",
"title": ""
},
{
"docid": "527a3218d91658926fad02c9d565b85f",
"score": "0.6303713",
"text": "def my_uniq(array)\n result = []\n array.each { |ele| result << ele unless result.include?(ele) }\n result\nend",
"title": ""
},
{
"docid": "36b26430e293f8f2bd81fbc0744c9e70",
"score": "0.6302143",
"text": "def remove_dups(arr)\n\treturn arr.uniq()\nend",
"title": ""
},
{
"docid": "bd5578b62560da6ae33ec05a4d555eb2",
"score": "0.6295165",
"text": "def find_dup(arr)\n arr.each do |item|\n item_count = arr.count(item)\n return item if item_count > 1\n end\nend",
"title": ""
},
{
"docid": "1ea7c0a0eca0baf5dd5623aee36b599c",
"score": "0.6285162",
"text": "def unique_push!(*elements)\n elements.each do |element|\n self << element unless self.include?(element)\n end\n self\n end",
"title": ""
},
{
"docid": "a526cc7fcfa2fc261fef690cf5ef5eaa",
"score": "0.628427",
"text": "def uniq_by\n clean = []\n self.collect{|x| yield(x)}.uniq.each do |x|\n clean << self.select{|y| yield(y) == x}.last\n end\n clean\n end",
"title": ""
},
{
"docid": "5b33914d6ff7c016717b0334a2b44a4f",
"score": "0.6259017",
"text": "def find_dup(arr)\n arr.each{ | ele | return ele if arr.count(ele) == 2 }\nend",
"title": ""
},
{
"docid": "a8ed43d04370c9c878dd8eb4d8c50d2c",
"score": "0.62177694",
"text": "def non_duplicated_values(values)\n values.select { |value| values.count(value) == 1 }\nend",
"title": ""
},
{
"docid": "a8ed43d04370c9c878dd8eb4d8c50d2c",
"score": "0.62177694",
"text": "def non_duplicated_values(values)\n values.select { |value| values.count(value) == 1 }\nend",
"title": ""
},
{
"docid": "0ba2aaa4adff2681705adbe9db43e9b2",
"score": "0.6198704",
"text": "def non_duplicated_values(values)\n return values.select {|x| values.count(x) == 1 } \nend",
"title": ""
},
{
"docid": "e5ce76eae316fd4863de5a45151fffd4",
"score": "0.6180062",
"text": "def remove_duplicates(list)\n if list.length < 2\n return list\n else\n i = 0\n list.each do |num|\n if num == list[(i+1)]\n list.delete_at(i)\n end\n i += 1\n end\n return list\n end\nend",
"title": ""
},
{
"docid": "7fce4c70f6276b10d36fc78feac15ba7",
"score": "0.6167081",
"text": "def non_duplicated_values(values)\n values.keep_if { |v| values.count(v) == 1 }\nend",
"title": ""
},
{
"docid": "6127b4fb0ef8c82705adfb999b468c74",
"score": "0.6155887",
"text": "def remove_duplicates(list)\n list & list # list | list would work too\nend",
"title": ""
},
{
"docid": "6cb14ac05491dc9b1211555fcfe82d31",
"score": "0.6155817",
"text": "def find_dup(array)\n array.sort.each_with_index do |obj, idx| \n return obj if obj == array.sort[idx + 1]\n end\nend",
"title": ""
},
{
"docid": "d0f1539a550258d2006f9454ccbdf8e7",
"score": "0.6119024",
"text": "def non_duplicated_values(values)\n p values.select{ |i|\n values.count(i) == 1\n \t}\nend",
"title": ""
},
{
"docid": "ee70044b5881aed877b8ced50af9b5f4",
"score": "0.61112684",
"text": "def find_unique_elements(arr)\n arr_fin=[]\n arr.each do |x|\n arr.count(x)\n if arr.count(x)==1\n arr_fin << x\n end\n end\n return arr_fin\nend",
"title": ""
},
{
"docid": "af366b057ae8eeaabcc2e78dbd5c5b1f",
"score": "0.6107566",
"text": "def find_unique_elements(arr)\n arr.reject { |e| arr.count(e) > 1 }\nend",
"title": ""
},
{
"docid": "c7dcf023253f71310918ef2ac44f4446",
"score": "0.6107008",
"text": "def my_uniq(arr)\n uniques = []\n arr.each do |el|\n uniques << el unless uniques.include?(el)\n end\n uniques\nend",
"title": ""
},
{
"docid": "d84bc3e37d341c9826f7a50f0ba0b6cc",
"score": "0.61063105",
"text": "def non_duplicated_values(values)\n hash = Hash.new(0)\n output = []\n values.each { |element| hash[element] += 1 }\n hash.each { |k, v| output << k if v == 1 }\n output\nend",
"title": ""
},
{
"docid": "6498bb4c75d07d0228b21f1b7be03aa7",
"score": "0.6101063",
"text": "def remove_duplicates(list)\n length = list.length\n i = 0\n while i < length - 1\n if list[i] == list[i + 1]\n list.delete_at(i + 1)\n end \n i += 1\n end \n return list \nend",
"title": ""
},
{
"docid": "1335f0ee72b0a49d4adb47d7e5af6c44",
"score": "0.60992527",
"text": "def find_dup(array)\n for elem in array\n return elem if array.count(elem) == 2\n end\nend",
"title": ""
},
{
"docid": "5013f2cab5c91929f758b1a118496fdd",
"score": "0.60978156",
"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": "3502e0bb4a82fae1203c85ad3ae9d4ea",
"score": "0.6094172",
"text": "def test_distinct_one_duplicate_element\n stream = FromArray.new([1, 1])\n collected = stream.distinct.collect\n assert(collected.length == 1)\n assert(collected == collected.uniq)\n end",
"title": ""
},
{
"docid": "f9b97dc9e6483440f170a795ec0b0d7f",
"score": "0.6090086",
"text": "def find_unique_elements(arr)\n# Count how many times each element appears in the array, if an element appears\n# more than once, delete that element and any elements that are equal to it.\n \n arr.each do |i|\n\tif arr.count(i) > 1\n\t\tarr.delete(i)\n\tend\n end\n return arr\nend",
"title": ""
},
{
"docid": "b2340be0f7f99adb0f79f7f28e2e6f93",
"score": "0.60592914",
"text": "def uniq(array)\n unique_values = []\n array.each do |el|\n unless unique_values.include?(el)\n unique_values << el\n end\n end\n unique_values\n end",
"title": ""
},
{
"docid": "a6c73e1020e4c0ee30fb321b5105ca40",
"score": "0.6026831",
"text": "def find_dup(array)\n array.find { |num| num if array.count(num) > 1 }\nend",
"title": ""
},
{
"docid": "1576d6871972ca40c74858e63128fa0b",
"score": "0.6020673",
"text": "def find_unique_elements(arr)\n\tcounts = Hash.new 0\n\tarr.each do |ele|\n\t\tcounts[ele] += 1\n\tend\n\t\n\tcounts.delete_if {|key, value| value > 1 }\n\tresult = counts.keys #Array returned with keys for non-dupe values\n\treturn result\nend",
"title": ""
},
{
"docid": "d03c32c075b11d460a24eb7e7dcbc12d",
"score": "0.6014016",
"text": "def duplicates_subarray2(arr)\n arr_srt = arr.sort {|a, b| a.ord <=> b.ord}\n new_arr = [[arr_srt[0]]]\n arr_srt.each_with_index do |elm, idx|\n next if idx == 0\n if new_arr[-1].include? elm\n new_arr[-1] << elm\n else\n new_arr << [elm]\n end\n end\n new_arr\nend",
"title": ""
},
{
"docid": "5c286570abfe41c650b839ccd5526b70",
"score": "0.6010078",
"text": "def no_dupes?(arr)\n counter = Hash.new(0)\n arr.each { |ele| counter[ele] +=1 }\n \n # new_array = []\n # counter.each do |k,v|\n # new_array << k if v == 1\n # end\n # new_array\n counter.keys.select { |el| counter[el] == 1 }\nend",
"title": ""
},
{
"docid": "2b84677af5834f45e6b2bf6b7fed515d",
"score": "0.60056704",
"text": "def no_dupes?(arr)\n dupes = Hash.new(0)\n\n arr.each do |ele|\n dupes[ele] += 1\n end\n\n new_arr = []\n dupes.each do |k, v|\n if v == 1\n new_arr << k\n end\n end\n\n new_arr\nend",
"title": ""
},
{
"docid": "8358b7801603b9961693c4d1f6076325",
"score": "0.59985",
"text": "def query_by_duplicates\n tmp = self.clone\n tmp.list = list.select {|k,v| v.filename.count > 1}\n end",
"title": ""
},
{
"docid": "3abaab9ea30b958f8d8a4e0b07f66e58",
"score": "0.5996788",
"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": ""
},
{
"docid": "3ca58f62e25ecfcc0f659f368401d175",
"score": "0.5991201",
"text": "def mappa_e_rimuovi_duplicati(&block)\n self.map.with_index(&block).uniq\n end",
"title": ""
},
{
"docid": "dadb4035e2418d6e2046731e395834c0",
"score": "0.5991136",
"text": "def min_unique(arr)\n arr.sort! #[1,2,2,3,7]\n uniq = []\n dups = []\n (arr.length ).times do |i|\n if arr[i] == arr[i+1]\n dups << arr[i]\n else \n uniq << arr[i]\n end \n end \n\n dups.each do |el|\n while uniq.include?(el)\n el+=1\n end \n uniq << el\n p uniq\n end \n p uniq.reduce(:+)\nend",
"title": ""
},
{
"docid": "12f3a4be190c3e4788c9025f7a8c1a09",
"score": "0.5990892",
"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": "4486f0322535130cb1a979a1858d0411",
"score": "0.59858894",
"text": "def eliminar_duplicados(lista)\n if lista.instance_of?(Array)\n return lista.uniq\n end\n end",
"title": ""
},
{
"docid": "df2c4cbb225bb5bd73216f6f282b3437",
"score": "0.59851223",
"text": "def find_dup(arr)\n dup = nil\n single_num = []\n arr.each do |num|\n if single_num.include?(num)\n dup = num\n else\n single_num << num\n end\n end\n dup\nend",
"title": ""
},
{
"docid": "433e592fd0eb24d1e2068b01b1067f59",
"score": "0.59824723",
"text": "def uniq() end",
"title": ""
},
{
"docid": "ae083e64a445cf1350a79a8ac965a52a",
"score": "0.5978527",
"text": "def no_dupes?(arr)\n arr.reject do |ele|\n # debugger\n arr.count(ele) > 1\n end\nend",
"title": ""
},
{
"docid": "d31b4352602b9a4181ecf80ea755a8df",
"score": "0.5972853",
"text": "def find_unique_elements(arr)\n collect = Hash.new 0\n \n arr.each do |elt|\n collect[elt] += 1\n end\n\n unique_hash = Hash(collect.select {|k,v| v == 1})\n \n unique_hash.keys\nend",
"title": ""
},
{
"docid": "29bec8d2dfd73ee25a8f804998a1b858",
"score": "0.5965093",
"text": "def non_duplicated_values(values)\n values.reduce(Hash.new(0)){|hash, key| hash[key]+=1; hash}\n .select {|k, v| v == 1}\n .keys\nend",
"title": ""
},
{
"docid": "a2f988d374c38a47e4ffe27b620cdf23",
"score": "0.5964322",
"text": "def firstdup(dupS)\n\thash = Hash.new(0)\n\tdupS.each do |iter|\n\t\thash[iter] +=1\n\t\tif hash[iter] == 2\n\t\t\tputs iter\n\t\t\tbreak\n\n\t\tend\n\tend\n\tputs hash\nend",
"title": ""
},
{
"docid": "9dc86b7788709636984a4ce5308b3148",
"score": "0.5963906",
"text": "def find_dup(array_of_integers)\n array_of_integers.each do |integer|\n return integer if array_of_integers.count(integer) == 2\n end\nend",
"title": ""
},
{
"docid": "05257ab6aa86b1800c310b6a996e9d44",
"score": "0.59600914",
"text": "def no_dupes?(array)\n hash = Hash.new(0)\n array.each do |ele|\n hash[ele] += 1\n end\n new_array = []\n hash.each do |k, v|\n new_array << k if v == 1\n end\n return new_array\nend",
"title": ""
}
] |
358aad152b7e2375b4daa0e8642ec927
|
GET /items/:id GET /items/:id.json
|
[
{
"docid": "32f9fae4a78bc92ecaa442f9ad8f4d4e",
"score": "0.0",
"text": "def show\n @item = Vger::Resources::Suitability::Item.find(params[:id])\n @options = Vger::Resources::Suitability::Option.where(\n query_options: {\n item_id: @item.id\n },\n methods: [:reference_option_body]\n )\n respond_to do |format|\n format.html\n end\n end",
"title": ""
}
] |
[
{
"docid": "54748291efc0ecbbc050090a2600e1b8",
"score": "0.81714857",
"text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"title": ""
},
{
"docid": "eb354ffc8205e277e16c339add996ccd",
"score": "0.79644376",
"text": "def show\n item = Item.find(params[:id])\n render json: item\n end",
"title": ""
},
{
"docid": "10607d1962e1c3c48458c72fe9f3821f",
"score": "0.7946203",
"text": "def show\n render json: Item.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "fe476c10c46410f64947d209d6bdcb4c",
"score": "0.7913253",
"text": "def show\n render json: Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "5124d37b3706910929587854161aadc1",
"score": "0.7679625",
"text": "def item\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "88b1e067e8d668d3591c17ebcb26fd5e",
"score": "0.76161695",
"text": "def item(uuid)\n http.get \"/items/#{uuid}\"\n end",
"title": ""
},
{
"docid": "4b7c2e38ea3c59dff45fd791274840df",
"score": "0.7599299",
"text": "def show\n @item = Item.all.where(collection_id: params[:id])\n render :json => @item\n end",
"title": ""
},
{
"docid": "f1acdb1c11c94d512dff545c782c7eb8",
"score": "0.75592136",
"text": "def get_item\n @item = Item.find_by_id(params[:id])\n if @item\n return @item\n else \n render json: {\"message\": {\"type\": \"error\", \"content\": \"The item could not be found!\"}}\n end\n end",
"title": ""
},
{
"docid": "6ca16011e177989bc03df5f6e9c8753e",
"score": "0.75199646",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item.to_json() }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.74992913",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "4898e228668a06d40c31662e142d6bfb",
"score": "0.74115646",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n end\n end",
"title": ""
},
{
"docid": "5dc0fc05c4d694ab93d8154da98cb43a",
"score": "0.7398801",
"text": "def show\n# @item = Item.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "0fa42a9660916e6e445002f3ddbb9e57",
"score": "0.73309654",
"text": "def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "a6e2f39beeed2da72dd2012742805c51",
"score": "0.73212665",
"text": "def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "4f9c06cb38718b9667e827ef95e51362",
"score": "0.7301208",
"text": "def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end",
"title": ""
},
{
"docid": "b57ca2e59e7d084db6aad32547c5a9d7",
"score": "0.7284228",
"text": "def show\n @item = find_item(params[:id])\n end",
"title": ""
},
{
"docid": "73499245dc5eb969a6a1a5c510566192",
"score": "0.72651106",
"text": "def item(id)\n Item.find(id)\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.72582895",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2bb02008789ce408d0b1241fb9bdbada",
"score": "0.7240684",
"text": "def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end",
"title": ""
},
{
"docid": "af7dd5727e1bc4e7bd34c55cc6ec827e",
"score": "0.71915495",
"text": "def findItem\n item = Item.find(params[:id])\n if item\n return item\n else\n return render json: {data: \"Failure, could not find this item.\"}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "fc76b12378c727cb4005566b0b7fee9e",
"score": "0.7154239",
"text": "def item_show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "a84739a0dc0cb60df5e9b83143900542",
"score": "0.7113728",
"text": "def show \n #get the item id from the url params\n item_id = params[:id]\n #use `item_id` to find the item in the database\n #and save it to an instance variable\n @item = Item.find_by_id(item_id)\n render json: @item\n # @item = City.find(params[:id])\n # @item = Item.joins(:posts).includes(:posts).find(params[:id])\n # puts @item\n # render json: {\n # item: @item\n # }\n end",
"title": ""
},
{
"docid": "bb9cf157d2ee3d7339e686505ebe405b",
"score": "0.7112922",
"text": "def show \n \t@item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "168053bdf8f5babd1f649328dea7a392",
"score": "0.7112383",
"text": "def show\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstable }\n end\n end",
"title": ""
},
{
"docid": "3bd951ce3a15a4fb77b56c7fdda30fa9",
"score": "0.710439",
"text": "def get_item(item_id, params = {})\n url = build_url('item', item_id)\n params = params.merge(item_id: item_id)\n\n http.headers(build_headers).get(url, params: params)\n end",
"title": ""
},
{
"docid": "0c89cf36f00de30cdeb57c416ce6fe74",
"score": "0.7087206",
"text": "def set_item\n puts params[:id]\n @item = Item.find(params[:id])\n puts 'here is', @item\n rescue ActiveRecord::RecordNotFound\n render json: { message: 'Sorry! Item not found.' }, status: 404\n end",
"title": ""
},
{
"docid": "3820b1ceb85fefe025a785e2b3e67009",
"score": "0.7076529",
"text": "def show\n @feed_item = Item.find(params[:id])\n\n render json: @feed_item\n end",
"title": ""
},
{
"docid": "7a4c409a025173dd486377bf4fa18b0f",
"score": "0.70672435",
"text": "def show\n @item = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM items \n WHERE iid = #{params[:id]} \n LIMIT 1\").first\n\n @games = ActiveRecord::Base.connection.execute(\"\n SELECT g.*\n FROM games g\n JOIN game_items gi\n ON g.gid = gi.gid\n WHERE iid = #{params[:id]}\")\n\n respond_to do |format|\n format.html\n format.json {render json: Item.find(@item[0])}\n end\n end",
"title": ""
},
{
"docid": "218de94db612a8fc08c2fa29031af662",
"score": "0.7056375",
"text": "def show\n @item_info = ItemInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_info }\n end\n end",
"title": ""
},
{
"docid": "0660a4703d397c4225e71e0ceed5e9a5",
"score": "0.70540094",
"text": "def show\n @item = Item.find(params[:id])\n @user = @item.user_id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "8b83c5ddf9e5abadedcbc0a066131980",
"score": "0.7037879",
"text": "def get_items(product_id, params={})\n self.client.get(\"products/#{product_id}/items\", params)\n end",
"title": ""
},
{
"docid": "ae16cc4424c48f43919cb7189c5e5c19",
"score": "0.7033873",
"text": "def show\n @item=Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "6384614efdbcc61a72ea0823ac490fb6",
"score": "0.70315295",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "356996f7643705d6be497d55c88bb2b3",
"score": "0.7014301",
"text": "def item_by_id(id)\n @items[id]\n end",
"title": ""
},
{
"docid": "caefdfa84766688ebe8c74399e7b01e0",
"score": "0.7006572",
"text": "def show\n #@item = Item.find(params[:id])\n #@item = Item.find(params[:id]) if Item.find(params[:id]).list.user == current_user\n if params[:id].blank?\n @item\n else\n @item ||= current_user.lists.find(Item.find(params[:id]).list.id).items.find(params[:id])\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "797f77b4439e8ab3cf07486b7ea86a49",
"score": "0.69652593",
"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 format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "663e73392fda5667d37a5ee86ad9e3b2",
"score": "0.69543475",
"text": "def load_item\n @item = Item.find(params[:id]) rescue nil\n \n render_404 unless @item\n end",
"title": ""
},
{
"docid": "196801831a75757e64bd58ddbfa8c969",
"score": "0.69380677",
"text": "def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6918309",
"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.6918309",
"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.6918309",
"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.6918309",
"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": "aaa2ec7e8072ae92dadbcdc1e56f6f7e",
"score": "0.6912495",
"text": "def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "30ac1c8dcdf7da4f54ae7d23a6bf6b3b",
"score": "0.69036704",
"text": "def get_item(id, options = {})\n\t\t\tif (id.is_a?(Hash))\n\t\t\t\toptions = id\n\t\t\telse\n\t\t\t\toptions.merge!(:item_id => id)\n\t\t\tend\n\t\t\t\n\t\t\toptions = merge_defaults(options)\n\t\t\toptions.delete(:realm)\n\t\t\t\n\t\t\tinfo = get_xml(@@item_info_url, options)\n\t\t\ttooltip = get_xml(@@item_tooltip_url, options)\n\t\t\t\n\t\t\tif (info%'itemInfo'%'item') && !tooltip.nil?\n\t\t\t\treturn Wowr::Classes::FullItem.new(info%'itemInfo'%'item', tooltip%'itemTooltip', self)\n\t\t\telse\n\t\t\t\traise Wowr::Exceptions::ItemNotFound.new(options[:item_id])\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "30ac1c8dcdf7da4f54ae7d23a6bf6b3b",
"score": "0.69036704",
"text": "def get_item(id, options = {})\n\t\t\tif (id.is_a?(Hash))\n\t\t\t\toptions = id\n\t\t\telse\n\t\t\t\toptions.merge!(:item_id => id)\n\t\t\tend\n\t\t\t\n\t\t\toptions = merge_defaults(options)\n\t\t\toptions.delete(:realm)\n\t\t\t\n\t\t\tinfo = get_xml(@@item_info_url, options)\n\t\t\ttooltip = get_xml(@@item_tooltip_url, options)\n\t\t\t\n\t\t\tif (info%'itemInfo'%'item') && !tooltip.nil?\n\t\t\t\treturn Wowr::Classes::FullItem.new(info%'itemInfo'%'item', tooltip%'itemTooltip', self)\n\t\t\telse\n\t\t\t\traise Wowr::Exceptions::ItemNotFound.new(options[:item_id])\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "bbc41a33e45311cfd067dc8fefb3b7a0",
"score": "0.68897146",
"text": "def find(id, type = :full)\n case type\n when :full\n response = JSON.parse(@client.get(\"items/#{id}\").body)\n Promisepay::Item.new(@client, response['items'])\n when :status\n response = JSON.parse(@client.get(\"items/#{id}/status\").body)\n Promisepay::Item.new(@client, response['items'])\n end\n end",
"title": ""
},
{
"docid": "5b0ad9e19bf19f0bb84f48311c513ffb",
"score": "0.68886673",
"text": "def show\n \n render status: 200, :json => @item\n\n end",
"title": ""
},
{
"docid": "67f554854bf96ea6bc955cf0bc7ca29c",
"score": "0.68886566",
"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": "b040cbf54f8316e3b79f9a85b078e131",
"score": "0.68840647",
"text": "def path\n \"/{databaseId}/items/list/\"\n end",
"title": ""
},
{
"docid": "ca47fe0a19dbc9fe001ca31efd37b9b1",
"score": "0.68832725",
"text": "def show\n @admin_item = Admin::Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_item }\n end\n end",
"title": ""
},
{
"docid": "ca47fe0a19dbc9fe001ca31efd37b9b1",
"score": "0.68832725",
"text": "def show\n @admin_item = Admin::Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_item }\n end\n end",
"title": ""
},
{
"docid": "127c2d830f571c5c231142db635a5d2b",
"score": "0.6865015",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n format.xml { render xml: @item }\n end\n end",
"title": ""
},
{
"docid": "a6fc996c9f3e1d0cdc29da5993af1475",
"score": "0.68627167",
"text": "def show\n @potluck_item = PotluckItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @potluck_item }\n end\n end",
"title": ""
},
{
"docid": "d5c1d1e7c7d97868c6253fd522b73b2b",
"score": "0.68592894",
"text": "def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "a1d6ca1c311862204a6ccb178dceae3f",
"score": "0.68541604",
"text": "def get_item(course_id, item_id)\r\n relative_url = PATH_COURSES_ITEMS_ % [course_id, item_id]\r\n get(relative_url)\r\n end",
"title": ""
},
{
"docid": "57ad7bed976ffa85b967037f3e2315c6",
"score": "0.684728",
"text": "def show\n @item_datum = ItemData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_datum }\n end\n end",
"title": ""
},
{
"docid": "9e16f7ba34e6b47be48077500e403826",
"score": "0.68431014",
"text": "def show\n @item = TodoItem.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json {render json: {\n success:true, \n data: [@item],\n message: \"TodoItem found.\"\n }}\n end\n end",
"title": ""
},
{
"docid": "a2f6078b717fee4dbd8796306d82ecd1",
"score": "0.6838317",
"text": "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "15d52d8ea4fc28e0ea1998ab6707a18e",
"score": "0.68331635",
"text": "def show\n @user=User.find(params[:id])\n @items = @user.items\n end",
"title": ""
},
{
"docid": "e17935516e4e5e728ec46afa44737529",
"score": "0.6829474",
"text": "def find(id)\n fail(ArgumentError, \"Missing id/slug\") unless id\n\n result = access_token.get(\"#{API_BASE}#{self.class::API_PATH}#{id}\")\n fail(ArgumentError, \"Bad request\") unless result.code == \"200\"\n\n self.class::ITEM_CLASS.new(result.body)\n end",
"title": ""
},
{
"docid": "52c51c3493ea28eb6657ebfdec50994e",
"score": "0.68220556",
"text": "def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"title": ""
},
{
"docid": "907a47bbec63ace92199cbddeb249022",
"score": "0.6820609",
"text": "def show\n @item_class = ItemClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_class }\n end\n end",
"title": ""
},
{
"docid": "f2513cc45fdf0866e6a22e833463d5a4",
"score": "0.6807929",
"text": "def show\n @order = Order.find(request[:order_id])\n @order_item = @order.order_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order_item }\n end\n end",
"title": ""
},
{
"docid": "3e41f5361418c0d43438bb8ded8e1d64",
"score": "0.6781337",
"text": "def show\n @inventoryitem = Inventoryitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventoryitem }\n end\n end",
"title": ""
},
{
"docid": "7cae1bc0debfffb48420ea03c22112cb",
"score": "0.67749834",
"text": "def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "05276565b86511504930c7cb11a1649b",
"score": "0.6746111",
"text": "def get_single_item(item_id, payload = {})\n payload = payload.merge('ItemID' => item_id)\n request('GetSingleItem', payload)\n end",
"title": ""
},
{
"docid": "994a5524e2512a173f8784bd2d861313",
"score": "0.6742965",
"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": "955f84b1847b15c2217ba9d5d29171e4",
"score": "0.6739576",
"text": "def show\n @items = Item.all\n end",
"title": ""
},
{
"docid": "00c638a0750ce7b2e25b6e43dc040a4e",
"score": "0.6736373",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "a8ded8c9ab7782771636dc521b07f006",
"score": "0.67310447",
"text": "def show\n @album = Album.find_by_slug(params[:album_id])\n @album_item = @album.album_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @album_item }\n end\n end",
"title": ""
},
{
"docid": "6a5e2b468ee91f083dccb6f26efd8e6d",
"score": "0.6716572",
"text": "def show\n @itemstatus = Itemstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstatus }\n end\n end",
"title": ""
},
{
"docid": "75641933dd68ac688c9511c2d7a28c79",
"score": "0.67152166",
"text": "def show\n render json: @item, status: :ok\n end",
"title": ""
},
{
"docid": "7f942443712d581af0da4a731acc5e88",
"score": "0.67127174",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "5c154cf0a08b7b15fd69bccf8fc42f18",
"score": "0.67093736",
"text": "def show\n @fooditem = Fooditem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @fooditem }\n end\n end",
"title": ""
},
{
"docid": "44ebbe248a4109d1392a2912237c7e11",
"score": "0.67071766",
"text": "def item\n @items = Item.select {|k,v| k.product_type_id != 4 }\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @items, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end",
"title": ""
},
{
"docid": "af92004625af60412241fcbb509c8a4d",
"score": "0.6703052",
"text": "def show\n @purchase = Purchase.find(params[:purchase_id])\n @purchase_item = @purchase.purchase_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_item }\n end\n end",
"title": ""
},
{
"docid": "1f79ba339b2897f659afedffbe5f5d3d",
"score": "0.66995436",
"text": "def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end",
"title": ""
}
] |
066675d4dedb4f6f6bebce652b9d552f
|
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
|
[
{
"docid": "89345f402106c25cde12e1484b175b2f",
"score": "0.70863056",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ByIDResultSet.new(resp)\n return results\n end",
"title": ""
}
] |
[
{
"docid": "c4ca32683e8ce75eb6a187d63df8fa77",
"score": "0.76639634",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "6f7a7d9be674ad4cf17d6743eb1f7836",
"score": "0.7641797",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetNextResultsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "ea872306361fc864408e8279b0199bbe",
"score": "0.7593966",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "ea872306361fc864408e8279b0199bbe",
"score": "0.7593966",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "8930e1716b013d16d7b7de258c2d40a6",
"score": "0.7570661",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BasicResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7562012",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.75597274",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "2af7c3fdbc792c97315016366b268df9",
"score": "0.74925923",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9f335c551760f3d4173d3a6cb083a0e2",
"score": "0.7487777",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectSetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.74491423",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.74491423",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.74491423",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.74491423",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bb4c4c00d82ad064a5082b7afe4c48d2",
"score": "0.7447624",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "afe0e8ec443f796166358039fdecdb0d",
"score": "0.74474907",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelper2ResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "648c8b0f1dc24c0412d5f7d4e3cea344",
"score": "0.7438828",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MultiQueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "6b4ba316137428ce500c97e409be2902",
"score": "0.7424318",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunCommandResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "34f15f5a73f216a32c95e6c664949f2d",
"score": "0.7389863",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetMetadataResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "1239dac60dfed8a0d5b4d31e8106e390",
"score": "0.7383775",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelper1ResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f28ec6dc9cedee6469f71c907f1704ef",
"score": "0.7383127",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveSpecificRowsOrColumnsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9fdcd1a770560eb59a2dbe7abd869eaf",
"score": "0.73820543",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9fdcd1a770560eb59a2dbe7abd869eaf",
"score": "0.73820543",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9fdcd1a770560eb59a2dbe7abd869eaf",
"score": "0.73820543",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9fdcd1a770560eb59a2dbe7abd869eaf",
"score": "0.73820543",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "855c1fa00591ce07697f8e545054fce7",
"score": "0.7377712",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MQLReadResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "a165902ed6748b64b4117b8c8b9abae7",
"score": "0.73522276",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelperResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "01a45040460ae3c472e612d6ad45559d",
"score": "0.73477095",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CivicResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "543e0f21a9a5617a696a566b984b2262",
"score": "0.73357207",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectGetResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "d9fc5548c5903ea3474c0673f4d3a9e6",
"score": "0.7330397",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BatchResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "b545d160e048eb964734c4364860c054",
"score": "0.7312797",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = StructuredQueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "05bac4be2091b0eb847f688449846159",
"score": "0.72956973",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SendResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "eb3f4ac33af2cc00b368b83f5b921210",
"score": "0.72914517",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = PutResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "4c3a65d523d09d06b46fa6381bd6ae1f",
"score": "0.72735226",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FQLResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "2e0d4dea0d6309b1ed6921de241cf809",
"score": "0.72717243",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = Step1ResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e",
"score": "0.72599536",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e",
"score": "0.72599536",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e",
"score": "0.72599536",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e",
"score": "0.72599536",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e",
"score": "0.7255672",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "be102b9c81183d9f8bd4d09a7fdce73a",
"score": "0.72510105",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MakeCallResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "ba8fbcad6ce69ca11b25814f5c7d80e7",
"score": "0.72424424",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetValuesFromXMLResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "e374c864ae8365e83576224986afc8db",
"score": "0.7237946",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunRightScriptResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "c640cb069c5325833bd1f90f353677cf",
"score": "0.7233013",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReplyResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "03e4ddb0fbc8ad7e8fed24e516422ee5",
"score": "0.7232028",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = Step2ResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "da581a489c99b7ffa036d73d31deb567",
"score": "0.7231047",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RequestResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "afe71b77fbb9b12089a4f05186d7a93f",
"score": "0.72046906",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BillResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "02533070f2fee1b7c51ffcfb358467fc",
"score": "0.7194001",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunInstancesResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "a527666f0126166571e60612e4c25b27",
"score": "0.71933115",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9de8750a58a9526fbdee57ac41e90203",
"score": "0.71887404",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "54f48540754909bc086af097cb2575d7",
"score": "0.7184124",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = XLSToXMLResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "973dca0d927cf5e0927d87002d02cb4e",
"score": "0.71660966",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CompleteEntryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "2d80834625bd1cf93415aa6aee3849b8",
"score": "0.7155356",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadProductResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "62cbf9188960f4e3579331a0940c0958",
"score": "0.71538115",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRequestResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "36a3ae9b6c96bb8c08a7ad4cd30ed18c",
"score": "0.7152561",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ExecuteViewsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "5dcada835dd4f5661948bcc1afb69b1f",
"score": "0.7147464",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadActionsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "546f796abecb4a53efd4abd86391d9fe",
"score": "0.7142717",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ColumnsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "04486efd3eefc68f700419fbb9ac3d1c",
"score": "0.713733",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActionResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "5a968378a28e150e178cf6c07cbaefd3",
"score": "0.71348464",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadRunsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "9b3005154a1b6ab53713f1ddc148f13d",
"score": "0.7123863",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetEntityResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f3548ebc7ee3a9e55a11c1017d9ae306",
"score": "0.7122013",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetStatusResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "d40537899945eadb9ffb703dec94db88",
"score": "0.7107206",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateRunResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "070004d2425f03200a0bfaf85b97fbc0",
"score": "0.7105372",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "3c4057ad4872f4dc31fb615931da74eb",
"score": "0.7105145",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateRequestResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "409fcd9d77023f2d8987b5f8e05def02",
"score": "0.71037024",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = PromptResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0c4b8dcec2478b63814035cead2c697f",
"score": "0.71025413",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = XMLResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "550802d802281c5bead9f1836a8dd4f3",
"score": "0.70984364",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectUpdateResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "33fe7f64c30effa42e552f81862db2fb",
"score": "0.70921504",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateWantsToReadResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "ce00867599ac0237408f7c0f396a40ed",
"score": "0.70896024",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetInstanceResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f97a7bd13d335a38327ac328f1ea794e",
"score": "0.708848",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BatchHelperVersion9ResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "3d51df9e4ec249f86008ab8460df25f1",
"score": "0.7088256",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateWantsToReadResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "c5ff4261c62823872d930ef8c5d2a4b1",
"score": "0.70850044",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveObjectResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f414f475e00c01cab69153edccf57d9b",
"score": "0.7079918",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SeriesResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "5157f9b8dcc2756d8bc274f2ffca783a",
"score": "0.7079187",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetEntryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "dc572ee0e3ff2c0edde3d0f62a304488",
"score": "0.7072195",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListedResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f971bba6c1135825990f5dca6f6e740a",
"score": "0.70647645",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = EndItemResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f4f33869b9bf248ee3302246637d8e18",
"score": "0.706404",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = InfluenceResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "77bf542a39db31850ec6ecd794d13113",
"score": "0.7061568",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LeadershipPACsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0ee572471a295b58d45bfd8ea90c6c19",
"score": "0.7052522",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0ee572471a295b58d45bfd8ea90c6c19",
"score": "0.7052522",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0ee572471a295b58d45bfd8ea90c6c19",
"score": "0.7052522",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0ee572471a295b58d45bfd8ea90c6c19",
"score": "0.7052522",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "0ee572471a295b58d45bfd8ea90c6c19",
"score": "0.7052522",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f12b25229dc0d7f5aeb720aec7dd0fad",
"score": "0.70521766",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShareResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "f12b25229dc0d7f5aeb720aec7dd0fad",
"score": "0.70521766",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShareResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "e3506f6b0376127238b649b3d7106521",
"score": "0.7051334",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetBatchEntitiesResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "cbaab2aa9aa5f4134435a7e41c36275e",
"score": "0.7048862",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = HereNowResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "e58c7422dbc490d17e70263cdd8227e4",
"score": "0.70482516",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrievePlanResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bede436b8562b6553f3d58aed04867c3",
"score": "0.7046229",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BooksResultSet.new(resp)\n return results\n end",
"title": ""
}
] |
3e30f36bbe9bd0c4b19b4da58583b809
|
Public: Returns all projects that have been marked as changed. Returns an Array of Project subclasses, one for each project in the repository.
|
[
{
"docid": "38f82368eb7034da53b09c5d16a09917",
"score": "0.56278497",
"text": "def changed\n select(&:changed?)\n end",
"title": ""
}
] |
[
{
"docid": "5bcd5c213015efd08df31de215323713",
"score": "0.72591037",
"text": "def projects\n pattern = /\\/(trunk|branches|tags)/\n dirs_changed.grep(pattern).map do |dir|\n dir.split(pattern, 2).first\n end.uniq\n end",
"title": ""
},
{
"docid": "8c53340025758d961a930ca733eb9ffb",
"score": "0.66950697",
"text": "def projects\n return Project.all\n end",
"title": ""
},
{
"docid": "84cadee822a78c707e6c732e614854bb",
"score": "0.6499695",
"text": "def projects\n list = []\n self.each do |task|\n list << task.projects unless task.projects == []\n end\n list.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "cd3a8c8185dd763ebf44a956fb53a8fb",
"score": "0.6450006",
"text": "def projects\n return @projects if @projects\n ids = issues.collect(&:project).uniq.collect(&:id)\n if ids.any?\n # All issues projects and their visible ancestors\n @projects = Project.visible.all(\n :joins => \"LEFT JOIN #{Project.table_name} child ON #{Project.table_name}.lft <= child.lft AND #{Project.table_name}.rgt >= child.rgt\",\n :conditions => [\"child.id IN (?)\", ids],\n :order => \"#{Project.table_name}.lft ASC\"\n ).uniq\n else\n @projects = []\n end\n end",
"title": ""
},
{
"docid": "24fb2a2f2d641bb294acbbad6e055bfb",
"score": "0.6417135",
"text": "def all_projects\n projects = []\n all_workspaces.each do |workspace|\n workspace_projects = workspace.projects\n workspace_projects.each do |project|\n projects.push(project)\n end\n end\n return projects\n end",
"title": ""
},
{
"docid": "05208f310807d22e6262d539de2007ff",
"score": "0.64108855",
"text": "def changes\n arr = []\n git.status.each{ |f| arr << f if f.type =~ /A|D/ }\n arr\n end",
"title": ""
},
{
"docid": "75aeb13b3efe92afe8e55a54cc454492",
"score": "0.64010644",
"text": "def projects\n return @projects if @projects\n\n ids = issues.collect(&:project).uniq.collect(&:id)\n if ids.any?\n # All issues projects and their visible ancestors\n @projects = Project.visible.all(\n :joins => \"LEFT JOIN #{Project.table_name} child ON #{Project.table_name}.lft <= child.lft AND #{Project.table_name}.rgt >= child.rgt\",\n :conditions => [\"child.id IN (?)\", ids],\n :order => \"#{Project.table_name}.lft ASC\"\n ).uniq\n else\n @projects = []\n end\n end",
"title": ""
},
{
"docid": "e4713ed6c1ac93064047ca4f05ee65bc",
"score": "0.6367589",
"text": "def projects\n\t\t\treturn @projects if @projects\n\t\t\t@projects = Project.visible.where(\"parent_id = ?\", @project.id).order(\"#{Project.table_name}.name ASC\").to_a\n\t\t\tif @projects && @projects.count > 0\n\t\t\t\[email protected] do |subproject|\n\t\t\t\t\tif !subproject.module_enabled?(\"plusgantt\")\n\t\t\t\t\t\[email protected](subproject)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn @projects\n\t\tend",
"title": ""
},
{
"docid": "69929d88d350f702430d4ea5a96cd63f",
"score": "0.6364292",
"text": "def projects\n\t\t\treturn @projects if @projects\n\t\t\t\n\t\t\t@projects = Project.visible.where(\"parent_id = ?\", project.id).order(\"#{Project.table_name}.name ASC\").to_a\n\t\t\t\n\t\t\tif @projects && @projects.count > 0\n\t\t\t\[email protected] do |subproject|\n\t\t\t\t\tif !subproject.module_enabled?(\"plusgantt\")\n\t\t\t\t\t\[email protected](subproject)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\treturn @projects\n \n\t\tend",
"title": ""
},
{
"docid": "08068672ad070bdb958345b81e7b0c38",
"score": "0.61658436",
"text": "def projects()\n Project.all().select() { | project | project.creator() == self }\n end",
"title": ""
},
{
"docid": "4ae644bd9cd21ba881a9e5cffefcc580",
"score": "0.6139735",
"text": "def projects\n []\n end",
"title": ""
},
{
"docid": "b27abe13ade75ed28d23fab97507c54d",
"score": "0.60997427",
"text": "def changes\n changeset_index = 0\n @repository.git_patch_for(self).changes.map do |git_change| \n changeset_index += 1\n HgChange.new(git_change, changeset_index)\n end\n end",
"title": ""
},
{
"docid": "f505ffa09ea6bfe875bbabb8ffc2cd15",
"score": "0.60990685",
"text": "def list\n @project = Project.find(params[:project_id])\n authorize! :read, @project\n\n # XXX: per() should use a config parameter instead of static value.\n @project_changes = ProjectChange.all_project_updates(@project, nil).page(params[:page]).per(10)\n render :layout => false\n end",
"title": ""
},
{
"docid": "3423d07e96f3f0ea4b0ae603801968d8",
"score": "0.6073253",
"text": "def pledged_projects\n pledges.map(&:project).uniq\n end",
"title": ""
},
{
"docid": "aa8fa17df9e6326d2eebb78d2dc52ad5",
"score": "0.6070918",
"text": "def projects\n raise NotImplementedError # subclass responsibility\n end",
"title": ""
},
{
"docid": "a1e3d4518fd880e95479cf3ee5d1790f",
"score": "0.60683393",
"text": "def projects\n refs = Set.new\n\n nodes.each do |node|\n node.to_html.scan(Project.markdown_reference_pattern) do\n refs << \"#{$~[:namespace]}/#{$~[:project]}\"\n end\n end\n\n refs.to_a\n end",
"title": ""
},
{
"docid": "69166a276345d8b20fef95d0525e229a",
"score": "0.6046756",
"text": "def projects\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "bc53bd39db91659c9a677f21fa40a6bb",
"score": "0.6034629",
"text": "def projects\n project_ids = subs.map {|sub| sub.project_id }\n return [] if project_ids.empty? # only do one! yay me\n Project.where :id => project_ids\n end",
"title": ""
},
{
"docid": "1b644311a0e854fd14a95d0dd913c111",
"score": "0.6021083",
"text": "def projects\n projects = Project.all_manager_of(@user) + Project.all_subscribed_to(@user)\n # Only return relevant attributes\n response = projects.map do |project|\n perm = ProjectPermission.get_user_permission(@user, project).permission\n next {\n :id => project.id,\n :name => project.name,\n :created_ts => project.created_at.to_i,\n :last_commit_hash => ProjectChange.all_project_updates(project, 1).first.commit_hash,\n :can_write => [ProjectPermission::OWNER, ProjectPermission::COAUTHOR].include?(perm)\n }\n end\n render json: response\n end",
"title": ""
},
{
"docid": "bdb970c968aa6b9674d01483c3062eb6",
"score": "0.60098034",
"text": "def projects\n \t[]\n end",
"title": ""
},
{
"docid": "813ddbf49c5d7db59e6f5c74d0dafdb1",
"score": "0.6009262",
"text": "def projects\n projects=[]\n self.users.each{|user| projects.concat(user.projects).uniq!}\n return projects\n end",
"title": ""
},
{
"docid": "ad736d6a57b41972bcdeda7aae28c527",
"score": "0.6007826",
"text": "def incomplete_projects\n incomplete = []\n self.projects.each do |project|\n incomplete << project if project.status != \"Complete\"\n end\n incomplete\n end",
"title": ""
},
{
"docid": "34ddd4b99383b89540bb7269fa7a027c",
"score": "0.598966",
"text": "def projects\n make_call(\"tl.getProjects\", {}, \"1.0b5\" )\n end",
"title": ""
},
{
"docid": "d107e79c12f6f7f6f16b2a76675ff43c",
"score": "0.5970097",
"text": "def existing_projects\n Project.project_hashes\n end",
"title": ""
},
{
"docid": "39e335f67642f93a92db3b7d91aa3374",
"score": "0.5968362",
"text": "def complete_projects\n completed = []\n self.projects.each do |project|\n completed << project if project.status == \"Complete\"\n end\n completed\n end",
"title": ""
},
{
"docid": "17409483bf6fc7ee7133043cec1e9c56",
"score": "0.5954615",
"text": "def projects_need_update(projects)\n\tif Thread.current[:gitosis_project_updates] == nil\n\t\t# The repository controller has some before_filters that fire before\n\t\t# our patched filter, it should be safe to ignore these as the changes\n\t\t# to the observer are usually to with it updating the db changesets\n\t\t# prior to display\n\t\tRAILS_DEFAULT_LOGGER.debug(\"Ignoring request to update projects\")\n\telse\n\t\tThread.current[:gitosis_project_updates] << projects\n\t\tThread.current[:gitosis_project_updates].flatten!\n\t\tThread.current[:gitosis_project_updates].uniq!\n\t\tThread.current[:gitosis_project_updates].compact!\n\tend\n end",
"title": ""
},
{
"docid": "21a7b46b9f4143909aa522816ccac6c0",
"score": "0.594351",
"text": "def participating_projects\n self.model_files.map { |model_file| model_file.projects }.flatten.compact.uniq\n end",
"title": ""
},
{
"docid": "293ffc852089c1b0fca343cd6affc525",
"score": "0.5927797",
"text": "def projects\n project_objects = Asana.get \"projects?workspace=#{self.id}\"\n list = []\n\n project_objects[\"data\"].each do |project|\n list.push Project.new :id => project[\"id\"], :name => project[\"name\"], :workspace => self\n end\n\n list\n end",
"title": ""
},
{
"docid": "1f9acc2fe0ffdfa37d77f32d3e36ca2a",
"score": "0.592016",
"text": "def listProjects\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "1f9acc2fe0ffdfa37d77f32d3e36ca2a",
"score": "0.592016",
"text": "def listProjects\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "7e90762bf7bc3e5b1c5c81b70f944432",
"score": "0.59100115",
"text": "def project_ids\n @projects.is_a?(ActiveRecord::Relation) ? @projects.reselect(:id) : @projects\n end",
"title": ""
},
{
"docid": "547ef5e2e60f6c1bdf7f487e06c4263d",
"score": "0.59063715",
"text": "def backed_projects\n project_backer = ProjectBacker.all.filter {|pback| pback.backer == self}\n\n project_backer.map {|pb| pb.project}\n end",
"title": ""
},
{
"docid": "aac7804d67a709683b251e066a1df364",
"score": "0.58966243",
"text": "def projects\n [project]\n end",
"title": ""
},
{
"docid": "aac7804d67a709683b251e066a1df364",
"score": "0.58966243",
"text": "def projects\n [project]\n end",
"title": ""
},
{
"docid": "5f45e7e902a10ac558c3ddc25d0dafc4",
"score": "0.5895715",
"text": "def projects\n return @projects || load_projects\n end",
"title": ""
},
{
"docid": "7d8a16de05de5dcedc3c0f44e552ca5e",
"score": "0.58804685",
"text": "def project_names\n @projects.values.reject { |p| p.core_project? }.map { |p| p.name }\n end",
"title": ""
},
{
"docid": "d24cbc6d2765f978ea80a90c7dd35fd2",
"score": "0.5875104",
"text": "def projects_list\n\t\tProject.by_manager_id(id).order(\"created_at DESC\").all\n\tend",
"title": ""
},
{
"docid": "f7a519e3fbf3c47912f843bae1dc29a7",
"score": "0.58713204",
"text": "def projects_need_update(projects)\n return if projects.nil? || Thread.current[:gitosis_project_updates].nil?\n Thread.current[:gitosis_project_updates] << projects\n Thread.current[:gitosis_project_updates].flatten!\n Thread.current[:gitosis_project_updates].uniq!\n Thread.current[:gitosis_project_updates].compact!\n end",
"title": ""
},
{
"docid": "594e8df2fc3e7dca1f8722fde4da8dc2",
"score": "0.58671784",
"text": "def projects\n @_projects ||= Tenk::Projects.new(self)\n end",
"title": ""
},
{
"docid": "5f277c4cc6a02fc8382273dd117bb6cd",
"score": "0.5853409",
"text": "def projects\n Project.all.select {|proj| proj.user == self}\n end",
"title": ""
},
{
"docid": "bb3f62543354aac39819f8b1e314adb9",
"score": "0.58340275",
"text": "def projects\n res = []\n\n projects = GoodData.get @json['accountSetting']['links']['projects']\n projects['projects'].each do |project|\n res << GoodData::Project.new(project)\n end\n\n res\n end",
"title": ""
},
{
"docid": "6e1048956b616cd2f1af308b1011f278",
"score": "0.58296585",
"text": "def all\n GoodData.profile.projects\n end",
"title": ""
},
{
"docid": "4a454f57d2fc22894901471feb24af9e",
"score": "0.58260715",
"text": "def all_projects\n resp = @conn.get 'projects.json'\n resp.body\n end",
"title": ""
},
{
"docid": "99834f38e05d02b6cd885aa698d25120",
"score": "0.5820876",
"text": "def get_monitoring_projects\n @projects = []\n User.current.members.each do |member|\n @projects << member.project\n member.roles.each { |r|\n if r.name == 'Manager'\n sub_projects = Project.where('parent_id = ?', member.project_id)\n sub_projects.each { |s_p| @projects << s_p } if sub_projects\n end\n }\n end\n return @projects.uniq\n end",
"title": ""
},
{
"docid": "93e8162a4535d1fed4df25cac813419a",
"score": "0.58042306",
"text": "def projects\n weakref(:projects) do\n Project.list(\"member=uid=#{name},#{base}\")\n end\n end",
"title": ""
},
{
"docid": "0141b6eba7d356785a8cb780de8f5f9b",
"score": "0.5793374",
"text": "def backed_projects\n backed_projects = ProjectBacker.all.select {|backed| backed.backer == self}\n backed_projects.map {|project| project.project}\n end",
"title": ""
},
{
"docid": "09af88c15313c88eefc3e7fa7df0d65e",
"score": "0.57806605",
"text": "def projects\n badges.map{|b| b.project}.to_set\n end",
"title": ""
},
{
"docid": "9b4226d2df87dee047ece7aa9f267455",
"score": "0.577702",
"text": "def changed_files\n @repository.chdir do\n @changed ||= @repository.status.changed.to_a.map(&:first)\n end\n end",
"title": ""
},
{
"docid": "d8e2c8137e3f84891a7cd320974f5d66",
"score": "0.5776616",
"text": "def commits\n allow_quarantine = true\n\n newrevs = @changes.map do |change|\n oldrev = change[:oldrev]\n newrev = change[:newrev]\n\n next if blank_rev?(newrev)\n\n # In case any of the old revisions is blank, then we cannot reliably\n # detect which commits are new for a given change when enumerating\n # objects via the object quarantine directory given that the client\n # may have pushed too many commits, and we don't know when to\n # terminate the walk. We thus fall back to using `git rev-list --not\n # --all`, which is a lot less efficient but at least can only ever\n # returns commits which really are new.\n allow_quarantine = false if allow_quarantine && blank_rev?(oldrev)\n\n newrev\n end.compact\n\n return [] if newrevs.empty?\n\n @commits ||= project.repository.new_commits(newrevs, allow_quarantine: allow_quarantine)\n end",
"title": ""
},
{
"docid": "a8fd2e965b62a7c3819359ebb3a29a69",
"score": "0.57653654",
"text": "def backed_projects\n #backed_proj = []\n ProjectBacker.all.select{|pb| pb.backer == self}.map{|proj| proj.project}\n end",
"title": ""
},
{
"docid": "72533b294423e4b1638ac9abc26e5311",
"score": "0.5759324",
"text": "def pledged_projects\n pledges.map { |pledge| pledge.project }.uniq\n end",
"title": ""
},
{
"docid": "389c842e6790ac3b9a90e0b44c3864c9",
"score": "0.5756421",
"text": "def project_types\n ProjectType.all\n end",
"title": ""
},
{
"docid": "4996fafa9cbbf3cab2a8a06c1fd6c0ff",
"score": "0.57168543",
"text": "def projects\n @projects\n end",
"title": ""
},
{
"docid": "1b315397e5ad3967c427805dcd114380",
"score": "0.5710302",
"text": "def all\n Request::Projects.list.map { |project| new project }\n end",
"title": ""
},
{
"docid": "f2466bc8d5aac3931098c544729e5861",
"score": "0.5684355",
"text": "def projects\n @projects ||= ModelCollection.new(\n records: find_projects,\n record_class: Project\n )\n end",
"title": ""
},
{
"docid": "11b1559556ccc2930fe9fe83410a22a7",
"score": "0.56831676",
"text": "def get_projects\n\t\tProject.where(active: true).order(name: :asc)\n\tend",
"title": ""
},
{
"docid": "3884acd06b696311c1e5269be990e70a",
"score": "0.56801283",
"text": "def core_project_names\n @projects.values.select { |p| p.core_project? }.map { |p| p.name }\n end",
"title": ""
},
{
"docid": "9122224e67c9f51dd151e50dc8380e97",
"score": "0.56794906",
"text": "def dependencies\r\n @dependencies ||= []\r\n result = @dependencies.collect do |project_name|\r\n if(@dir)\r\n config = \"#{File.dirname(dir)}/#{project_name}/project.yaml\"\n if(File.exist?(config))\r\n Project.load(config)\n else\n nil\n end\r\n else\r\n # Used in testing, when it's often too cumbersome to set up a dir\r\n Project.new(project_name)\r\n end\r\n end\n result.delete_if {|x| x.nil? } \r\n result.freeze\r\n result\r\n end",
"title": ""
},
{
"docid": "0b5abe9842c0d973d6a1088f869dea0a",
"score": "0.56735116",
"text": "def past_projects\n return @past_projects\n end",
"title": ""
},
{
"docid": "4ad682be4c521f27b9fe6d4e24982d6f",
"score": "0.5645393",
"text": "def getAllWritableProjects( )\n\n # parameter TypeCheck\n\n # BIMserver request\n request( { } )\n end",
"title": ""
},
{
"docid": "529b3be2878ab223cdd1dbdcecc57e0d",
"score": "0.562971",
"text": "def all_changed_files\n Set.new\n .merge(git.added_files.to_a)\n .merge(git.modified_files.to_a)\n .merge(git.renamed_files.map { |x| x[:after] })\n .subtract(git.renamed_files.map { |x| x[:before] })\n .to_a\n .sort\n end",
"title": ""
},
{
"docid": "8f4e417383d5a3d229e9b0ae7d0d1475",
"score": "0.5628557",
"text": "def closed_projects \n list = []\n projects = self.my_projects.where(\"success_yn is null and complete_time < NOW()\")\n projects.collect{|p| list << p.id.to_i unless list.include?(p.id.to_i)}\n return list\n end",
"title": ""
},
{
"docid": "70feb1554ff3c792c4c296cacc17574a",
"score": "0.5627417",
"text": "def projects\n @projects ||= api.get('/projects.json').collect { |hash|\n Ketchup::Project.new(api, hash)\n }\n end",
"title": ""
},
{
"docid": "0319e0babd9e3abe4998313755274af4",
"score": "0.56259656",
"text": "def backed_projects\n # go through project class\n \n backerarray = ProjectBacker.all.select do |backer|\n backer.backer == self\n end\n backerarray.map do |ba|\n ba.project\n end\n end",
"title": ""
},
{
"docid": "df995155bf4bf6ddf4a3a0facc1712ea",
"score": "0.561942",
"text": "def projects\n if @content.nil?\n load_data\n end\n\n result = []\n\n projects = @content.root.find('./project')\n projects.each do |p|\n result << p.find_first('slug').content\n end\n result\n end",
"title": ""
},
{
"docid": "464cadbcf22c38e24dc7a94ee9887108",
"score": "0.5617138",
"text": "def all_changed_files\n Set.new\n .merge(git.added_files.to_a)\n .merge(git.modified_files.to_a)\n .merge(git.renamed_files.map { |x| x[:after] })\n .subtract(git.renamed_files.map { |x| x[:before] })\n .to_a\n .sort\n end",
"title": ""
},
{
"docid": "464cadbcf22c38e24dc7a94ee9887108",
"score": "0.5617138",
"text": "def all_changed_files\n Set.new\n .merge(git.added_files.to_a)\n .merge(git.modified_files.to_a)\n .merge(git.renamed_files.map { |x| x[:after] })\n .subtract(git.renamed_files.map { |x| x[:before] })\n .to_a\n .sort\n end",
"title": ""
},
{
"docid": "396ffb13f769f1489b14e43058e9e8eb",
"score": "0.56145775",
"text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end",
"title": ""
},
{
"docid": "396ffb13f769f1489b14e43058e9e8eb",
"score": "0.56145775",
"text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end",
"title": ""
},
{
"docid": "3ad19797dedb28a1031a432b3b8c01ee",
"score": "0.5607686",
"text": "def projects\n Google::Compute::ResourceCollection.new(\n :resource_class => Google::Compute::Project, :dispatcher => @dispatcher)\n end",
"title": ""
},
{
"docid": "c389a54a50508a23859ae687eec7e09d",
"score": "0.559781",
"text": "def changed\n @changed ||= Set.new\n end",
"title": ""
},
{
"docid": "4a23323b482bb1d376c7eebacc47a087",
"score": "0.5596315",
"text": "def list\n get('projects')['projects']\n end",
"title": ""
},
{
"docid": "fcd6e54fd110043c0520d49b6b505bcd",
"score": "0.55943435",
"text": "def issues\n Issue.all.select do |issue|\n issue.project == self\n end\n end",
"title": ""
},
{
"docid": "f722d82d537947eb7718054c63973b60",
"score": "0.5593811",
"text": "def projects\n project_objects = Asana.get \"projects?workspace=#{self.id}\"\n\n project_objects[\"data\"].map do |project|\n Project.new :id => project[\"id\"], :name => project[\"name\"], :workspace => self\n end\n end",
"title": ""
},
{
"docid": "be2ee5a5e5ba5ac35cc7b34ad69a95ee",
"score": "0.55870533",
"text": "def projects\n res = []\n\n tmp = GoodData.get @json['user']['links']['projects']\n tmp['projects'].each do |project_meta|\n project_uri = project_meta['project']['links']['self']\n project = GoodData.get project_uri\n res << GoodData::Project.new(project)\n end\n\n res\n end",
"title": ""
},
{
"docid": "91754edbcb39f4c669b75bbb2a4ae3e0",
"score": "0.55859125",
"text": "def all_reviewed_commits_changes\n all_changes_in_revisions @all_reviewed_commits\n end",
"title": ""
},
{
"docid": "a021894450b56fd5132555ef9b3710dc",
"score": "0.5574551",
"text": "def new_projects\n Project.where('client_id = ? and status = ?', self.id, \"new\")\n end",
"title": ""
},
{
"docid": "84ab042c1209b495c6ab8f6e45796f78",
"score": "0.55736786",
"text": "def extract_changes\n list = []\n\n command = 'git log --name-only --pretty=format:\"' +\n GIT_COMMIT_MARKER +\n '%ci' +\n GIT_FIELD_MARKER +\n '%aN' +\n GIT_FIELD_MARKER +\n '%H' +\n GIT_FIELD_MARKER +\n '%s%n%n%b' +\n GIT_FIELD_MARKER +\n '\"'\n\n changes = `#{command}`.split(RUBY_COMMIT_MARKER)\n\n changes.shift # throw the first (empty) entry away\n\n changes.each do |entry|\n date, who, id, msg, files = entry.split(RUBY_FIELD_MARKER)\n date = Time.parse(date)\n if files.nil?\n files = [ \"\" ]\n else\n files = files.split(\"\\n\")\n end\n list << Change.new(:id=>id, :date=>date, :who=>who, :msg=>msg, :files=>files)\n end\n\n return list\n end",
"title": ""
},
{
"docid": "4e2dbeefe233ca3f17ecbd0d5a07b848",
"score": "0.5572353",
"text": "def finalized_projects\n self.projects.where( :is_finalized => true )\n end",
"title": ""
},
{
"docid": "4e2dbeefe233ca3f17ecbd0d5a07b848",
"score": "0.5572353",
"text": "def finalized_projects\n self.projects.where( :is_finalized => true )\n end",
"title": ""
},
{
"docid": "af86f1359847737e19e67a2c261a72eb",
"score": "0.55636173",
"text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end",
"title": ""
},
{
"docid": "1723372872389239eef813ba98d28b1a",
"score": "0.5548355",
"text": "def get_project_diff_list(commit_range)\n\n modified_modules = Array.new\n\n commit_range = commit_range.gsub(\"...\", \"..\")\n\n modified_files = `git diff-tree -m -r --no-commit-id --name-only #{commit_range}`\n\n # write the modified files out to a file since issuing an inline echo command\n # with each as arguments can become too large for the shell to handle.\n open('modified_root_paths.out', 'w') { |f|\n f.puts \"#{modified_files}\"\n }\n\n modified_root_paths = `cat modified_root_paths.out | cut -d/ -f1 | uniq`\n modified_root_paths = modified_root_paths.split(/\\n+/)\n puts \"modified_root_paths: #{modified_root_paths.join(\" \")}\"\n\n root_modules = maven_module_list(\".\")\n modified_root_paths = modified_root_paths.delete_if { |item| root_modules.index(item) == nil }\n puts \"modified_root_modules: #{modified_root_paths.join(\" \")}\"\n\n modified_root_paths.each do |root_path|\n modified_modules.push(root_path)\n\n maven_module_list(root_path, true).each do |sub_module|\n modified_modules.push(\"#{root_path}/#{sub_module}\")\n end\n end\n\n modified_modules\nend",
"title": ""
},
{
"docid": "eafd84ffe538606c6919f489a3d8e102",
"score": "0.55435264",
"text": "def all_projects\n pro = worker_projects.to_a\n (pro << @user_options.account_group.projects).uniq if @user_options\n return pro\n end",
"title": ""
},
{
"docid": "847fd12a7228bfd315249965b4fa0f89",
"score": "0.55360985",
"text": "def get_project_files\n projects = []\n Find.find(PROJECT_FOLDER) do |file|\n if file=~/.yml$/\n projects << file\n end\n end\n\n projects\n end",
"title": ""
},
{
"docid": "16851c84f0487f76d9b710941a1910a6",
"score": "0.5527779",
"text": "def get_projects\n request('project', 'list', nil, resource[:auth]).collect do |project|\n project[:name]\n end\n end",
"title": ""
},
{
"docid": "16851c84f0487f76d9b710941a1910a6",
"score": "0.5527779",
"text": "def get_projects\n request('project', 'list', nil, resource[:auth]).collect do |project|\n project[:name]\n end\n end",
"title": ""
},
{
"docid": "e34f64ce8dd2aa0e8450a62d032aecc6",
"score": "0.5520591",
"text": "def backed_projects\n # First, get all ProjectBacker which are associated with self Backer\n project_bakers = ProjectBacker.all.select {|pb| pb.backer == self}\n # collect project\n project_bakers.map {|pb| pb.project}\n end",
"title": ""
},
{
"docid": "048f3a226a3a76fb5629b85ea24f5dbe",
"score": "0.55120975",
"text": "def backed_projects\n all_backers = ProjectBacker.all.select { |every| every.backer == self }\n all_backers.map { |each| each.project }\n end",
"title": ""
},
{
"docid": "77088cf860165d2dcdc482f731eecdcf",
"score": "0.5501021",
"text": "def active_project_names\n self.projects.select{|x| x.active == true}.map{|x| x.full_name}.sort\n end",
"title": ""
},
{
"docid": "deb1b6bd76bb4af60c2a0473b1d75ab3",
"score": "0.5499554",
"text": "def projects\n Project.in(id: allocations.map(&:project_id))\n end",
"title": ""
},
{
"docid": "63d2f2d2bf8b150b4a7da8da4fb5bbcb",
"score": "0.5480331",
"text": "def all_contributions(repos, since)\n projects = []\n\n spinner = TTY::Spinner.new(\"[:spinner] :title\", format: :pulse_2)\n\n repos.each do |repo|\n next unless repo[:twir]\n repo = repo[:repo]\n\n spinner.update(title: \"Getting contributions for #{repo}...\")\n spinner.auto_spin\n\n proj_data = @client.repository(repo)\n contribs_from_prs, commits_to_exclude = contribs_prs(repo: repo, since: since)\n direct_contribs = contribs_direct_commits(\n repo: repo,\n since: since,\n commits_to_exclude: commits_to_exclude\n )\n contributions = contribs_from_prs + direct_contribs\n contributions.sort!\n\n if contributions.any?\n projects << Project.new(\n name: proj_data[:name],\n description: proj_data[:description],\n repo: repo,\n contributions: contributions\n )\n end\n end\n\n spinner.stop('Done!')\n\n projects\nend",
"title": ""
},
{
"docid": "ab1722dd807263b1fae9a3541c008ae1",
"score": "0.5479458",
"text": "def get_managed_projects\n get_projects.select { |p| p.owner == @current_uid }\n end",
"title": ""
},
{
"docid": "18faa6a7f8cf1ede15e2963fbf561881",
"score": "0.54676235",
"text": "def project_names\n @projects.values.reject { |p| p.drupal? }.map { |p| p.name }\n end",
"title": ""
},
{
"docid": "4d6de686dc3aec98d135f6ae9218b1e1",
"score": "0.5465408",
"text": "def all_projects(conditions={})\n return @all_projects if @all_projects\n conditions.merge!(:client_id => get_ids(self.found_clients)) unless self.found_clients.empty?\n @all_projects = Project.active.all({ :order => [:name] }.merge(conditions))\n end",
"title": ""
},
{
"docid": "f4c51aa081780e654acce5e8a058c9c4",
"score": "0.54503614",
"text": "def getAllReadableProjects( )\n\n # parameter TypeCheck\n\n # BIMserver request\n request( { } )\n end",
"title": ""
},
{
"docid": "ec8452bf47c85569b81c8cf19cb5b59e",
"score": "0.544796",
"text": "def fetch_all_project\n Project.all.map(&:name)\n end",
"title": ""
},
{
"docid": "6297e1a6d54cfb72ddd9cd2947bbf8ec",
"score": "0.54463434",
"text": "def changesets\n sets = []\n \n @repos.log('', @model_row.revision, @repos.latest_revnum, 0, true, false\n ) do |changes, rev, author, date, msg|\n sets << Changeset.new(changes, rev, author, date, self)\n end\n \n sets.sort\n end",
"title": ""
},
{
"docid": "929f1800f83e1ceff2e092f6bacb9df8",
"score": "0.5442858",
"text": "def changeset\n @changeset ||= git_diff.map { |file_diff| FileDiff.new(file_diff) }\n end",
"title": ""
},
{
"docid": "34887c6705f557527895461550861285",
"score": "0.54421",
"text": "def backed_projects\n ProjectBacker.all.select{|project_backer| project_backer.backer == self}.map{|project_backer| project_backer.project}\n end",
"title": ""
},
{
"docid": "1c76eca5a9501001a3cadd2f400ceef5",
"score": "0.543825",
"text": "def project_versions(project)\n project_issues(project).collect(&:fixed_version).compact.uniq\n end",
"title": ""
}
] |
5d15b8f5d870cbd9b86a869ab7e936a2
|
=== before_filter (redirect on failure) Unless the current_user is_admin this redirects to root path with a warning User.user_admin.level > 1 Users of this sort can create contributors and edit more low level data.
|
[
{
"docid": "01d4581bfa5cd1f417ad1f7cf6fca409",
"score": "0.68947166",
"text": "def is_admin\n user = UserAdmin.find_by_user_id(current_user.id)\n unless user and user.level > 1\n redirect_to root_path, alert: \"You must be an adminstrator to access this page\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "ff599bf3fbf2f609624eba17eec5c63f",
"score": "0.7458608",
"text": "def admin_required \n\tunless current_user && (current_user.id < 1 || current_user.permission_level == 1) \n redirect_to '/' \n end \n end",
"title": ""
},
{
"docid": "7f8dcfe51e85c8dd2fd30c1af0b983c5",
"score": "0.72627",
"text": "def verify_super_admin\r\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\r\n\r\n end",
"title": ""
},
{
"docid": "8e328a837f61556ca636fbbee408917a",
"score": "0.7227205",
"text": "def users_level1(level = 1)\n if current_user\n if current_user.level <= level\n return true\n else \n #redirect_to :controller => \"users\", :action => \"index\", :notice => \"您的權限不足,未被授權允許進行此操作\"\n flash[:notice] = \"您的權限不足,未被授權允許進行此操作\"\n redirect_to :controller => \"users\", :action => \"index\" \n return false\n end\n else \n redirect_to :controller => \"users\" , :action => \"index\"\n return false\n end\n end",
"title": ""
},
{
"docid": "e2184543c9f71230bbfb7f9134497f74",
"score": "0.71903384",
"text": "def verify_super_admin\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\n\n end",
"title": ""
},
{
"docid": "f1b6576761e1434e3bb41378405a2011",
"score": "0.7167657",
"text": "def level_adm_kabkot (user_level)\n\t\tif user_level != \"adm_kabkot\"\n\t\t\tredirect_to \"/\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "48941fbce59a06fa8224b88ac64274ab",
"score": "0.71592546",
"text": "def redirect_unless_admin_user_logged_in\n return if current_user_admin?\n\n flash[:danger] = t('errors.access_denied')\n redirect_to access_denied_path\n end",
"title": ""
},
{
"docid": "77030a18fecde3b5f6d8ee03e6b35b6d",
"score": "0.7081461",
"text": "def restrict_to_admin\n if !current_user.admin?\n flash[:notice] = \"You are not authorized to view that page.\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "365e42f44caa182854f49142d2d1646a",
"score": "0.707351",
"text": "def admin_only\n if !is_admin?\n flash[:error] = \"Permission Denied\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "9ef126a9b0a178e9811c9e9d6d795f2c",
"score": "0.70649326",
"text": "def check_admin_permission\n redirect_to root_path unless @current_user.is_admin?\n end",
"title": ""
},
{
"docid": "5aa86f2deb3eeba05497719d52f966f1",
"score": "0.706253",
"text": "def admin_only\r\n if !current_user.blank? && !current_user.admin?\r\n flash[:error] = t(\"controllers.access_denied\")\r\n redirect_to root_path\r\n end\r\n end",
"title": ""
},
{
"docid": "5319ce98e7abab18f1d9046fb24a9671",
"score": "0.7058621",
"text": "def redirect_unless_admin\n unless current_user.try(:admin?)\n flash[:error] = 'Only admins can do that'\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "1bfb14d6d9f7ccc28a69dfb859e90538",
"score": "0.70426476",
"text": "def admin_only\n unless is_admin?\n flash[:warning] = \"You are not authorized to perform that action or view that page!\"\n if request.env['HTTP_REFERER'].nil?\n redirect_to root_url\n else\n redirect_to :back\n end\n end\n end",
"title": ""
},
{
"docid": "485ef3d1a3763fb4bda35529de942d43",
"score": "0.7040215",
"text": "def user_level1(level = 1)\n if current_user\n if current_user.level <= level\n return true\n else\n flash[:notice] = \"您的權限不足,請洽經理授權允許進行此操作\"\n redirect_to :controller => \"kojenadults\", :action => \"index\"\n return false\n end\n else \n redirect_to :controller => \"kojenadults\" , :action => \"index\"\n return false\n end\n end",
"title": ""
},
{
"docid": "c3c67a5e0aa0a184c5815e3680706a39",
"score": "0.70349085",
"text": "def redirect_if_insufficient_permissions\n return if current_user == @user ||\n current_user.admin? ||\n current_user.moderator?\n flash[:danger] = 'Access denied.'\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "b4ce63f96f30ccbde46d99a1db72aa8f",
"score": "0.70347947",
"text": "def admin_check\n redirect_to root_path if current_user.status != \"admin\"\n end",
"title": ""
},
{
"docid": "ceda8486d7fd80d1369651145f9ac9f8",
"score": "0.7025387",
"text": "def admin_only\n\t\tif !current_user.admin?\n\t\t\tredirect_to root_path\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7da1db4eba620093e0ce599cc6467d57",
"score": "0.70175713",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "021d43c4bf689b088190fb4f86f6a6a3",
"score": "0.701371",
"text": "def admin_only\n puts \"ARE YOU AN ADMIN? #{self.view_context.admin_access_level?}\"\n if !self.view_context.admin_access_level?\n redirect_to :back, :alert => \"Access Denied\"\n end\n end",
"title": ""
},
{
"docid": "c3b839f3d619f86d1f417d01fb42890b",
"score": "0.70128876",
"text": "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user) || current_user.level.to_i < 2\n end",
"title": ""
},
{
"docid": "3613b4d32bd1ac01fcd002d93d6dd063",
"score": "0.7011932",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || correct_user || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "880fa482c4dc5522a86ce816fa269185",
"score": "0.7008507",
"text": "def admin_user\r\n redirect_to root_path unless current_user.admin?\r\n end",
"title": ""
},
{
"docid": "3d6418be927f9eee0acf3f556081076d",
"score": "0.7006058",
"text": "def only_for_admin_user\n if !(is_admin_user?)\n redirect_to :action =>'error_403', :controller => 'errors'\n end\n end",
"title": ""
},
{
"docid": "262816fa662458e91b12e3f752ee5a22",
"score": "0.6994174",
"text": "def admin_only\n unless current_user.is_admin?\n redirect_to :back, :alert => \"Access denied.\"\n end\n end",
"title": ""
},
{
"docid": "dbb731c079bb593eb72cb9a9fa4f5f1d",
"score": "0.6986902",
"text": "def admin_user\n\t redirect_to(root_url) unless current_user.admin?\n\t end",
"title": ""
},
{
"docid": "489fd835ea8a02ec40aef3d2a7a00bd8",
"score": "0.6984323",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "489fd835ea8a02ec40aef3d2a7a00bd8",
"score": "0.6983757",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "a43d3c27fd214255a647742a1e15f6a3",
"score": "0.6977907",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless is_admin?\n\t\tend",
"title": ""
},
{
"docid": "aff243a8121dde12cc934ed7186093ae",
"score": "0.69757575",
"text": "def admin_user\n redirect_to(root_url) unless is_admin?(current_user)\n end",
"title": ""
},
{
"docid": "3e5bcb35cce6bab1689e552dc7ffe5d8",
"score": "0.6975311",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "3e5bcb35cce6bab1689e552dc7ffe5d8",
"score": "0.6975311",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? || current_user.super_admin?\n end",
"title": ""
},
{
"docid": "8d51f35bb1add9938b616f1227c3d33e",
"score": "0.697495",
"text": "def adminprotected!\n if authorized? == true and isuseradmin? == true\n return\n else redirect '/denied'\n end\n end",
"title": ""
},
{
"docid": "eef46e8e263b31424ecdc3cdc9116342",
"score": "0.6974573",
"text": "def redirect_not_admin\n unless current_user.access == 'admin'\n flash[:notice] = 'You cannot access that page.'\n redirect_to '/' \n end\n end",
"title": ""
},
{
"docid": "1ec90ae99171f3b14cb0c0f047342bdc",
"score": "0.69689816",
"text": "def admin_user\n redirect_to admin_url, alert: 'You have not permission to access this section !' unless is_admin?\n end",
"title": ""
},
{
"docid": "d57014aec1e36fa74f20c908bccdb57e",
"score": "0.69685763",
"text": "def require_admin\n\t\tredirect_to :root unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "d57014aec1e36fa74f20c908bccdb57e",
"score": "0.69685763",
"text": "def require_admin\n\t\tredirect_to :root unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "acd0445f3aff1fb2529a76fb8aba8c9f",
"score": "0.69636565",
"text": "def authorize_admin\n redirect_to root_path (flash[:alert] = 'You do not have access to that page.') unless current_user.try(:admin?)\n end",
"title": ""
},
{
"docid": "f05a419a11131339644e8cfadf693379",
"score": "0.6963227",
"text": "def require_admin\n if !current_user.admin?\n redirect_to root_path, alert: \"Geen bevoegdheid\"\n end\n end",
"title": ""
},
{
"docid": "62637906d6205e1f2a7d67eb6f1d2040",
"score": "0.6962424",
"text": "def admin_user\r\n redirect_to(root_url) unless current_user.admin?\r\n end",
"title": ""
},
{
"docid": "c233e605724e6bda95249842818add4b",
"score": "0.69623697",
"text": "def admin_user\n redirect_to(root_path) unless is_admin?\n end",
"title": ""
},
{
"docid": "515ea0030432510e1e7720af77c687db",
"score": "0.69612086",
"text": "def admin_only\n unless current_user.admin?\n redirect_to :root, :alert => \"Access denied.\"\n end\n end",
"title": ""
},
{
"docid": "dccb25b059a2bf33786834122133640c",
"score": "0.6954859",
"text": "def index\n if current_user.admin == true\n redirect_to manage_path\n else\n redirect_to \"/employees/#{current_user.level.to_s}\"\n end\n end",
"title": ""
},
{
"docid": "6e70a5a87d082b9c8e1c96eab3e5d4fc",
"score": "0.69535685",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\t\t\n\tend",
"title": ""
},
{
"docid": "3a14687dfe61f09c2c9ed209f8514f7c",
"score": "0.69533885",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin_powers?\n end",
"title": ""
},
{
"docid": "bee61606a8c1899aeb5151e54bb1a193",
"score": "0.69494003",
"text": "def admin_user\n\t \tredirect_to(root_url) unless current_user.admin?\n\t end",
"title": ""
},
{
"docid": "b1f959886ead6f9ebb43a69e5bc8d65b",
"score": "0.6939742",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "e5b552c8d8f8ee0ccb7fce3a0a7687dc",
"score": "0.69382554",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin_powers?\n end",
"title": ""
},
{
"docid": "c11658d7ce517f3dd25adfa06682e02a",
"score": "0.6937649",
"text": "def admin_user\n redirect_to(root_url) unless (logged_in? && current_user.admin?)\n end",
"title": ""
},
{
"docid": "ac4adefbebdda7f2dfbbd489d1a252dc",
"score": "0.6935472",
"text": "def admin_only\n unless current_user.admin?\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end",
"title": ""
},
{
"docid": "25c7ddc8381592eb3195eb35ffb51dd5",
"score": "0.69289076",
"text": "def admin_user\n \t\tredirect_to(root_url) unless current_user.admin?\n \tend",
"title": ""
},
{
"docid": "1f4fe21e8c65f788435792e46dcb41a1",
"score": "0.6923243",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "26882cdbaa060c80d3b278325eacd2c3",
"score": "0.6923064",
"text": "def admin_user\n redirect_to request.referrer || root_url unless current_user.admin?\n end",
"title": ""
},
{
"docid": "8804655dceb277dd72081f021b02aea4",
"score": "0.6920527",
"text": "def authorise_user\n redirect_to root_path unless @current_user.present? && @current_user.admin?\n end",
"title": ""
},
{
"docid": "484e9d70367ff43165a5012b8420a4a2",
"score": "0.69152856",
"text": "def admin_access \n unless current_user.admin? \n redirect_to root_path, notice: \"You aren't allowed to view this page\"\n end\n end",
"title": ""
},
{
"docid": "d056e861d87dbc7d2b4716480b1082f1",
"score": "0.69136214",
"text": "def admin_user\n \tredirect_to(root_url) unless current_user.admin?\t\t\n end",
"title": ""
},
{
"docid": "415464a49bf0b8ac277ff4195a620f5e",
"score": "0.6913364",
"text": "def admin_user\n redirect_back(fallback_location: root_path) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "93d7ced4ce18f5495226a43dcc9d28a1",
"score": "0.6912973",
"text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end",
"title": ""
},
{
"docid": "93d7ced4ce18f5495226a43dcc9d28a1",
"score": "0.6912973",
"text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end",
"title": ""
},
{
"docid": "93d7ced4ce18f5495226a43dcc9d28a1",
"score": "0.6912973",
"text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end",
"title": ""
},
{
"docid": "c1f161de91a4fca4529e490bac3996de",
"score": "0.6911164",
"text": "def admin_user\n redirect_to( root_url ) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "de590b23b3923971c2885d4caf0f6d78",
"score": "0.6910879",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "55acbb684a2131dcf8f6faa5b3e1ba03",
"score": "0.6910778",
"text": "def admin_user\n if logged_in?\n redirect_to root_url unless current_user.admin?\n elsif\n #flash[:failure] = \"Invalid Request\"\n redirect_to(root_url)\n end\n end",
"title": ""
},
{
"docid": "55acbb684a2131dcf8f6faa5b3e1ba03",
"score": "0.6910778",
"text": "def admin_user\n if logged_in?\n redirect_to root_url unless current_user.admin?\n elsif\n #flash[:failure] = \"Invalid Request\"\n redirect_to(root_url)\n end\n end",
"title": ""
},
{
"docid": "55acbb684a2131dcf8f6faa5b3e1ba03",
"score": "0.6910778",
"text": "def admin_user\n if logged_in?\n redirect_to root_url unless current_user.admin?\n elsif\n #flash[:failure] = \"Invalid Request\"\n redirect_to(root_url)\n end\n end",
"title": ""
},
{
"docid": "3f3ef70f37da5c294c491c8a2a2b18cc",
"score": "0.6907519",
"text": "def restrict_access\n if !current_user.admin?\n flash[:success] = \"You do not have access to this page\"\n redirect_to '/'\n end\n end",
"title": ""
},
{
"docid": "06ba2ab5010cf1f1066f9978cf9a7e50",
"score": "0.69068724",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"title": ""
},
{
"docid": "dbb88954cbcee029234e2249f5d760ea",
"score": "0.6906228",
"text": "def admin_user\n redirect_to( root_url ) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "06ba2ab5010cf1f1066f9978cf9a7e50",
"score": "0.690615",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"title": ""
},
{
"docid": "06ba2ab5010cf1f1066f9978cf9a7e50",
"score": "0.690615",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"title": ""
},
{
"docid": "da22dcb3bb55bfa3d0a55b93ce05f893",
"score": "0.68997914",
"text": "def check_admin\n redirect_to :root unless current_user.admin?\n end",
"title": ""
},
{
"docid": "0f3d372b0217d0e4dcf110377137485a",
"score": "0.6897916",
"text": "def admin_user\n redirect_to(root_path) unless (current_user != nil && current_user.admin == true)\n end",
"title": ""
},
{
"docid": "f7d17bb52889604c8b599e3dff409654",
"score": "0.6897712",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "f7d17bb52889604c8b599e3dff409654",
"score": "0.6897712",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "f7d17bb52889604c8b599e3dff409654",
"score": "0.6897712",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "9a55f332f24cbacb1d61aa76724c6015",
"score": "0.68966407",
"text": "def require_admin!\n return if current_user&.admin?\n flash[:alert] = '管理者以外はアクセスできません。'\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "5f16a0d6cf87cfa544cf1016dda33725",
"score": "0.6895699",
"text": "def admin_check\n\n \tif current_user.admin == false\n \t\tredirect_to main_index_path\n \tend\n\tend",
"title": ""
},
{
"docid": "acbfec63a2bffa7450f75dcfce5d508a",
"score": "0.6893723",
"text": "def require_admin\n redirect_to '/' unless current_user.admin? \n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.68935585",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6893207",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "fff9790967dea2b24edfeaf5bfcee2fc",
"score": "0.6892866",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
}
] |
67ef364a5d4b94fe5bf0fb61a7f58269
|
Creates a new reservation for a message.
|
[
{
"docid": "ad0265a82754eaf93bf3597acc7887ce",
"score": "0.0",
"text": "def touch_message_by_id(project_id, queue_name, message_id, opts = {})\n \n # verify the required parameter 'project_id' is set\n raise \"Missing the required parameter 'project_id' when calling touch_message_by_id\" if project_id.nil?\n \n # verify the required parameter 'queue_name' is set\n raise \"Missing the required parameter 'queue_name' when calling touch_message_by_id\" if queue_name.nil?\n \n # verify the required parameter 'message_id' is set\n raise \"Missing the required parameter 'message_id' when calling touch_message_by_id\" if message_id.nil?\n \n\n # resource path\n path = \"/{project_id}/queues/{queue_name}/messages/{message_id}/touch\".sub('{format}','json').sub('{' + 'project_id' + '}', project_id.to_s).sub('{' + 'queue_name' + '}', queue_name.to_s).sub('{' + 'message_id' + '}', message_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = Swagger::Request.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'] = Swagger::Request.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = Swagger::Request.object_to_http_body(opts)\n \n auth_names = ['oauth_token']\n response = Swagger::Request.new(:POST, path, @host, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :token => token}).make.body\n obj = TouchResponse.new() and obj.build_from_hash(response)\n end",
"title": ""
}
] |
[
{
"docid": "9940fbd2eaa8627e2383417a4a367682",
"score": "0.7395172",
"text": "def create\n reservation = project.reservations.build(reservation_params)\n if reservation.save\n reservation.create_notification\n reservation.create_chat_room\n redirect_to active_reservation_path(current_user, reservation), notice: '予約が完了いたしました'\n else\n render :new, locals: { new_reservation: reservation }\n end\n end",
"title": ""
},
{
"docid": "be7bf65b89309d14fb2ecadfda637719",
"score": "0.73365825",
"text": "def create_reservation(guest, room, party_size)\n if (!is_room_available?(room, party_size)) || (!guest.can_afford_to_pay?(@booking_fee))\n return nil\n end\n guest.pay(@booking_fee)\n @till += @booking_fee\n new_reservation = Reservation.new(guest, room, party_size)\n @reservations << new_reservation\n return \"Thanks, your reservation is held under #{new_reservation.guest.name}\"\n end",
"title": ""
},
{
"docid": "d70274bdd8d61886f761f6c386a2065a",
"score": "0.6960564",
"text": "def create\n Reservation.transaction do\n @reservation = Reservation.new(reservation_params)\n @reservation.room.lock!\n\n respond_to do |format|\n if @reservation.save\n @invoke_slack_webhook = true\n format.html { redirect_to @reservation, notice: '予約を登録しました' }\n format.json { render :show, status: :created, location: @reservation }\n if @reservation.room_id == 0 && !ENV[\"SCHEDULE_EMAIL_ADDRESS\"].blank?\n ScheduleMailer.schedule_mail(@reservation).deliver_now\n end\n else\n @invoke_slack_webhook = false\n format.html do\n set_rooms\n render :new\n end\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "429382f8a12b85fd95a6a3a727802d14",
"score": "0.6807423",
"text": "def create_reservation(guest_id:, room_id:, start_date:, end_date:)\n Reservation.new(\n guest_id: guest_id,\n room_id: room_id,\n start_date: start_date,\n end_date: end_date\n )\n end",
"title": ""
},
{
"docid": "f338d9c0237987c5e276a99d3bee3755",
"score": "0.6735482",
"text": "def create\n reservation = current_resident.reservations.new(reservation_attributes)\n\n if DebitReservation.new(reservation).create\n opts = { room_slug: reservation.room.to_slug }\n opts = opts.merge(date_to_param(reservation.starts_at))\n redirect_to room_calendars_path(opts)#,\n else\n render :new, locals: { reservation: reservation }\n end\n end",
"title": ""
},
{
"docid": "8482e500a048befea978868f524acbeb",
"score": "0.67107475",
"text": "def create_reservation(room_number, check_in, check_out)\n return Reservation.new(room_number, check_in, check_out)\n end",
"title": ""
},
{
"docid": "8ebfc90a9b0294f3d278ef9ea9416682",
"score": "0.66372323",
"text": "def create\n @reservation = @space.reservations.build(reservation_params.merge(user: authed_user))\n\n respond_to do |format|\n if @reservation.save\n ReservationMailer.created_email(@reservation, root_url.gsub(/\\/$/, '')).deliver_later\n format.html { redirect_to [@reservation.space.location.org, @reservation.space.location, @reservation.space, @reservation], notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: [@reservation.space.location.org, @reservation.space.location, @reservation.space, @reservation] }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27d88cdb8126c16c3ebecde332fad980",
"score": "0.66277975",
"text": "def create\n write_log(\"in create -\\n\")\n @reservation = Reservation.new(reservation_params)\n @user = User.find(session[:current_user_id])\n respond_to do |format|\n if @reservation.save\n UserMailer.reservation_confirmation(@user, @reservation).deliver\n UserMailer.car_repair_appointment(@user, @reservation).deliver\n\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c026ee818a39fbb5d6b415e65719f61",
"score": "0.6606218",
"text": "def make_reservation\n #@reservation = Reservation.new\n end",
"title": ""
},
{
"docid": "42188c91965f6d393b549ba33eadf475",
"score": "0.65970886",
"text": "def create_reservation(subject, owner = nil)\n\t\t\t\t\t\n\t\t\t\t\t# Create reservation\n\t\t\t\t\treservation = _create_reservation(subject, owner)\n\n\t\t\t\t\t# Store\n\t\t\t\t\treservation.save\n\n\t\t\t\t\treturn reservation\n\t\t\t\tend",
"title": ""
},
{
"docid": "bd2b4b9a05ca5c248be33d4dd9d92b2c",
"score": "0.6596251",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.user_id = current_user.id\n\n respond_to do |format|\n if @reservation.save\n\n # UserMailer.booking_create(current_user, @reservation).deliver\n # OwnerMailer.booking_create(@reservation).deliver\n\n Reward.create( user_id: @reservation.user_id, \n reservation_id: @reservation.id, \n points_total: 5*@reservation.party_size, \n points_pending: 5*@reservation.party_size, \n description: \"\")\n \n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf43bc9f55512fd5891d15094c73f103",
"score": "0.65651405",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n @reservation.assign_attributes(:user_id => current_user.try(:id))\n \n respond_to do |format|\n if @reservation.save\n ReservationMailer.notification(@reservation, @reservation.user).deliver\n format.html { redirect_to reservations_path, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d9fa55e32e88302c640f940bf92ccc3",
"score": "0.6557852",
"text": "def create\n @reservation = V2::Reservation.new(reservation_params)\n if @reservation.save\n flash[:notice] = \"An interview has been booked for #{@reservation.time_slot.start_datetime_human}\"\n send_notifications(@reservation)\n else\n flash[:error] = \"No time slot was selected, couldn't create the reservation\"\n end\n @available_time_slots = []\n @person = @reservation.person\n respond_to do |format|\n format.js {}\n format.html { render :new }\n end\n end",
"title": ""
},
{
"docid": "451760a4fdf1afe5af9e3a924cefbfc5",
"score": "0.65208286",
"text": "def create\n format_time_input\n check_input\n @reservation = Reservation.new(reservation_params)\n @reservation.status = :requested\n respond_to do |format|\n # TODO: Duplication\n if @conflicts.any?\n respond_to_conflicts :new, format\n elsif @reservation.save\n notify_approval_needed\n respond_to_update format\n else\n respond_to_errors :new, format\n end\n end\n end",
"title": ""
},
{
"docid": "639bbed905cfd1f89822eb75ce2a8bc0",
"score": "0.648546",
"text": "def create\n @vacation_property = VacationProperty.find(params[:reservation][:property_id])\n @reservation = @vacation_property.reservations.create(reservation_params)\n\n if @reservation.save\n flash[:notice] = \"Sending your reservation request now.\"\n @reservation.notify_host\n redirect_to @vacation_property\n else\n flash[:danger] = @reservation.errors\n end\n end",
"title": ""
},
{
"docid": "5c065eb7809307ef3ebe89965e371083",
"score": "0.64848167",
"text": "def create\n begin\n ActiveRecord::Base.transaction do\n if !current_user.type.eql?(\"Admin\")\n @reservation = Reservation.new(reservation_params)\n @reservation.client_id = current_user.id\n @reservation.save!\n flash[:success] = \"Has hecho la compra satisfactoriamente.\"\n redirect_to root_path\n else\n flash[:warning] = \"No está autorizado\"\n redirect_to root_path\n end\n end\n rescue Exception => exc\n flash[:danger] = exc.message\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "a5bcda4556afa746dea7ea2cef83d25c",
"score": "0.64781874",
"text": "def new_reservation(room, checkin_date, checkout_date)\n (checkin_date...checkout_date).each do |day|\n if !room.is_available?(day)\n raise ArgumentError.new(\"Room#{room.room_num} is not available\")\n end\n end\n reservation = BookingSystem::Reservation.new(room: room, checkin_date: checkin_date, checkout_date: checkout_date)\n add_reservation(reservation)\n room.add_reservation(reservation)\n end",
"title": ""
},
{
"docid": "d25791a6762c1e982c209f74cd70e94d",
"score": "0.64711887",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n EventNotification.notify_admin(@reservation).deliver\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ff2cc7383ffb553dd95771f8c2f15a8",
"score": "0.6434639",
"text": "def new\n\t\t@reservation = Reservation.new\n\tend",
"title": ""
},
{
"docid": "3751bc3eb8010aa3baa0f04898171c5b",
"score": "0.64146674",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.user_id = current_user.id\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5112e125dbff3190cf6a14fea1ebf1b",
"score": "0.6403878",
"text": "def create\n @user = User.user_by_token(request.cookies[\"token\"])\n return unless valid_form?\n\n @reservation = Reservation.new(reservation_params)\n @reservation.user = @user\n\n render json: { error: \"The time selected is not available.\" }, status: :unauthorized and return unless valid_time?\n render json: { error: \"Reservation time too long.\" }, status: :unauthorized and return false unless valid_length?\n unless valid_vaccine?\n render json: { error: \"You must be vaccinated to use this amenity.\" }, status: :unauthorized and return false\n end\n\n save_reservation\n end",
"title": ""
},
{
"docid": "9cf5823c9e8d8ff1f3326e6625600f31",
"score": "0.6397778",
"text": "def create\n space = Space.find(params[:space_id])\n group = Group.find(space.group_id)\n group_member_ids = Member.where(group_id: group.id).pluck(:user_id)\n unless group_member_ids.include?(@current_user.id)\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render json: @reservation, status: :created\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d71c07e3aa68a235bf17500aacf8e379",
"score": "0.6397659",
"text": "def new\n @reserve = Reservation.new\n end",
"title": ""
},
{
"docid": "7a30b2a340517d7991fae4f792679f17",
"score": "0.6364492",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @user = current_user\n @date = (@reservation.reserved_on).to_formatted_s(:long_ordinal)\n @date_of_return = (@reservation.reserved_on + 1.month).to_formatted_s(:long_ordinal)\n respond_to do |format|\n if @reservation.save\n ReservationMailer.create_reservation_notifier(@user, @date, @date_of_return).deliver\n format.html { redirect_to reservations_url, notice: 'Reservation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reservation }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aea03c1f542c12eb1d5ad16be2e8fb8",
"score": "0.634656",
"text": "def create\n # @reservation = Reservation.new(reservation_params)\n @reservation = current_user.reservations.create!(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n # current_user.book! @reservation\n end",
"title": ""
},
{
"docid": "28a33b37385b9f88bc393b6ba0cdca41",
"score": "0.63419455",
"text": "def create\n @reservation_room = ReservationRoom.new(reservation_room_params)\n @reservations = Reservation.all\n \n respond_to do |format|\n if @reservation_room.save\n format.html { redirect_to @reservation_room, notice: 'La habitacion se ha asignado a la reserva correctamente.' }\n format.json { render action: 'show', status: :created, location: @reservation_room }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "265ca027aada1ff7fd33fb7b8236eca4",
"score": "0.63288575",
"text": "def _create_reservation(subject, owner = nil)\n\t\t\t\t\t\n\t\t\t\t\t# Create reservation\n\t\t\t\t\treservation = RicReservation.reservation_model.new\n\t\t\t\t\treservation.kind = \"resource\"\n\t\t\t\t\treservation.resource = self\n\n\t\t\t\t\t# Bind subject\n\t\t\t\t\treservation.date_from = subject.date_from\n\t\t\t\t\treservation.time_from = subject.time_from\n\t\t\t\t\treservation.date_to = subject.date_to\n\t\t\t\t\treservation.time_to = subject.time_to\n\t\t\t\t\treservation.subject = subject\n\t\t\t\t\t\n\t\t\t\t\t# Bind owner\n\t\t\t\t\tif !owner.nil?\n\t\t\t\t\t\treservation.owner_name = owner.name if !owner.name.nil?\n\t\t\t\t\t\treservation.owner = owner if owner.is_a?(ActiveRecord::Base) # In case owner is not ActiveRecord, only name can be stored\n\t\t\t\t\tend\n\n\t\t\t\t\treturn reservation\n\t\t\t\tend",
"title": ""
},
{
"docid": "8e6e2afc13e2d9283d68fd188f0964b4",
"score": "0.6322775",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n if user_signed_in?\n @reservation.user_id = current_user.id\n elsif owner_signed_in?\n @reservation.owner_id = current_owner.id\n @reservation.restaurant = current_owner.restaurant\n end\n\n respond_to do |format|\n if @reservation.save\n\n if user_signed_in?\n Reward.create( user_id: @reservation.user_id, \n reservation_id: @reservation.id, \n points_total: 5*@reservation.party_size, \n points_pending: 5*@reservation.party_size, \n description: \"\")\n end\n \n if user_signed_in?\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { redirect_to root_url, notice: 'Reservation was successfully created.' }\n end\n\n # UserMailer.booking_create(current_user, @reservation).deliver\n # OwnerMailer.booking_create(@reservation).deliver\n else\n format.html { render action: \"new\" }\n # format.html { redirect_to new_reservation_path(reservation: params[:reservation]) }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
},
{
"docid": "c29eacb38395ca9f72c64769997873a6",
"score": "0.6314948",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c29eacb38395ca9f72c64769997873a6",
"score": "0.6314948",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3312817eb43eed407d280bac6f86056d",
"score": "0.63145614",
"text": "def _create_resevation(base, subject, owner)\n\t\t\t\t\t\n\t\t\t\t\t# Create reservation\n\t\t\t\t\treservation = RicReservation.reservation_model.new\n\t\t\t\t\treservation.kind = \"event\"\n\t\t\t\t\treservation.event = self\n\t\t\t\t\treservation.date_from = base\n\t\t\t\t\treservation.date_to = base + (self.date_to - self.date_from).to_i.days\n\t\t\t\t\treservation.time_from = self.time_from\n\t\t\t\t\treservation.time_to = self.time_to\n\n\t\t\t\t\t# Bind subject\n\t\t\t\t\tif !subject.nil?\n\t\t\t\t\t\treservation.size = subject.size\n\t\t\t\t\t\treservation.subject = subject\n\t\t\t\t\telse\n\t\t\t\t\t\treservation.size = self.default_reservation_size\n\t\t\t\t\tend\n\n\t\t\t\t\t# Bind owner\n\t\t\t\t\tif !owner.nil?\n\t\t\t\t\t\treservation.owner_name = owner.name if !owner.name.nil?\n\t\t\t\t\t\treservation.owner = owner if owner.is_a?(ActiveRecord::Base) # In case owner is not ActiveRecord, only name can be stored\n\t\t\t\t\tend\n\n\t\t\t\t\treturn reservation\n\t\t\t\tend",
"title": ""
},
{
"docid": "270c7485a3fd83c60670bede0536697e",
"score": "0.6293342",
"text": "def create\n if current_user.check_reservations\n return redirect_back(fallback_location: root_url,alert: \"You already have #{Variable.find_by_name(\"MAX_RESERVATIONS\").value} reservations in progress. Please deliver one of these first to make more reservations.\")\n else\n @reservation = Reservation.new(reservation_params)\n ending_time = (@reservation.job.duration / Variable.find_by_name(\"RESERVATION_FACTOR\").value.to_f)*24*60*60\n @reservation.ending_time = Time.now + ending_time\n @reservation.status = \"LIVE\"\n job = @reservation.job\n @reservation.amount = @reservation.job.amount\n respond_to do |format|\n if @reservation.save\n @reservation.job.update(status: \"RESERVED\")\n TimerJob.set(wait_until: @reservation.ending_time).perform_later(@reservation,\"LIVE\")\n format.html { redirect_to @reservation, notice: \"Job reserved successfully.\" }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c7cf73f6a5967674beab4e9cb4ec2bad",
"score": "0.6290507",
"text": "def create_reservation(base = self.date_from, subject = nil, owner = nil)\n\t\t\t\t\t\n\t\t\t\t\t# Create reservation\n\t\t\t\t\treservation = _create_resevation(base, subject, owner)\n\n\t\t\t\t\t# Store\n\t\t\t\t\treservation.save\n\n\t\t\t\t\treturn reservation\n\t\t\t\tend",
"title": ""
},
{
"docid": "62ff8f1bb0d54a7974be81862fd7c1c9",
"score": "0.62471884",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b317e2ec9e882ff17a7fdf77ad7b7d28",
"score": "0.62397325",
"text": "def create\r\n @reservation = Reservation.new(reservation_params)\r\n @reservation.user = current_user\r\n\r\n respond_to do |format|\r\n if @reservation.save\r\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\r\n format.json { render :show, status: :created, location: @reservation }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "bc620799831da5e8d7c8fd89456be68c",
"score": "0.62356323",
"text": "def create_reservation(user:, hotel:)\n reservation = Reservation.new(\n user: user,\n hotel: hotel,\n arrival_time: Time.new(2000, 1, 1, 15, 0, 0, \"+00:00\").utc,\n departure_time: Time.new(2000, 1, 1, 11, 0, 0, \"+00:00\").utc,\n check_in_date: Date.today + rand(0..10),\n reservation_number: rand(5555..9999),\n number_of_guests: rand(1..3),\n purpose: %w[travel work leisure].sample,\n channel: %w[website airbnb booking.com].sample,\n room_number: \"#{rand(1..4)}0#{rand(1..3)}\".to_i\n )\n reservation.check_out_date = reservation.check_in_date + rand(1..5)\n reservation.save\nend",
"title": ""
},
{
"docid": "c803a5c96b65747bb2cebffe16ca2a74",
"score": "0.6213899",
"text": "def make_reservation(range)\n\t\t\troom = room_finder(range).first\n\t\t\tnew_reservation = Hotel::Reservation.new(room, range)\n\t\t\t@reservations << new_reservation\n\t\t\troom.reservations << new_reservation\n\n\t\t\treturn new_reservation\n\t\tend",
"title": ""
},
{
"docid": "7979782736829ac5d1dcd32e15e06f89",
"score": "0.6212075",
"text": "def create\r\n @reservation = Reservation.new(reservation_params)\r\n respond_to do |format|\r\n if @reservation.save\r\n format.html { redirect_to reservations_path, notice: 'Reservation was successfully created.' }\r\n format.json { render :show, status: :created, location: @reservation }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "57a653958f76bd8d59c16e54c0d4244d",
"score": "0.6199625",
"text": "def save_reservation(first_date, second_date, num_of_rooms: 1, customer_id: nil, room_cost: 200)\n\n\t\t\t# change list_room_by_range to return argument rather than string\n\t\t\tavailable_rooms = list_room_by_range(first_date,second_date)\n\t\t\tchosen_rooms = available_rooms.take(num_of_rooms)\n\n\t\t\traise ArgumentError, \"No rooms available\" if chosen_rooms.empty?\n\n\t\t\tchosen_rooms.map!{|room| room.id}\n\n\t\t\tnew_reservation = HotelManager::Reservation.new(\n\t\t\t\tid: @reservation_blocks.length + 1, \n\t\t\t\tcustomer_id: customer_id, \n\t\t\t\tstart_date: first_date, \n\t\t\t\tend_date: second_date,\n\t\t\t\troom_cost: room_cost, \n\t\t\t\troom_ids: chosen_rooms\n\t\t\t)\n\n\t\t\t@reservation_blocks << new_reservation\n\t\tend",
"title": ""
},
{
"docid": "c00328510cb352417b9e769b94131b95",
"score": "0.6193999",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @room = Room.where(\"room_number LIKE ?\", @reservation.room_number)\n if session[:role] != \"admin\"\n @member = Member.where(\"email LIKE ?\", session[:email])\n else\n @member = Member.where(\"email LIKE ?\", params[:members_email])\n if @member.nil? or @member.empty?\n flash[:notice] = \"Member not found !\"\n render 'reservations/newreservation' and return\n end\n end\n @current_reservations = Reservation.where(\"room_number LIKE ? and ? <= end_time and start_time <= ? \", @reservation.room_number,\n @reservation.start_time, @reservation.end_time)\n if not @current_reservations.nil? and not @current_reservations.empty?\n flash[:notice] = \"This room is not available at this time. Conflicts with other reservation which starts at #{@current_reservations.first.start_time} \"\n render 'reservations/newreservation' and return\n end\n\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time + 2.hours < @reservation.end_time\n flash[:notice] = \"ERROR : Reservation can be made only for 2 hours at a time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now + 7.days < @reservation.start_time\n flash[:notice] = \"ERROR : Reservation can be made only 1 week in advance from today\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time == @reservation.end_time\n flash[:notice] = \"ERROR: Please book the room for atleast 1 minute!\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now - 5.minutes >= @reservation.start_time\n flash[:notice] = \"ERROR: Booking start time should not be less than current time\"\n render 'reservations/newreservation' and return\n end\n\n #User can only reserve one room at a perticular date and time without extra permission from admin\n @user_reservations = Reservation.where(\"members_id = ? and ? <= end_time and start_time <= ? \", @member.first.id,\n @reservation.start_time, @reservation.end_time)\n if not @user_reservations.empty? and @member.first.isMultipleReservationAllowed != \"Yes\"\n flash[:notice] = \"ERROR : You already have reservation from #{@reservation.start_time} to #{@reservation.end_time} .\n You can't book room during this time interval. Contact Administrator if you want to book multiple rooms with\n overlapping time intervals\"\n render 'reservations/newreservation' and return\n end\n\n @reservation.room_id = @room.first.id\n @reservation.status = \"Booked\"\n @member.first.reservations << @reservation\n SendEmail.reservation_email(@member.first, @reservation).deliver\n\n\n respond_to do |format|\n if @member.first.save\n @member.first.reservations.each do |res|\n end\n\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' and return }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "691a8e03600406fa3b7e1e7a7fef5fc7",
"score": "0.61912715",
"text": "def reserve(params)\n AmazonProcessor.validate_reservation_response params\n raise PreconditionsError, 'Payment state should be :created' unless payment.created?\n r_amount = Remit::RequestTypes::Amount.new ({value: payment.amount, currency_code: 'USD'})\n caller_ref = new_caller_reference\n request = Remit::Reserve::Request.new ({\n recipient_token_id: recipient_token,\n sender_token_id: params[:tokenID],\n caller_reference: caller_ref,\n transaction_amount: r_amount,\n charge_fee_to: 'Caller'\n })\n\n response = remit.reserve(request)\n\n raise ApiInteractionError, response.errors.join('; ') unless response.errors.empty?\n\n update_attribute :transaction_id, response.reserve_result.transaction_id\n update_attribute :caller_reference, caller_ref\n payment.update_attribute :state, :reserved\n end",
"title": ""
},
{
"docid": "5aacee7421bcd1acf8f492f08e671391",
"score": "0.6187969",
"text": "def add_reservation(room, checkin_date, checkout_date)\n\n unless @all_rooms.include?(room)\n raise ArgumentError, \"There is no room #{room} available\"\n end\n\n unless check_availability(checkin_date, checkout_date).include?(room)\n raise ArgumentError, \"That room is already reserved\"\n end\n \n reservation = Hotel::Reservation.new(room, checkin_date, checkout_date, @room_rate)\n @all_reservations << reservation\n\n return reservation\n end",
"title": ""
},
{
"docid": "aec61a93fac14d1835227adb20d49b55",
"score": "0.61866903",
"text": "def create_reservations\n Time.use_zone(@timezone) do\n @reservations = build_reservations\n return nil unless @reservations.any?\n @reservations = commit_reservations(@reservations)\n return nil unless valid? && @reservations.all?(&:persisted?)\n charge(@reservations) && @reservations.each(&:reload) if @pay\n track(@reservations)\n\n @reservations\n end\n end",
"title": ""
},
{
"docid": "2fff71989c445b8b3dbf5a8f6f5616bc",
"score": "0.61842",
"text": "def create\n @reservation = Reservation.new\n @reservation.user = current_user\n @reservation.place = Place.find(params[:place_id])\n @reservation.save\n redirect_to user_path(current_user), notice: \"Your booking was submitted and it's awaiting confirmation.\"\n end",
"title": ""
},
{
"docid": "d1faddde684f4512964197eee3bbdf5e",
"score": "0.6177396",
"text": "def add_reservation(room_selection, check_in, check_out)\n # self.add_block()\n # self.add_reservation_to_block()\n @reservations << Hotel::Reservation.new(room_selection, check_in, check_out)\n end",
"title": ""
},
{
"docid": "d27ad0eabe4c952af35b2f9c32c0816b",
"score": "0.6167689",
"text": "def reserve(*args)\n @reservations << Reservation.new(self, *args)\n end",
"title": ""
},
{
"docid": "8346a1bfdeb68d5ae043fd7987720cb3",
"score": "0.61657983",
"text": "def create\n \treserve_params = params[:reservation]\n @reserve = current_user.reservations.new(:category_id => reserve_params[:category_id], :date_in => reserve_params[:date_in], :date_out => reserve_params[:date_out], :room_id => reserve_params[:room_id])\n reserved = Reservation.is_reserved(reserve_params[:room_id],reserve_params[:date_in],reserve_params[:date_out])\n unless reserved\n respond_to do |format|\n if @reserve.save\n format.html { redirect_to myrooms_path, notice: 'Room has been booked' }\n format.json { render :show, status: :created, location: @reserve }\n else\n format.html { render :new }\n format.json { render json: @reserve.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to myrooms_path, notice: 'The Room is already Booked' }\n end\n end\n end",
"title": ""
},
{
"docid": "491007fbb461707d2ae314f5255c9373",
"score": "0.6149006",
"text": "def reservation_params\n params.require(:reservation).permit(:email, :request_date_time, :message, :user_id, :brewery_id)\n end",
"title": ""
},
{
"docid": "3cd718453b8b065000b69289e195ff06",
"score": "0.61448485",
"text": "def reserved\n @book = Book.find(params[:book_id])\n @reservation = Reservation.new(\n user_id: current_user.id,\n book_id: @book.id,\n price: @book.price\n )\n @reservation.save!\n end",
"title": ""
},
{
"docid": "2359034662806c3d3e1ac18149879640",
"score": "0.61374646",
"text": "def create\n reservation_id = SecureRandom.uuid\n\n Reservation::Worker::Process.perform_async(reservation_id, Time.zone.now.to_i, reservation_params)\n\n render json: { reservation_id: reservation_id }, status: 200\n end",
"title": ""
},
{
"docid": "eca8a1ca835e4c8eed8a3595936bafc4",
"score": "0.61370975",
"text": "def reserve_room\n puts \"Reminder: you have \".red + students_in_my_club.count.to_s.red + \" members \".red + \"in your club\".red\n puts \"Be sure to choose a room with enough seats\".red\n puts \"Here are the room numbers that are available for reservations: #{Room.numbers}\"\n puts \"Please enter only the room number for the room that you would like to reserve\"\n input_room_number = gets.chomp.to_i\n my_room = Room.all.find_by room_number: input_room_number\n puts \"Please enter the date that you will need the room in MM/DD/YY format\"\n puts \"The room will be available to you from 3:30pm to 5:00pm on the selected date\"\n my_date = gets.chomp\n Reservation.create(teacher_id: self.id, room_id: my_room.id, date: my_date)\n puts \" \"\n puts \"Room number \" + input_room_number.to_s.red + \" has been reserved for you on \" + my_date.red\n puts \"\"\n puts \"Have a great day! Plese restart the program if you need to take additional actions\" \n end",
"title": ""
},
{
"docid": "dea29561d6236e4b3721fc542beecdd2",
"score": "0.61326283",
"text": "def reservation_params\n params.require(:reservation).permit(:name, :phone_number, :message)\n end",
"title": ""
},
{
"docid": "5d0ba5df81b437c6b60fd8136252ccc0",
"score": "0.6130199",
"text": "def create\n @reserved_room = ReservedRoom.new(reserved_room_params)\n\n respond_to do |format|\n if @reserved_room.save\n format.html { redirect_to @reserved_room, notice: 'Reserved room was successfully created.' }\n format.json { render :show, status: :created, location: @reserved_room }\n else\n format.html { render :new }\n format.json { render json: @reserved_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd42d51b04969f84d99359a3c9543d15",
"score": "0.6109415",
"text": "def make_reservation(check_in, check_out, rooms)\n unavailable_rooms = []\n\n if room_flagged_available?(check_in, check_out, rooms, unavailable_rooms)\n @reservations.push(Reservation.new(check_in, check_out, rooms))\n else\n raise ArgumentError.new(\"Room: #{unavailable_rooms} not available\")\n end\n end",
"title": ""
},
{
"docid": "3307ec8d0617644540638fa6abe24ca1",
"score": "0.6099697",
"text": "def make_resevation(date_range)\n available_rooms = get_available_rooms(date_range)\n if available_rooms.length < 1\n raise ArgumentError\n end\n new_reservation = Hotel::Reservation.new(date_range,available_rooms[0])\n @reservations << new_reservation\n return new_reservation\n end",
"title": ""
},
{
"docid": "d1736b7a59b28abcab95981885515a7d",
"score": "0.6098139",
"text": "def reserve_room(start_date, end_date)\n if start_date.class != Date || end_date.class != Date\n raise ArgumentError.new(\"Please input valid dates\")\n else\n reservation = Reservation.new(start_date, end_date)\n @reservations << reservation\n return reservation\n end\n end",
"title": ""
},
{
"docid": "43ea76b927e5c9c005f36069833718f3",
"score": "0.6069687",
"text": "def create\n reservation = Reservation.new(reserve_params)\n respond_to do |format|\n if reservation.update(reserve_params)\n format.html { render :show,:locals => {:reservation => reservation}, notice: 'Reservation was successfully created.' }\n format.json { render :show,:locals => {:reservation => reservation}, status: :ok, location: reservation }\n else\n format.html { render :edit,:locals => {:reservation => reservation} }\n format.json { render json: reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d4f8a51507eddb06e9e7f14a440fa9e",
"score": "0.6068496",
"text": "def create\n @reservation = Reservation.new(reservation_params) \n respond_to do |format|\n if @reservation.save\n\n Reservation.last.reservation_rooms.each do |reservation|\n #Cambio el estado de la habitacion\n reservation.update({start: reservation.check_in, end: (reservation.check_out.to_date)+1,title: \"Reserva: \"+Room.find(reservation.room_id).identificador ,textColor: \"#ffffff\"})\n #Le pongo check_in y check_out para el calendario\n Room.find(reservation.room_id).update({state_id: 3})\n end\n\n format.html { redirect_to reservations_path(), notice: 'Reservacion creada exitosamente.' }\n #format.json { render :show, status: :created, location: @reservation }\n else\n #@my_reservation_requests = ReservationRequest.find(reservation_params[:reservation_request_id])\n #@reservation.reservation_requests.build()\n @reservation.reservation_rooms.build() \n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3de1444d8d584b972c523c315ca8d62e",
"score": "0.6064144",
"text": "def make_room_reservation(test_range, room)\n overlapping = self.list_room_reservations(room, test_range)\n if overlapping.length != 0\n raise ArgumentError.new(\"room not available in that date range\")\n else\n new_res = Reservation.new(date_range: test_range, room: room)\n @reservations << new_res\n return new_res\n end\n end",
"title": ""
},
{
"docid": "e666c4d5898833e9691dff838a8a1a56",
"score": "0.6061356",
"text": "def create\n @reservation = @brewery.reservations.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { notification }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "566b450c062200e4a5130e6ae4363034",
"score": "0.60519433",
"text": "def create\n @space_reservation = SpaceReservation.new(space_reservation_params)\n\n respond_to do |format|\n if @space_reservation.save\n format.html { redirect_to @space_reservation, notice: 'Space reservation was successfully created.' }\n format.json { render :show, status: :created, location: @space_reservation }\n else\n format.html { render :new }\n format.json { render json: @space_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a77542a0e9da82bd2709c58623eb9a1b",
"score": "0.60395324",
"text": "def create_reservation(res, user, res_notes)\n errors = res.validate\n notes = \"### Reserved on #{Time.zone.now.to_s(:long)} by \"\\\n \"#{user.md_link} for #{res.reserver.md_link}\"\n notes += \"\\n\\n#### Notes:\\n#{res_notes}\" unless res_notes.nil? ||\n res_notes.empty?\n res.status = 'reserved'\n res.notes = notes\n res.save!\n\n if AppConfig.get(:notify_admin_on_create) # send e-mail if configured to\n AdminMailer.reservation_created_admin(res).deliver_now\n end\n \"Reservation for #{res.equipment_model.md_link} created \"\\\n \"successfully#{', even though ' + errors.to_sentence[0, 1].downcase\\\n + errors.to_sentence[1..-1] unless errors.empty?}.\\n\"\n end",
"title": ""
},
{
"docid": "47f8abe9899b9fef5577870d35ef7058",
"score": "0.6032173",
"text": "def create\n\n @reservation = Reservation.new(reservation_params)\n\n @passenger = Passenger.new\n @passengers = Passenger.all\n @enterprise = Enterprise.new\n @enterprises = Enterprise.all\n @rooms = Room.all\n @groups = Group.all\n @room_types = RoomType.all\n\n respond_to do |format|\n if @reservation.guardar( new_reservation_rooms )\n format.html { redirect_to @reservation, notice: 'La reserva se ha registrado correctamente.' }\n format.json { render action: 'show', status: :created, location: @reservation }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89c26a13ebb0ba657345673fbb6148d5",
"score": "0.6030502",
"text": "def add_reservation(check_in, check_out, room_number = nil)\n # If not given a room, choose the first available room for the date range\n room_number ||= first_available_room(check_in, check_out)\n available_rooms = list_rooms_available_for_date_range(check_in, check_out)\n room = find_room(room_number)\n # Raise an error if list of available rooms does not include the given room number\n if available_rooms.include?(room) == false\n raise RoomUnavailableError, \"Room #{room_number} is not available between #{check_in} and #{check_out}\"\n end\n # If available, create the reservation and add it to the room\n # create reservation\n reservation = create_reservation(room_number, check_in, check_out)\n # find room based on room number in reservation\n room = find_room(room_number)\n # push reservation into room\n room.reservations << reservation\n end",
"title": ""
},
{
"docid": "d7529cb8d9d9e42de07e91c482312298",
"score": "0.6024518",
"text": "def create\n @event = Event.find(params[:event_id])\n @user = current_user\n\n if params[:waiting_list]\n # add user to waiting_list\n @reservation = Reservation.new(reservation_params)\n @reservation.status = \"Waiting_List\"\n @reservation.save\n flash[:notice] = \"You will be notified by email if a seat becomes available!\"\n redirect_to event_path @event\n else\n begin\n if params[\"stored_card\"]\n result = Braintree::Transaction.sale(\n amount: params[\"amount\"],\n customer_id: @user.braintree_customer_id\n )\n else\n result = Braintree::Transaction.sale(\n amount: params[\"amount\"],\n credit_card: {\n number: params[\"number\"],\n cvv: params[\"cvv\"],\n expiration_month: params[\"month\"],\n expiration_year: params[\"year\"]\n },\n options: {\n submit_for_settlement: true\n }\n )\n end\n rescue SocketError => e\n logger.info(e)\n end\n\n if result.success?\n @reservation = Reservation.new(reservation_params)\n @reservation.transaction_number = result.transaction.id\n @reservation.update_attribute(:status, \"Completed\")\n @event.update_number_of_available_seats\n @event.save\n flash[:notice] = \"Reservation was successfully created. Transaction ID: #{result.transaction.id}\"\n redirect_to event_path @event\n else\n flash[:notice] = \"Error while processing payment: #{result.message}\"\n redirect_to event_path @event\n end\n end\n end",
"title": ""
},
{
"docid": "989a4aeb2be7362b02f6a748c3d5128d",
"score": "0.6017845",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.apartment_id = @apartment.id\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to apartment_reservations_path(@apartment), notice: 'Apartamento Reservado.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a473be9e1101e09bcf41557e97f0acd",
"score": "0.60135007",
"text": "def request_reservation_within_block(id)\n block_reservation = find_reservation_by_id(id)\n\n id = block_reservation.reservations.length + 1\n room = block_reservation.rooms_available.sample\n raise ArgumentError, \"no rooms available\" if room.nil?\n\n new_reservation = Reservation.new(id, room, block_reservation.start_date,\n block_reservation.end_date, room_cost: 150)\n\n add_reservation(new_reservation,\n reservation_location: block_reservation.reservations)\n # deletes room number from available_rooms\n block_reservation.rooms_available.delete(new_reservation.room)\n\n return new_reservation\n end",
"title": ""
},
{
"docid": "deb40637489fef1fde736d09b1038e80",
"score": "0.6001717",
"text": "def reserve_room(start_date, end_date)\n requested_range = DateRange.new(start_date: start_date, end_date: end_date)\n reservable_rooms = available_rooms(requested_range)\n chosen_room = nil\n\n # pick first room in list of open rooms\n if reservable_rooms.length == 0\n raise ArgumentError.new(\"There are no open rooms available between the dates #{start_date} and #{end_date}. Please try another date range.\")\n else \n chosen_room = reservable_rooms.first \n end \n\n # create a unique id \n if @reservations.length == 0 \n new_res_id = 1\n else \n new_res_id = @reservations.last.id + 1\n end \n\n # create a new reservation \n new_reservation = Hotel::Reservation.new(id: new_res_id, room_num: chosen_room, start_date: start_date, end_date: end_date)\n\n # update @reservations \n update_reservations_list(new_reservation)\n end",
"title": ""
},
{
"docid": "6dd410eb9095ada5f1858c8bba9a88fb",
"score": "0.5999319",
"text": "def create\n create_message(params)\n end",
"title": ""
},
{
"docid": "bd4c168e76159e7d92446c7302887c30",
"score": "0.59970033",
"text": "def reserve_time_slot(id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :participant_id,\n :cancel_existing,\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 # resource path\n path = path_replace(\"/v1/calendar_events/{id}/reservations\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n response\n \n end",
"title": ""
},
{
"docid": "c9f7a8d58fe53dbb5b3e24c29b7e691d",
"score": "0.5988478",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n # fix for production\n if Rails.env == 'production'\n @reservation.date = Date.strptime(params[:reservation][:date], '%m-%d-%Y') \n end\n\n if user_signed_in?\n @reservation.user_id = current_user.id\n @reservation.channel = 1\n elsif owner_signed_in?\n @reservation.owner_id = current_owner.id\n @reservation.restaurant = current_owner.restaurant\n @reservation.channel = 6\n end\n\n respond_to do |format|\n if @reservation.save\n path = current_owner.present? ? reservations_owner_dashboards_path : reservations_user_dashboards_path\n format.html { redirect_to path,\n notice: 'Reservation was successfully created.' }\n else\n format.html { render action: \"new\" }\n # format.html { redirect_to new_reservation_path(reservation: params[:reservation]) }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
},
{
"docid": "aa3e4d039a523dd8cf8621e0fbfb01c4",
"score": "0.5976023",
"text": "def create\n from_time = Time.find_zone(Time.zone).local(reservation_params[:from][:year], reservation_params[:from][:month], reservation_params[:from][:day], \n reservation_params[:from][:hour], reservation_params[:from][:minute], reservation_params[:from][:second])\n \n to_time = Time.find_zone(Time.zone).local(reservation_params[:to][:year], reservation_params[:to][:month], reservation_params[:to][:day], \n reservation_params[:to][:hour], reservation_params[:to][:minute], reservation_params[:to][:second])\n \n \n raise \"ERROR: cannot book past current time\" if Time.zone.now > from_time\n raise \"ERROR: to time earlier that from time\" if from_time > to_time \n \n @reservation = Reservation.new(user_id: reservation_params[:user_id],\n parking_spot_id: reservation_params[:parking_spot_id],\n from: from_time,\n to: to_time)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf2f2ec050ba4a180d9c4ee2085cadeb",
"score": "0.595461",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.status = \"Pending\"\n @reservation.user = current_user\n\n place = Place.find_by_id(params[:reservation][:place_id])\n\n @reservation.object_resources << place.object_resources if place\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "163e77e7d678eb9cc457fa0d00b2c376",
"score": "0.594847",
"text": "def create\n _params = message_params\n if params.has_key? :key and !_params.has_key? :guestbook_id\n key = AccessKey.where(key: params[:key]).first\n if key != nil\n _params[:guestbook_id] = key.guestbook != nil ? key.guestbook.id : Guestbook.get_default.id\n end\n end\n\n # Insurance\n if _params[:guestbook_id] == nil\n _params[:guestbook_id] = Guestbook.get_default.id\n end\n guestbook = Guestbook.find(_params[:guestbook_id])\n\n # Auto approve, if passes filter\n _params[:approved] = guestbook.auto_approve\n if guestbook.filter_profanity && Obscenity.profane?(_params[:content])\n _params[:approved] = false\n end\n\n @message = Message.new(_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_back(fallback_location: '/admin/signatures') }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { redirect_to(:back, error: @message.errors.full_messages.first) }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3a615577be5ff45806e41103b3d7cd1",
"score": "0.59413254",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render :show, status: :created, location: @reservation\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c4d42e822fe1aa89377e662ead51ad6c",
"score": "0.5921232",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.requester = current_user\n if params[:reservation][:nook_id]\n @nook = Nook.find(params[:reservation][:nook_id])\n @reservation.nook = @nook\n end\n\n respond_to do |format|\n if @reservation.save\n format.html {\n flash[:notice] = t('reservations.submitted')\n if request.xhr?\n render text: nooks_url\n else\n redirect_to nooks_path\n end\n }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e11e0e6284d40463c258f2b2a9182a4",
"score": "0.591878",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n #@reservation = current_user.reservations.build(eatery_params)\n\n #debugger\n @reservation.user_id = current_user.id\n\n\n if @reservation.save\n #debugger\n redirect_to @reservation, notice: 'Reservation was successfully created.'\n else\n #debugger\n render :new\n end\n\n end",
"title": ""
},
{
"docid": "82f64a816ee501908f1815cd260a98da",
"score": "0.58869696",
"text": "def create\n # Stripe customer creation\n customer = Stripe::Customer.create(\n source: params[:stripeToken],\n email: params[:stripeEmail]\n )\n # Stripe payment\n charge = Stripe::Charge.create(\n customer: customer.id, # You should store this customer id and re-use it.\n amount: @reservation.amount_cents,\n description: \"Paiement pour le pack #{@reservation.pack_sku} de la réservation #{@reservation.id}\",\n currency: @reservation.amount.currency\n )\n # Update the reservation statuses after payment is confirmed\n @reservation.update(payment: charge.to_json, payment_status: 'paid', tracking_status: 'paid')\n @reservation.save\n\n # Save paid amount in user profile (in case of pack modification, it will give ability to calculate amount to be paid)\n update_paid_amount(@reservation)\n\n # Redirect to user's dashboard\n redirect_to tracking_path\n\n # Send receipt E-mail\n send_receipt_mail\n\n # Redirect to payment page in case of error\n rescue Stripe::CardError => e\n flash[:alert] = e.message\n redirect_to new_reservation_payment_path(@reservation)\n end",
"title": ""
},
{
"docid": "ba5c816a11815af8ca7152ff197dc60c",
"score": "0.58735",
"text": "def reservation_params\n params.require(:reservation).permit(:room_id, :user_id, :slot_id, :reservation_date)\n end",
"title": ""
},
{
"docid": "1cd4cad8a6b0bfaa00e14d64ad5b1efc",
"score": "0.5864443",
"text": "def create\n @reserve = Reserve.new(params[:reserve])\n @reserve.set_user\n\n if current_user.has_role?('Librarian')\n unless @reserve.user\n @reserve.user = @user\n end\n else\n if @reserve.user != current_user\n if @user != current_user\n access_denied; return\n end\n end\n end\n\n respond_to do |format|\n if @reserve.save\n @reserve.sm_request!\n\n format.html { redirect_to @reserve, :notice => t('controller.successfully_created', :model => t('activerecord.models.reserve')) }\n format.json { render :json => @reserve, :status => :created, :location => reserve_url(@reserve) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @reserve.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcd27a04bc424de889c60983c1ffbf83",
"score": "0.58636314",
"text": "def new\n render locals: {\n reservation: current_resident.reservations.new(\n room_id: @room.id,\n starts_at: datetime_from_param(params)\n )\n }\n end",
"title": ""
},
{
"docid": "a9e9c94e1fda8e0e002e941fad76aa0a",
"score": "0.58633655",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.user_id = current_user.id\n if date_checker(@reservation.start_date, @reservation.end_date)\n if @reservation.save\n ReservationMailer.booking_email(current_user,@reservation.listing.user,@reservation.id).deliver_now\n redirect_to @reservation , :flash => {:error => 'Reservation was successfully created.'}\n else\n @listing = Listing.find(@reservation.listing_id)\n render :new\n end\n end\n \n end",
"title": ""
},
{
"docid": "91a26dacd5e0dba61f7476d0868f2398",
"score": "0.5851065",
"text": "def create\n @employee_reservation = Employee::Reservation.new(employee_reservation_params)\n\n respond_to do |format|\n if @employee_reservation.save\n format.html { redirect_to @employee_reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @employee_reservation }\n else\n format.html { render :new }\n format.json { render json: @employee_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1e5d04d825960026c501f3d04b37a02",
"score": "0.5849144",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_back_or_default home_url }\n #format.html { redirect_to(@reservation, :notice => 'Reservation was successfully created.') }\n format.xml { render :xml => @reservation, :status => :created, :location => @reservation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reservation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7f0dc0fdb80d12d30869a34543a2028",
"score": "0.58476114",
"text": "def create\n @bg = Bg.first\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n #flash[:notice] = 'Réservation valide.'\n format.html { redirect_to(@reservation) }\n format.xml { render :xml => @reservation, :status => :created, :location => @reservation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reservation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fe376ac29df246ebd84475e12ff3d38",
"score": "0.58444464",
"text": "def reservation_params\n params.require(:reservation).permit(:room_id, :representative, :purpose, :num_participants, :start_at, :end_at, :repeating_mode, :lock_version,:note)\n end",
"title": ""
},
{
"docid": "871be400fa8c663894db82888beaf02e",
"score": "0.5839342",
"text": "def create\n res = Reservation.create(\n row: params[:row],\n col: params[:col],\n user_id: params[:user_id], # DON'T DO THIS! Use current_user\n flight_id: params[:flight_id]\n )\n\n if res.persisted?\n # Send back the reservation object that was successfully created\n render json: res\n else\n # Send back an error hash, including the ActiveRecord validation error messages\n render json: { error: true, messages: res.errors.full_messages }\n end\n end",
"title": ""
},
{
"docid": "8d39207ef64b8461a628a1b7711cb019",
"score": "0.5837724",
"text": "def create\n @message = @ride_request.messages.new(message_params)\n @message.user = current_user\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to :back, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :back }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bce1a934a723111d898b91f147ad11dc",
"score": "0.58155614",
"text": "def new\n @pack = @reservation.pack\n end",
"title": ""
},
{
"docid": "222961f1ff858c6e1e7fa3bbb8f45e12",
"score": "0.58118933",
"text": "def create\n @message = RoomMessage.create(message: params[:room_message][:message],\n user_id: current_user.id,\n room_id: params[:room_id])\n redirect_to :browse\n end",
"title": ""
},
{
"docid": "2b8d99efabc7e8603556ebd9bf4e3aa5",
"score": "0.5808313",
"text": "def create_reservation_within_block(start_date, end_date, block_id)\n rooms_available = check_availability_within_block(start_date, end_date, block_id)\n room_instances_for_reservation = rooms_available.map {|id| @blocks.find }\n\n\n new_block_reservation = create_reservation_basic(start_date, end_date, rooms_available)\n return new_block_reservation\n end",
"title": ""
},
{
"docid": "1c4db8629da87a7e76b1742dfdc9bfd2",
"score": "0.5806252",
"text": "def create\n @message = Message.new(message_params)\n @message.room = Room.find(params[:room_id])\n @message.user = @current_user\n respond_to do |format|\n if @message.save\n format.html { redirect_to room_message_path(@message.room, @message), notice: 'Message was successfully created.' }\n format.json { render :show, status: :created }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30733ed87b8953fbaf45d0812777c4b9",
"score": "0.58027524",
"text": "def create\n @reserve.save!\n\n send_course_reserve_request(@reserve) if params.key?(:send_request)\n redirect_to edit_reserve_path(@reserve[:id])\n end",
"title": ""
},
{
"docid": "527f55ec859b5ad0c512544de3a77b35",
"score": "0.57999504",
"text": "def crear_reserva\n if (horainicio - Time.now) < 14_400\n ReservationsJob.set(wait: (self.horainicio - Time.now).seconds).perform_later(self.space_id)\n asignar_espacio\n end\n end",
"title": ""
},
{
"docid": "0089072d14de0405afe45c8f52b91406",
"score": "0.5795225",
"text": "def create\n @reservation_owner = ReservationOwner.new(reservation_owner_params)\n\n respond_to do |format|\n if @reservation_owner.save\n format.html { redirect_to @reservation_owner, notice: 'Reservation owner was successfully created.' }\n format.json { render :show, status: :created, location: @reservation_owner }\n else\n format.html { render :new }\n format.json { render json: @reservation_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b802692d498d333d4695b3509a6fe48c",
"score": "0.5794246",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n # to help with creation errors:\n @reservation.customer = current_customer \n @reservation.restaurant = @restaurant \n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa426751469b2d0b436db502cd118d90",
"score": "0.577434",
"text": "def create \n p_name = params[:reservation][:name]\n p_amount_people = params[:reservation][:amount_people]\n p_year1 = params[:reservation][\"arrive_date(1i)\"].to_i\n p_month1 = params[:reservation][\"arrive_date(2i)\"].to_i\n p_day1 = params[:reservation][\"arrive_date(3i)\"].to_i\n p_year2 = params[:reservation][\"departure_date(1i)\"].to_i\n p_month2 = params[:reservation][\"departure_date(2i)\"].to_i\n p_day2 = params[:reservation][\"departure_date(3i)\"].to_i\n p_needs = params[:reservation][:needs].split(' ')\n p_activities = params[:reservation][:activities].split(' ')\n\n @reservation = Reservation.new(\n username: @username_actual,\n name: p_name,\n amount_people: p_amount_people,\n arrive_date: Date.new(\n p_year1,\n p_month1,\n p_day1\n ),\n departure_date: Date.new(\n p_year2,\n p_month2,\n p_day2\n ),\n needs: p_needs,\n activities: p_activities\n )\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae102fa1d7070f49281aa88d111614f3",
"score": "0.57700926",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to request.referer, notice: 'Reservation was successfully created.' }\n format.json { render 'show', status: :created, location: @reservation }\n else\n format.html { redirect_to request.referer, alert: @reservation.errors.messages[:user].try(:first) }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9953541e818110b46d7df718b7094032",
"score": "0.5770015",
"text": "def create_booking(day)\n new_booking = Booking.create(host_id: self.id,day: day)\n puts \"A new booking has been created for #{self.name} on #{day}.\"\n new_booking.assign_waiter\n puts \"#{new_booking.waiter.name} has been assigned to #{self.name}'s booking'.\"\n end",
"title": ""
},
{
"docid": "f737665572d39c101b4c132d7a981cd8",
"score": "0.5766408",
"text": "def reserve_messages(project_id, queue_name, opts = {})\n \n # verify the required parameter 'project_id' is set\n raise \"Missing the required parameter 'project_id' when calling reserve_messages\" if project_id.nil?\n \n # verify the required parameter 'queue_name' is set\n raise \"Missing the required parameter 'queue_name' when calling reserve_messages\" if queue_name.nil?\n \n\n # resource path\n path = \"/{project_id}/queues/{queue_name}/reservations\".sub('{format}','json').sub('{' + 'project_id' + '}', project_id.to_s).sub('{' + 'queue_name' + '}', queue_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = Swagger::Request.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'] = Swagger::Request.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = Swagger::Request.object_to_http_body(opts)\n \n auth_names = ['oauth_token']\n response = Swagger::Request.new(:POST, path, @host, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :token => token}).make.body\n obj = ReservationResponse.new() and obj.build_from_hash(response)\n end",
"title": ""
},
{
"docid": "10d5ed1311ca3d5318d4a5db980e56fb",
"score": "0.57653546",
"text": "def create\n session = Session.find( params[ :session_id ] )\n admin_is_enrolling_someone_else = params[ :user_login ] && session && authorized?(session)\n login = admin_is_enrolling_someone_else ? params[ :user_login ] : current_user\n user = User.find_or_lookup_by_login( login ) rescue nil\n if user.nil?\n flash[:alert] = \"Could not find user with Login ID #{params[ :user_login ]}\" if admin_is_enrolling_someone_else\n redirect_to request.referrer || root_url\n return\n end\n\n @reservation = Reservation.find_by_user_id_and_session_id(user.id, params[ :session_id ])\n unless @reservation\n @reservation = Reservation.new(reservation_params)\n @reservation.session = session\n @reservation.user = user\n end\n\n if admin_is_enrolling_someone_else\n if @reservation.user.nil?\n flash[:alert] = \"Could not find user with Login ID #{params[ :user_login ]}\"\n redirect_to sessions_reservations_path(@reservation.session)\n return\n end\n elsif [email protected]_registration_period?\n flash[:alert] = \"Registration is closed for this session.\"\n redirect_to @reservation.session \n return\n end\n \n success = if @reservation.cancelled? && [email protected]_record?\n @reservation.uncancel! \n else\n @reservation.save\n end\n \n @reservation.reload\n if success && @reservation.confirmed?\n ReservationMailer.confirm( @reservation ).deliver_later\n \n if @reservation.session.next_time.today?\n @reservation.session.instructors.each do |instructor|\n ReservationMailer.confirm_instructor( @reservation, instructor ).deliver_later\n end\n end\n end\n\n if admin_is_enrolling_someone_else\n if success\n if @reservation.confirmed?\n flash[ :notice ] = \"The reservation for #{@reservation.user.name} has been confirmed.\"\n else\n flash[ :notice ] = \"#{@reservation.user.name} has been added to the waiting list.\"\n end\n else\n errors = @reservation.errors.full_messages.join(\" \")\n flash[:alert] = \"Unable to make reservation for \" + params[ :user_login ] + \". \" + errors\n end\n redirect_to sessions_reservations_path(@reservation.session) \n else\n if success\n if @reservation.confirmed?\n flash[ :notice ] = \"Your reservation has been confirmed.\"\n else\n flash[ :notice ] = \"You have been added to the waiting list.\"\n end\n else\n errors = @reservation.errors.full_messages.join(\" \")\n flash[:alert] = \"Unable to make reservation. \" + errors\n end\n redirect_to @reservation.session \n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "b781c6cdefb9a25b80e3ea1b9ca8b10f",
"score": "0.0",
"text": "def training_params\r\n params.require(:training).permit(:id, :mistake_id, :question, :explanation, :answer)\r\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"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.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"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.62978333",
"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.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"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.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"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.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"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.61714715",
"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.6161512",
"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.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"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.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"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.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"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.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"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.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\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": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"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.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"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.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"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.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"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.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"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.59292704",
"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.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"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.59088355",
"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": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"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": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"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.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"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.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"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.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"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": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"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.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"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.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
912c0e0cf8816366872f1b29941d2de1
|
DELETE /events/1 DELETE /events/1.json
|
[
{
"docid": "db4eac2f67ac44c0a3a805d4a0c9447d",
"score": "0.0",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "ca8002b7f734bce1f1a27f7ec6e59e9d",
"score": "0.8086048",
"text": "def destroy # DELETE /api/events/:id\n @event.destroy\n render :json => \"Event deleted\", :status => 201\n end",
"title": ""
},
{
"docid": "3281a9c9361cdbd7e683034a763917de",
"score": "0.78338593",
"text": "def destroy\n event = Event.find(params[:id])\n event.delete()\n render json: event, status: :ok \n end",
"title": ""
},
{
"docid": "682ebf05ea48e3c6daef33b7e72ed927",
"score": "0.77703065",
"text": "def destroy #delete event\n @event = Event.find(params[:id])\n @event.destroy\n render json: {message:\"Event Deleted\"}\n end",
"title": ""
},
{
"docid": "6204a8c1f8e50b6699839df3c6c11eef",
"score": "0.7746705",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e95245d1547d93a78bd446bc852204bd",
"score": "0.77208817",
"text": "def destroy\n @event = Event.find(params[:event_id])\n @event.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76879793",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76879793",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76879793",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9c1af9a6ff95d188e4257049d9701e9",
"score": "0.76158965",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9ffcafad0b4770fd671b684f59145267",
"score": "0.7588982",
"text": "def destroy\n @event.deleted = 1\n @event.save();\n respond_to do |format|\n format.html { redirect_to events_url, notice: t('events.deleted') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ea23f6219db74b8dbc9badd6108bcac",
"score": "0.75778997",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html {}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "309f1f684910f66d9323c10ea163648e",
"score": "0.75758",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a6951001ecc40347e8b5b76385307394",
"score": "0.7573987",
"text": "def destroy\n # Using 'id' instead of 'objectId' here since Rails sets objectId passed in params to 'id'\n @event = Event.destroy(params[:id])\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d85d177988e1df2a6f2ae1ea5b575d29",
"score": "0.75698155",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b40949c5895ca8de7d9dbafd59ee3b7",
"score": "0.7556041",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b40949c5895ca8de7d9dbafd59ee3b7",
"score": "0.7556041",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fc4413d317fd197676c347f45930d103",
"score": "0.7549893",
"text": "def destroy\n @simple_event = SimpleEvent.find(params[:id])\n @simple_event.destroy\n\n respond_to do |format|\n format.html { redirect_to simple_events_dashboard_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.75409174",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0665e36444d30d64123c1ed7c6e812f1",
"score": "0.7532738",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to @event }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a718088b9c5ce3ef078c0345717912fe",
"score": "0.75271666",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a718088b9c5ce3ef078c0345717912fe",
"score": "0.75271666",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a718088b9c5ce3ef078c0345717912fe",
"score": "0.75271666",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a47d3f7fc52a88b540d7f1f323f13bc",
"score": "0.75258386",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n resp = {\"resp\" => \"ok\"}\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.xml { head :ok }\n format.json { render :json=>resp}\n end\n end",
"title": ""
},
{
"docid": "35284107e55b8ccdf97a06a5144c009e",
"score": "0.7522961",
"text": "def delete_event\n event_id = params[:event_id]\n\n delete_status = GroupEvent.event_delete(event_id)\n render json: delete_status \n\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.75199366",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75151116",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.75149995",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
ef91e7660efdd196d0b556b60207219c
|
DELETE /comments/1 DELETE /comments/1.xml
|
[
{
"docid": "b4b1aac33f366cca92b51959bf93a339",
"score": "0.6871911",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_path }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "b44ce28afcd584c4b9966829c6ff230b",
"score": "0.7070504",
"text": "def delete_comments\n end",
"title": ""
},
{
"docid": "34124a60af3035f72f2c565669a4e3a4",
"score": "0.7065291",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n \n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok } \n end\n end",
"title": ""
},
{
"docid": "e9f69d76cdfe8367b56ee03b7d9aa9f5",
"score": "0.6984638",
"text": "def delete_comment(id)\n record \"/msg/delete_comment/#{id}\"\n end",
"title": ""
},
{
"docid": "5e01851c0de2958aef3486b438962374",
"score": "0.69349045",
"text": "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b7f1aa27b7c85a8ca5905c0cca08a30e",
"score": "0.6934235",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { head :ok }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "351967afe9c5aec1c186e6a8894a9d8a",
"score": "0.6914351",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "10dd86a5190d4ccc5fed0e9f6eb85671",
"score": "0.6881538",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "909f4b2893c9ed7b5f458465fd6ca38e",
"score": "0.6874837",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comment_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c1644208b4f0edcd3af3ff6525e3290f",
"score": "0.68601197",
"text": "def test_delete_comment\n\n comments = Comment.getAll()\n\n for comment in comments\n\n result = Comment.deleteComment(comment.commentId)\n\n assert_equal true, result\n \n end\n\n end",
"title": ""
},
{
"docid": "a077c6c3a081ec60f21380420ea70681",
"score": "0.6843512",
"text": "def destroy\n @comment.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "a077c6c3a081ec60f21380420ea70681",
"score": "0.6843512",
"text": "def destroy\n @comment.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "6e6194bd3795ec644c2ea00787106c38",
"score": "0.6831995",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3399906252c4a5bce0cb536054f53bf4",
"score": "0.67980295",
"text": "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to_commentable(@comment, false) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "29ddd808a4d00c3a741351a9987f5488",
"score": "0.6784006",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(backdrafts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8ab046fe6743ad5032dfdf7671050a92",
"score": "0.67764324",
"text": "def destroy\n @comment.destroy\n\n respond_to do |wants|\n wants.html { redirect_to(comments_url) }\n wants.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "34a4d5e466a3c1cd094effe32b9e2a31",
"score": "0.677577",
"text": "def destroy\n @comment.destroy!\n head :no_content\n end",
"title": ""
},
{
"docid": "4fe7bf44d9924c94134d3b6c7290a4cb",
"score": "0.67702204",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac13134bc07ae4e389449157afff58cc",
"score": "0.6713474",
"text": "def destroy\n @comment = @network.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n flash[:notice] = 'Comment destroyed.'\n format.html { redirect_to([:admin, @network,:comments]) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4470ad19bbe1749b793a9349351d3469",
"score": "0.66869247",
"text": "def destroy\n puts \">>>> Destroying a comment <<<<\"\n @comment = Comment.find(params[:id])\n puts \"found comment>>> #{@comment}\"\n @article = @comment.article\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(article_path(@article)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5cb914b674e71211c4efdb503e924d65",
"score": "0.6592834",
"text": "def destroy\n @comment1 = Comment1.find(params[:id])\n @comment1.destroy\n\n respond_to do |format|\n format.html { redirect_to comment1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f96ff1bd14d06ad6ad98644e2dd89513",
"score": "0.65883166",
"text": "def destroy\n @article_comment = ArticleComment.find(params[:id])\n @article_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(article_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "36c3a1bec81703939f7e11d8b4f93650",
"score": "0.6584718",
"text": "def destroy\n @subcomment = Subcomment.find(params[:id])\n @subcomment.destroy\n\n respond_to do |format|\n format.html { redirect_to(subcomments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "41149e37c3eda8cc58fbc0912fdb91fd",
"score": "0.65795654",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n flash[:notice] = \"Comment destroyed\"\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d5598be657a9ca0f2c4e319243ec15f",
"score": "0.6577475",
"text": "def destroy\n @comment = Comment.find(params[:id])\n\t\tpost = @comment.post\n @comment.destroy\n\n respond_to do |wants|\n wants.html { redirect_to pretty_post_url(post) + '#comments' }\n wants.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b1dcd490d79b47ab0d4f5eddbb736c56",
"score": "0.6558414",
"text": "def destroy\n @comment = Comment.destroy(params[:id])\n end",
"title": ""
},
{
"docid": "b1dcd490d79b47ab0d4f5eddbb736c56",
"score": "0.6558414",
"text": "def destroy\n @comment = Comment.destroy(params[:id])\n end",
"title": ""
},
{
"docid": "e4c7188f3e5d9facece14365bc0d265f",
"score": "0.655761",
"text": "def destroy_comment\n @comment = Comment.find(params[:id])\n @comment.destroy\n \n respond_to do |format|\n flash[:notice] = 'Comment was successfully deleted.'\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "744d5525b4858116b05c8facff537753",
"score": "0.65319014",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n end",
"title": ""
},
{
"docid": "684a5aa02bdc3aed5e4d2920efef786b",
"score": "0.65243345",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_blog_post_comments_url(@comment.post.blog, @comment.post)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1e48dbd8c22331185a951583957e8f34",
"score": "0.65238166",
"text": "def destroy\n @comment = @task.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(sprint_task_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3f2fa333833c695baba7f698866d0500",
"score": "0.6521424",
"text": "def delete_comment1\n params[:comment].each { |key, value|\n comment=Comment.find(key)\n if !comment.nil?\n k comment.destroy\n end\n }\n redirect_to requirements_path\n end",
"title": ""
},
{
"docid": "3f47e087a1208b381cb2082bf931f2be",
"score": "0.6518442",
"text": "def delete_comment\n @comment=Comment.find(params[:comment_id])\n @comment.destroy\n end",
"title": ""
},
{
"docid": "61add452a34638dfcdab8c70a07ee3d5",
"score": "0.65129274",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => \"posts\", :action => \"show\", :id => @comment.post_id, :notice => 'Comment deleted.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fe5073213c5c383c975ad94aad4c861e",
"score": "0.6497139",
"text": "def destroy\n @my_group_comment = My::GroupComment.find(params[:id])\n @my_group_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(my_group_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e1d6f603cb5ea1e475ea71422432aeae",
"score": "0.64823425",
"text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"title": ""
},
{
"docid": "6546ab88ba95633fb243d7bd3eb71d4b",
"score": "0.6480077",
"text": "def destroy\n @comment2 = Comment2.find(params[:id])\n @comment2.destroy\n\n respond_to do |format|\n format.html { redirect_to(comment2s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f20fc42c3c8acfbb4342d7827b794d5a",
"score": "0.6471514",
"text": "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(post_url(@post), :notice => \"Comment was removed\") }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "76122a2be400201c0fb682d5e286605e",
"score": "0.6467244",
"text": "def destroy\n if super_user?\n @comment = Comment.find(params[:id])\n @comment.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d0439b718f31fbe9e9618c61e7fba13",
"score": "0.6460719",
"text": "def destroy\n @comment_node = CommentNode.find(params[:id])\n @comment_node.destroy\n\n respond_to do |format|\n format.html { redirect_to comment_nodes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b43ca31530d90471e1c6c08e1403309",
"score": "0.6452892",
"text": "def destroy\n @comment = Comment.find(params[:id])\n blog = @comment.blog\n @comment.destroy\n flash[:notice] = \"Comment was successfully deleted.\"\n\n respond_to do |format|\n format.html { redirect_to(blog, :method => :get) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8b2fbf67cfa4daf2d43b15ed9038234b",
"score": "0.6448603",
"text": "def destroy\n @system_comment = SystemComment.find(params[:id])\n @system_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(system_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c3662dbb7377845a3d898bc18d954780",
"score": "0.6448505",
"text": "def destroy\r\n @comment = Comment.find(params[:id])\r\n @comment.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(@comment.wall) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "fd26e74a216ac7cd7036bd9bbe8437e9",
"score": "0.644723",
"text": "def destroy\n @comment.destroy\n end",
"title": ""
},
{
"docid": "c403781dc5c96f74860ed2aee09902d1",
"score": "0.6445524",
"text": "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_comments_path(@comment.site_id)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4817b05dc3418bb6db5b837db4b9ffce",
"score": "0.64314425",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n redirect_to request_path(@comment.request)\n end",
"title": ""
},
{
"docid": "6b9ee7b4f4359596eaf3038eb3222190",
"score": "0.64298356",
"text": "def destroy\n @comment = Comment.find(params[:id])\n \n \n if @comment.has_children?\n @comment.children.each do |child|\n child.destroy\n end\n end\n @comment.destroy\n\n respond_with do |format|\n flash.now[:notice] = 'Comment was successfully deleted.'\n end\n end",
"title": ""
},
{
"docid": "6913fde3c6115fdd366ee264083d2b10",
"score": "0.6425065",
"text": "def destroy\n\n @comment = @post.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html {redirect_to comments_and_forum_path }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.63980645",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "69b205c158f7212cc750ed38fc878f1c",
"score": "0.63966167",
"text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"title": ""
},
{
"docid": "752ed216e7d9e361230d41d00e4c06d8",
"score": "0.6387286",
"text": "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "01e5c24116cf23a3896a30600cdc88bf",
"score": "0.6382165",
"text": "def destroy\n @report_comment = ReportComment.find(params[:id])\n @report_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(report_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "83bcf404b76cbc9a0c2c8d950108b502",
"score": "0.6356512",
"text": "def deleteComments(delete_ids, cookies)\n delete_ids.each do |delete_id|\n hmac = getHMACFromDeleteConfirmationPage(delete_id, cookies)\n payloadString = \"id=\" + delete_id + \"&hmac=\" + hmac + \"&d=Yes&goto=\"\n response = RestClient::Request.new({\n method: :post,\n url: 'https://news.ycombinator.com/xdelete',\n cookies: cookies,\n payload: payloadString,\n }).execute do |response, request, result|\n case response.code\n when 401..500\n raise \"UNABLE TO DELETE COMMENTS\"\n else\n puts \"Deleting comment: \" + delete_id\n end\n end\n end\nend",
"title": ""
},
{
"docid": "0504c180e76eccd194d1baf0b7dd812d",
"score": "0.63564545",
"text": "def bulk_delete_comments\n comment_ids_string = params[:ids]\n comment_ids = eval(comment_ids_string)\n\n comment_ids.each do |id|\n comment = Comment.find(id.to_i)\n if !comment.nil?\n comment.destroy\n\n end\n\n end\n\n head :no_content\n\n end",
"title": ""
},
{
"docid": "3d40345218a4fc17a81502f965d31611",
"score": "0.63550776",
"text": "def destroy\n @topic_comment = TopicComment.find(params[:id])\n @topic_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(topic_comments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c1592c9a7c989d01a99d8c2f4e789eab",
"score": "0.6349932",
"text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"title": ""
},
{
"docid": "bcdc27b28a66e0d79d3bc4a34b4768ce",
"score": "0.6346166",
"text": "def delete_comment\n comment = Comment.find_by_id(params[:id])\n if !comment.nil?\n comment.destroy\n end\n end",
"title": ""
},
{
"docid": "952e1aab849d6ddc6982cec383d9a05d",
"score": "0.63418984",
"text": "def destroy\n @comment1.destroy\n respond_to do |format|\n format.html { redirect_to comment1s_url, notice: 'Comment1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb3e14995faf2086fd7aec232f171872",
"score": "0.63370985",
"text": "def destroy\n @comment = @commentable.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48b251f6feb27299ea5545f707b052e7",
"score": "0.63316655",
"text": "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(post_path(@post)) }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "05008db4e2d3831d83430c8c7d033560",
"score": "0.63203335",
"text": "def destroy\n @visit_comment.destroy\n respond_to do |format|\n format.html { redirect_to visit_comments_url, notice: 'Comentario eliminado con exito' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc67d69ba846ddf9f0f521ba08a68fe1",
"score": "0.63179535",
"text": "def destroy\n @comment = Comment.find(params[:id])\n bid = @comment.blog_id\n\n @comment.deleted_parent = true\n @comment.save\n @comment = Comment.find(params[:id])\n @comment.content = '<-deleted->'\n @comment.save\n c1 = @comment\n while !c1.nil? and c1.leaf? do\n cp = c1.parent if !c1.parent.nil?\n cp = cp.nil? ? nil : cp.deleted_parent ? cp : nil\n c1.destroy\n c1 = (cp.nil?)? nil : Comment.find_by_id(cp.id)\n end\n #end while @com_par.deleted_parent == false and @com_par.leaf?\n\n respond_to do |format|\n format.html { redirect_to(Blog.find_by_id(bid)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "155156e1bf1a9729ed62d4e75813d45b",
"score": "0.6306133",
"text": "def destroy\n Comment.transaction do\n post = @object.post\n id = @object.id\n @object.destroy\n create_change_log_entry(id)\n respond_to do |format|\n format.html { redirect_to post }\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "f26ca4b8f19e49090c0ff3badcbe70d6",
"score": "0.6305009",
"text": "def destroy\n @fbcomment.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "2d8764b1f2f25110816a17f73f497f0e",
"score": "0.62944627",
"text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"title": ""
},
{
"docid": "ab290a6ec9f8f7409ae56eb993a4e598",
"score": "0.6292106",
"text": "def destroy\n @catalogs_comment_type = Catalogs::CommentType.find(params[:id])\n @catalogs_comment_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(catalogs_comment_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ddbcc9c34f784cbaf6807c56697c78eb",
"score": "0.6275965",
"text": "def delete(comment)\n comment.gsub!(\"\\n\", \" \")\n self.div(:text=>comment).parent.button(:text=>\"Delete\").click\n wait_for_ajax(2) #wait_until { self.button(:text=>\"Undelete\").present? }\n end",
"title": ""
},
{
"docid": "95922eb6f157b84d325ce7161da8ea85",
"score": "0.62738067",
"text": "def destroy\n return false unless authorize(permissions = [\"delete_comment\"])\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_comments_path(:patient_id => params[:patient_id]) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e65aa0514bb0646e34826c790d140223",
"score": "0.62534034",
"text": "def comment_delete(ids=[], options={})\n post(\"wrike.comment.delete\", options.merge(:ids => ids.join(',')))\n end",
"title": ""
},
{
"docid": "bf09bcfc628d77e0be8a7338ea574f07",
"score": "0.6253165",
"text": "def delete_comment\n Jhead.call(\"-dc\", @match, @pattern)\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.62515193",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "f1b603295c9bc1bf1fc133102d96a63d",
"score": "0.624906",
"text": "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b2f7c1cd1ed0cc966a3377de474ff1b2",
"score": "0.62461495",
"text": "def destroy\n @comment = Comment.find(params[:comment_id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "abe7712e07d2ab4a42d6ff1d66bf5880",
"score": "0.62406933",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "abe7712e07d2ab4a42d6ff1d66bf5880",
"score": "0.62406933",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "abe7712e07d2ab4a42d6ff1d66bf5880",
"score": "0.62406933",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "77a5ac633411c20c7e94752966bc9f58",
"score": "0.623483",
"text": "def destroy\n @comment = @article.comments.find(params[:id])\n @comment.destroy\n redirect_to article_path @article\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.6232703",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8612bc283fd7abc97ef82b622758ae6",
"score": "0.623186",
"text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
6f21d4760a39b3491c4c842b573d0387
|
I don't need to include options, right? I want to save it here, but the array is an array of instances so I dont want to push this in as a string. an array of elements, of the instances of the class Recipe
|
[
{
"docid": "0e2481b7531b15f3b99c43a9f906a495",
"score": "0.0",
"text": "def add_recipe(recipe)\n # which adds a new recipe to the cookbook\n @recipes << recipe\n save_recipes_to_csv\n end",
"title": ""
}
] |
[
{
"docid": "90276f1e4deb4f1f7f57ec97a2bf074a",
"score": "0.6981449",
"text": "def prepare_recipes\n self.options[:recipes].map!(&:to_hash)\n end",
"title": ""
},
{
"docid": "14d43985d5a5070d3f827e2ee49fa282",
"score": "0.6943144",
"text": "def add_ingredients(array)\n array.map do |item| \n RecipeIngredient.new(self,item) \n end\n end",
"title": ""
},
{
"docid": "a5f901ddd217ee2df898e5849dad6ebf",
"score": "0.65868247",
"text": "def add_ingredients(arr_of_ingr) # create new RecipeIngredients\n arr_of_ingr.each do |ing|\n # recipe, ingredient\n RecipeIngredient.new(self, ing)\n end\n end",
"title": ""
},
{
"docid": "230db96adcaebe1d988731d79b30d334",
"score": "0.65759665",
"text": "def add_ingredients(ingredients_array)\n ingredients_array.each do |ingredient|\n RecipeIngredient.new(self, ingredient)\n end\n end",
"title": ""
},
{
"docid": "782bf538026d08f6826093f83cc56738",
"score": "0.6520594",
"text": "def recipes\n recipe_ingredients.map { |recipe_ingredient| recipe_ingredient.recipe}\n end",
"title": ""
},
{
"docid": "e635f430a31e2291c0c9a5fdf5e8fa89",
"score": "0.6518265",
"text": "def add_ingredients(ingredients_array)\n ingredients_array.each{|ingredient|\n RecipeIngredient.new(self, ingredient)}\n end",
"title": ""
},
{
"docid": "64141166be37000fba0d754a2352031e",
"score": "0.65157807",
"text": "def add_recipe(original, name, intro, ingr_array, prepsteps, cooksteps, servings, preptime, cooktime, source, tags, skills, picture, approved)\n @r = Recipe.new \n @r.original = original\n @r.name = name\n @r.intro = intro\n @r.prepsteps = prepsteps\n @r.cooksteps = cooksteps\n @r.servings = servings\n @r.preptime = preptime \n @r.cooktime = cooktime\n @r.source = source\n @r.tags = tags\n @r.skills = skills\n @r.approved = approved\n @r.picture_file_name = picture\n \n (0..ingr_array.length-1).each do |cnt|\n \n ## import ingr id: ingr_array[cnt][1] \n @i_id = ingr_array[cnt][1]\n @ir = IngredientsRecipe.new \n \n ## link ingredient_id and recipe_id together\n if !@i_id.nil?\n @ir.ingredient_id = @i_id\n end\n @ir.recipe_id = @r.id\n if !ingr_array[cnt][2].nil? #!= \"\"\n @my_unit = ingr_array[cnt][2] #weight and unit\n \n Rails.logger.info \"CLASS: #{@my_unit.class}\"\n if !@my_unit.get_scalar.nil?\n Rails.logger.info \"GET_SCALAR: #{@my_unit.get_scalar}\"\n @ir.weight = @my_unit.get_scalar\n end\n if !@my_unit.unit.nil?\n Rails.logger.info \"GET_UNIT: #{@my_unit.get_unit}\"\n @ir.unit = @my_unit.get_unit\n end\n else\n Rails.logger.info \"WARNING: Ingredient #{@id} has no associated WEIGHT or UNITS!\"\n end\n if !ingr_array[cnt][3].nil?\n @ir.group = ingr_array[cnt][3]\n end\n @ir.save\n @r.ingredients_recipes << @ir\n end \n @r.save!\n return @r.id\nend",
"title": ""
},
{
"docid": "5e1acd0ce21a93d0298a56999d1bdce7",
"score": "0.6475553",
"text": "def initialize(name)\n @name = name\n @recipes = []\n save\n end",
"title": ""
},
{
"docid": "4b7b1f99dbe7014d3e0301064eabf21a",
"score": "0.647522",
"text": "def initialize(recipe_instance, *all_ingredients_array)\n @recipe = recipe_instance\n @ingredient = all_ingredients_array\n @@all << self\n end",
"title": ""
},
{
"docid": "dfe20f029e82e1296832f34080c5784f",
"score": "0.6465671",
"text": "def initialize(recipe)\n @@list_of_recipes << recipe\n @@instances << self\n recipe_name = recipe.keys\n recipe_ingredients = recipe.values\n @recipe_name = recipe_name[0]\n @recipe_ingredients = recipe_ingredients[0]\n end",
"title": ""
},
{
"docid": "3f55c6e9209aee91e477a39083421c4d",
"score": "0.6447883",
"text": "def add_ingredients(ingredient_array)\n ingredient_array.each do |ingredient|\n RecipeIngredient.new(self, ingredient)\n end\n end",
"title": ""
},
{
"docid": "1454190537f438fa7ea7df01199ada15",
"score": "0.6420986",
"text": "def add_ingredients(ingredient_array)\n # iterate through each in array and run the block to assign the self to each new RecipeIngredient instance\n ingredient_array.each do | ingredient |\n RecipeIngredient.new(ingredient,self)\n end\n end",
"title": ""
},
{
"docid": "2ca8f5bb2e243e9ae0518901b75ec733",
"score": "0.6355625",
"text": "def recipes\n end",
"title": ""
},
{
"docid": "28ec92fd5633fb10b3b79267683d56d2",
"score": "0.6341674",
"text": "def recipes\n end",
"title": ""
},
{
"docid": "1fffb0d44221277201cce828d849567b",
"score": "0.63321114",
"text": "def recipes\n @recipes\n end",
"title": ""
},
{
"docid": "91f9e1afc03e265f99472caa48e6e2af",
"score": "0.63117135",
"text": "def add_ingredients(ingredients)\n ingredients.recipe.map do |recipe|\n ingredients.recipe\n end\n end",
"title": ""
},
{
"docid": "e3429f0f01962a36e186d49056ddb30a",
"score": "0.63074833",
"text": "def add_ingredients(ingredient_array)\n i = 0\n while i < ingredient_array.length\n RecipeIngredient.new(self, ingredient_array[i])\n i += 1\n end\n end",
"title": ""
},
{
"docid": "82cd6e0f19e15af461b50d0693f04d3c",
"score": "0.6246606",
"text": "def add_ingredients(ingredient_arr)\n ingredient_arr.each do |ingredient_obj|\n RecipeIngredient.new(self, ingredient_obj)\n end\n end",
"title": ""
},
{
"docid": "142b1fd54948501a16e851d65a78bf2c",
"score": "0.62434953",
"text": "def recipes\n end",
"title": ""
},
{
"docid": "642b6ed4b9a7baee8408ac4daf7483ee",
"score": "0.61419487",
"text": "def add_ingredients(ingredients)\n #took the ingredients argument and looped over them each time\n #I use a variable of an ingredient (i) and connect the recipe(self)\n #to the ingredient instance.\n ingredients.each { |i| RecipeIngredient.new(self, i) }\n end",
"title": ""
},
{
"docid": "1ead482fd8171b0b914066c77b4310bc",
"score": "0.6137927",
"text": "def add_ingredients(array_of_ingredients)\n array_of_ingredients.each do |ingredient|\n RecipeIngredient.new(\"#{self.name} ingredients\", ingredient, self)\n end\n end",
"title": ""
},
{
"docid": "5c05b78e331a115030a290a2f4c84e5f",
"score": "0.6111318",
"text": "def recipe\n self.recipe_O\n end",
"title": ""
},
{
"docid": "2e0246c80721bf6df8ddac59efb125b1",
"score": "0.6105142",
"text": "def add_ingredients(ingredients)\n ingredients.each do |ingredient|\n RecipeIngredient.new(self, ingredient)\n end\n\n end",
"title": ""
},
{
"docid": "45e6b9ce9688ab33edfb1691f169920f",
"score": "0.60483557",
"text": "def add_recipe(name, options=nil)\n run_list [] if run_list.nil?\n run_list << \"recipe[#{name}]\"\n if options\n empty_hash = {}\n self.dna = {} if self.dna.nil?\n self.dna.merge!(options)\n end\n end",
"title": ""
},
{
"docid": "a3318266418289145ca65faf1330e5d6",
"score": "0.59616804",
"text": "def add_ingredients(ingredients)\n ingredients.each {|ingredient| RecipeIngredient.new(ingredient: ingredient, recipe: self)}\n end",
"title": ""
},
{
"docid": "9f3c8986e1444e965b62393a92b5201e",
"score": "0.5956922",
"text": "def recipes\n RecipeCard.all.map do |rc|\n rc.recipe\n end\n end",
"title": ""
},
{
"docid": "b4b2024569d8a133b8960589cc424b3b",
"score": "0.5953076",
"text": "def recipe\n self.recipe_O\n end",
"title": ""
},
{
"docid": "0e817563084eb734967e397b0a2e2773",
"score": "0.5952926",
"text": "def recipes\n Recipe.find self.ingredients.map(&:recipe_id)\n end",
"title": ""
},
{
"docid": "837ad6e0adf99a7fc37e2dff6d08fc29",
"score": "0.5937153",
"text": "def recipe(arg=nil)\n set_or_return(\n :recipe,\n arg,\n :kind_of => [ String ]\n )\n end",
"title": ""
},
{
"docid": "0ce8c9adcbff2b2199e86587887c71c4",
"score": "0.5931693",
"text": "def initialize(title)\n @title = title\n @recipes = []\n end",
"title": ""
},
{
"docid": "7216fd28f7f84e7b4b4a8bd140121518",
"score": "0.592983",
"text": "def tags\n [*recipe.tags]\n end",
"title": ""
},
{
"docid": "38bf583076e82265beb5d202276821ac",
"score": "0.5927053",
"text": "def initialize(ingredient)\n @ingredient = ingredient\n @@all << self\n end",
"title": ""
},
{
"docid": "2564275369d0198da40bdbd962429624",
"score": "0.5925227",
"text": "def add_ingredients(ingredients)\n Ingredient.each{|ingredient| RecipeIngredient.new(ingredient, self)}\n end",
"title": ""
},
{
"docid": "86deeb365bc640d7d0b4649093f30bbd",
"score": "0.59220207",
"text": "def recipes\n recipe_cards.map {|card| card.recipe}\n end",
"title": ""
},
{
"docid": "36441355728dc00ef159c547e7533063",
"score": "0.5915168",
"text": "def add_ingredients(ingredients)\n ingredients.each do |item|\n RecipeIngredient.new(self, item)\n end\n end",
"title": ""
},
{
"docid": "63c499070fb3dd978031552db63c69fb",
"score": "0.59043187",
"text": "def initialize(recipe_name, serving_size=1)\n\t\t@recipe_name = recipe_name\n\t\t@serving_size = serving_size\n\t\t# 7. Create a place to store all of our ingredients\n\t\t# @ingredients = []\n\t\t# 8. How do we save the recipe to our array\n\t\t@@all << self\n\tend",
"title": ""
},
{
"docid": "e02ef7f8897bb42029ab3235383d3be0",
"score": "0.5899922",
"text": "def get_ingredients\n recipe_ingredients.map{|rec_ingredient| rec_ingredient.ingredient}.uniq\n end",
"title": ""
},
{
"docid": "b539dc2de77cd852085d8b8da636fbfe",
"score": "0.58972377",
"text": "def initialize(name, serving_size = \"1 serving\")\n @name = name\n @serving_size = serving_size\n # 6. How should we keep track of ingredients?\n # @ingredients = []\n\n # 7. How do we save the recipe to our array?\n @@all << self\n end",
"title": ""
},
{
"docid": "03c20ccd53d683de834a0cf58643869f",
"score": "0.58860236",
"text": "def recipes\n recipe_cards.map { |recipe_card| recipe_card.recipe }\n end",
"title": ""
},
{
"docid": "56099d0982a73a5361f8ffac0ceb13a2",
"score": "0.5865684",
"text": "def initialize(name)\n @name = name\n @ingredients = []\n end",
"title": ""
},
{
"docid": "4af9dfd34e6a91b1c9e8bc1804803068",
"score": "0.5856876",
"text": "def build!(recipe_data)\n @recipes = []\n recipe_data.each { |args| @recipes << RecipeModel.new(args) }\n sort\n assign_sort_id\n end",
"title": ""
},
{
"docid": "d8ce54a3be2cdc6c5d05f7acbd24ce04",
"score": "0.58513856",
"text": "def find_ingredients_for_sandwich\n @bag << Bread.new\n @bag << Jelly.new\n @bag << PeanutButter.new\nend",
"title": ""
},
{
"docid": "432601ff351194321020af79ab4dfcb5",
"score": "0.5834272",
"text": "def recipes\n self.recipe_cards.map { |card| card.recipe }\n end",
"title": ""
},
{
"docid": "8b74a07ef2786513aa5c66d4e281d016",
"score": "0.58267725",
"text": "def add_ingredients(array)\n array.each do |item|\n if item == self.ingredients\n puts self.ingredients\n end\n end\n end",
"title": ""
},
{
"docid": "1846ed37d208fde33297af2ab5fa1ac5",
"score": "0.5813779",
"text": "def ingredients\n\n self.recipe_ingredients.map {|card| card.ingredients}\n end",
"title": ""
},
{
"docid": "9d371ab3342dd74250a234ecab20b636",
"score": "0.5803884",
"text": "def add_recipe(recipe)\n @recipes << recipe\n save\n end",
"title": ""
},
{
"docid": "47cb1d2bc440d8425b364c66fae7e64b",
"score": "0.58009684",
"text": "def recipes\n recipe_cards.map do |rc|\n rc.recipe\n end\n end",
"title": ""
},
{
"docid": "6eb28dea904ce65b163cb49f4e3990fa",
"score": "0.57959217",
"text": "def initialize(recipe_name, serving_size=1)\n\t\t@recipe_name = recipe_name\n\t\t@serving_size = serving_size\n\t\t# 7. Create a place to store all of our ingredients\n\t\t# 8. How do we save the recipe to our array\n\t\t@@recipes << self\n\tend",
"title": ""
},
{
"docid": "5754c5778f7c70e39692732a9c43970c",
"score": "0.5795033",
"text": "def recipe\n object.recipe\n end",
"title": ""
},
{
"docid": "997ecd4a6f31b0bb62f24cd6076c653e",
"score": "0.5793545",
"text": "def generate_recipes_list\n recipes = chefsorted_objects(:recipe)\n generate_full_list(recipes, 'Recipe', 'recipes')\nend",
"title": ""
},
{
"docid": "a1f15d384efa83c44dff0934d8859dc0",
"score": "0.57930857",
"text": "def recipe\n @recipe ||= Recipe.new\n end",
"title": ""
},
{
"docid": "adbd8739b72e0cf286083ef784e91285",
"score": "0.5791504",
"text": "def recipes\n self.recipe_cards.map {|recipe_card| recipe_card.recipe}\n end",
"title": ""
},
{
"docid": "fcb097445bcdbb0cf9b523739fecf856",
"score": "0.5789975",
"text": "def recipes\n recipe_cards.map do |r|\n r.recipe\n end\n end",
"title": ""
},
{
"docid": "3ff77c4261d4b5327b5a01971e1a35f4",
"score": "0.57806927",
"text": "def cookbook_ingredients\n @cookbook.map do |recipe|\n recipe.ingredients\n end\n end",
"title": ""
},
{
"docid": "db8e2ce26a9da002ae58bb2f48ab9338",
"score": "0.5780313",
"text": "def <<(ingredient)\n @ingredients << ingredient\n end",
"title": ""
},
{
"docid": "993b0d194eb59b2af7354dd69a30060d",
"score": "0.5778271",
"text": "def to_recipe(row)\n Bukaresep::Recipe.new(row[1], row[2], row[3], row[4], row[0])\n end",
"title": ""
},
{
"docid": "158ed6fc8b6965bdbc5fdbba11cd7c51",
"score": "0.57656413",
"text": "def recipe_ids\n self.recipes.map(&:recipe_id)\n end",
"title": ""
},
{
"docid": "700bf1d4a0310c74e33cfb70112e7f20",
"score": "0.5756434",
"text": "def ingredients\n @ingredients.dup\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "3bb6064a0beacfa69d1c03afd827ec45",
"score": "0.57448447",
"text": "def all\n @recipes\n end",
"title": ""
},
{
"docid": "5b426daf7dd44cea4f326575391d6dff",
"score": "0.5735566",
"text": "def create\n @recipe = Recipe.new(recipe_params)\n # dirty solution because ingredients don´t pass thru the permit function (see the private recipe_params instance method )\n # so we iterate a second time over the original params hash\n # remove the last element because it´s always an empty String in the Array\n # and get by the index the corresponding Ingriedient Object and add it to recipe.ingredients\n params[:recipe][:ingredients].each do |i|\n if i != \"\"\n int_value_of_id = Integer(i)\n\n @ing = Ingredient.find_by_id(int_value_of_id)\n @recipe.ingredients << @ing\n end\n end\n\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": "a95f48dc0bb2853f526d546469255b79",
"score": "0.57274944",
"text": "def ingredients\n self.recipe_ingredients.map do |recipe_ingredient|\n recipe_ingredient.ingredient\n end\n end",
"title": ""
},
{
"docid": "5111435ca51bd1951d300421b2c5c69b",
"score": "0.57184035",
"text": "def recipes\n recipe_cards.collect{|card| card.recipe}\n end",
"title": ""
},
{
"docid": "ef2d15ae5a293b400b9c8f1e31cceaca",
"score": "0.57177395",
"text": "def recipe \n Recipe.all\n end",
"title": ""
},
{
"docid": "4b0d68891f2b56d9c2e2798873ce0007",
"score": "0.57159966",
"text": "def add_recipe(recipe)\n @recipes << recipe\n store_csv\n end",
"title": ""
},
{
"docid": "00e136449cd5a75c1c6115b7f5afba9e",
"score": "0.5700135",
"text": "def recipe_instances_of_ingredients\n RecipeIngredient.all.select do |each_recipe_instance|\n each_recipe_instance.recipe == self\n end\n end",
"title": ""
},
{
"docid": "8cd79bac9c5176ac91938fad83d258b6",
"score": "0.56984305",
"text": "def remember_load(options)\n if self.class.current_feature\n list = (self.class.recipes_per_feature[self.class.current_feature] ||= [])\n list << options\n end\n end",
"title": ""
},
{
"docid": "61e04672224d65ff63d33cdf2a24c98f",
"score": "0.56966025",
"text": "def save_recipe_from_recipe_list\n new_list = []\n new_list << recipe_list\n array = new_list.flatten\n puts array\n puts \"\"\n puts \"please enter the number of the corresponding recipe you'd like to save\"\n \n corres_number = gets.chomp\n choice_num = (corres_number.to_i)-1\n choice = array[choice_num]\n choice_title = choice[2..-1].strip\n puts \"saving #{choice_title}!\"\n save_recipe(choice_title)\n puts \"\"\n \n puts \"saved, along with your previous recipes..\"\n puts \"\"\n puts saved\n \n puts \"redirecting you to the main menu for more recipe hacks\"\n \n end",
"title": ""
},
{
"docid": "cfb56943ff76470d438f1f8824ad1f92",
"score": "0.5693959",
"text": "def custom_recipes\n data.custom_recipes\n end",
"title": ""
},
{
"docid": "e05e77309694bea8903abf5ca415daab",
"score": "0.56930846",
"text": "def generate_class_list\n @items = options.objects if options.objects\n @list_title = \"Recipes List\"\n @list_type = \"class\"\n generate_list_contents\nend",
"title": ""
},
{
"docid": "0451387baa08519a4ff6fbb6bb1b39ed",
"score": "0.56870294",
"text": "def generate_recipes_list\n recipes = YARD::Registry.all(:recipe).sort_by { |recipe| recipe.name.to_s }\n generate_full_list(recipes, 'Recipe', 'recipes')\nend",
"title": ""
},
{
"docid": "310baa0d4c0787e0133c45c272a4256d",
"score": "0.56842166",
"text": "def ingredients(any_recipe)\n \nend",
"title": ""
},
{
"docid": "083ba2fadaea684cf455802b627cffa2",
"score": "0.56839854",
"text": "def add_recipe(recipe)\n @recipes << recipe\n save_csv\n end",
"title": ""
},
{
"docid": "083ba2fadaea684cf455802b627cffa2",
"score": "0.56839854",
"text": "def add_recipe(recipe)\n @recipes << recipe\n save_csv\n end",
"title": ""
},
{
"docid": "7b58370f8682eeef08372143f70099bf",
"score": "0.5673893",
"text": "def add_ingredients(ingredients)\n ingredients.each do |ingredient|\n RecipeIngredient.new(self,ingredient)\n end\n end",
"title": ""
},
{
"docid": "a3fa0ea2c6a14395c014d503e8a34d50",
"score": "0.5664355",
"text": "def recipe name\n run_list << name\n end",
"title": ""
},
{
"docid": "a3fa0ea2c6a14395c014d503e8a34d50",
"score": "0.5664355",
"text": "def recipe name\n run_list << name\n end",
"title": ""
},
{
"docid": "12a3c9607d55674f182f0bdd8997e4ee",
"score": "0.56586534",
"text": "def create_recipes\n # grab name and url attributes\n new_attributes = PopularRecipes::RecipeScraper.scrape_list_page\n # create new instances of recipes and save them\n PopularRecipes::Recipe.create(new_attributes)\n # use the urls of each instance and scrape all the other information and update the attributes\n #PopularRecipes::Recipe.all.each do |recipe|\n # additional_attr = scraper.scrape_recipe_page(recipe.url)\n # recipe.add_attributes(additional_attr)\n #end\n end",
"title": ""
},
{
"docid": "84956bc41d95f856a4c90d1cda15b2c4",
"score": "0.56577855",
"text": "def ingredients\n self.recipe_ingredients.map do |recipeingredient|\n recipeingredient.ingredient\n end\n #returns an array of ingredients in the recipe_ingredients array\n end",
"title": ""
},
{
"docid": "dea3e87d56afa9d0f77013caedb5e8ce",
"score": "0.5635474",
"text": "def recipes\n menu_items.map {|item| item.recipe}\n end",
"title": ""
},
{
"docid": "5ae2e8dbbb3ac722f35d002e9af8ed84",
"score": "0.56281674",
"text": "def add_ingredients(ingredient_list)\n \n array = ingredient_list.map do |ingredient|\n #binding.pry\n Ingredient.new(ingredient)\n end\n \n array.each do |ingredient|\n RecipeIngredient.new(self, ingredient)\n end\n end",
"title": ""
},
{
"docid": "8665684a47781117bbf7b2441acfde60",
"score": "0.5622775",
"text": "def add_ingredients(ingredients)\n ingredients.each {|ingredient| RecipeIngredient.new(self, ingredient)}\n end",
"title": ""
},
{
"docid": "ab7b756df5e11247cf01d5ec7c5a3bb4",
"score": "0.5616831",
"text": "def caloriesarray\n self.ingredients.map do |ingredient|\n ingredient.calories\n end\nend",
"title": ""
},
{
"docid": "94d558ebc7bba27fc48e7090532b4c06",
"score": "0.56067216",
"text": "def get_all_recipes\n end",
"title": ""
},
{
"docid": "5298428d8899ce7d5884e9f124b1cf9b",
"score": "0.56063074",
"text": "def find_ingredients\n \n @ingredients = Array.new\n Ingredient.all.each do |ing|\n \n pair = Array.new\n \n pair.push(ing.name,ing.id)\n \n @ingredients.push(pair)\n \n end\n \n end",
"title": ""
},
{
"docid": "e47426bff5d135c3a6b666bca1f730b3",
"score": "0.5602562",
"text": "def recipe name\n run_list << name\n run_list.uniq!\n end",
"title": ""
},
{
"docid": "0f7fbbd57ba2bf843f618c6c88ef356d",
"score": "0.5600891",
"text": "def add_ingredients(ingredients)\n ingredients.each do |ingredient|\n RecipeIngredient.new(self, ingredient)\n end\n end",
"title": ""
},
{
"docid": "08d638a8703cdbe106410f2b5fb06543",
"score": "0.55999553",
"text": "def initialize(title) # initilize method will allow user to name cookbook\n @title = title # user will set title of cookbook\n @recipes = [] # will write an empty recipes array when initilizing\n end",
"title": ""
},
{
"docid": "caffd2f4fe561f467b39b03a6b48a354",
"score": "0.5594504",
"text": "def create_recipes!\n\n recipes = []\n item_id_collection.each do |item_id|\n\n item = Item.find_or_load(item_id)\n recipe = Recipe.new(:item => item, :recipe_group => recipe_group)\n reagents.each do |reagent|\n recipe.reagents.build(:reagent => reagent.reagent, :quantity => reagent.quantity)\n end\n recipe.save!\n\n recipes << recipe\n\n end\n\n end",
"title": ""
},
{
"docid": "3e66284cd40fbecbde81ca30b45dc462",
"score": "0.55877775",
"text": "def new\n @recipe = Recipe.new\n @ingredients = 10.times.collect { @recipe.recipe_ingredients.build }\n end",
"title": ""
},
{
"docid": "6a3a7dbb3112cf49d7a4af029550156d",
"score": "0.5585864",
"text": "def create_recipe(title)\n recipe_array = []\n r = Recipe.create(title: title)\n UserRecipe.create(user_id: $curr_user.id, recipe_id: r.id)\nend",
"title": ""
},
{
"docid": "dfd0c021abc9195325a0525eb4152a5f",
"score": "0.558307",
"text": "def summary\n cookbook_array = []\n @all_recipes.each do |recipe|\n hash_recipe = {}\n hash_recipe[:name] = recipe.name\n hash_recipe[:details] = [:ingredients]\n hash_recipe[:details] = recipe.ingredients_required\n ingredient_arr = []\n hash_recipe[:details][:ingredients] = recipe.ingredients_required.each do |ingredient|\n ingredient_arr << ingredient[0].name\n end\n cookbook_array << hash_recipe\n end\n cookbook_array\n end",
"title": ""
},
{
"docid": "6fa3f7e65772e7a2b13deb355d5b302e",
"score": "0.5571673",
"text": "def to_array\n temp = []\n ingredients.each do |ingredient|\n temp.push(ingredient.name)\n end\n temp.insert(0, 'r')\n temp.insert(0, name)\n temp\n end",
"title": ""
},
{
"docid": "ec4f6709588f428e9aa08c949349fb04",
"score": "0.5570673",
"text": "def copy_ingredients_to(element)\n ingredients.map do |ingredient|\n Ingredient.copy(ingredient, element_id: element.id)\n end\n end",
"title": ""
},
{
"docid": "c311c99961f9a63f62a3827988cd0128",
"score": "0.5562449",
"text": "def custom_recipes\n data[:custom_recipes]\n end",
"title": ""
},
{
"docid": "2c6977b38109429dc206919ed9173cd9",
"score": "0.5557348",
"text": "def edit_foodstuffs\n foodstuffs = recipe_foodstuff_drafts.to_a\n (4 - foodstuffs.size).times{ foodstuffs<< RecipeFoodstuff.new } if foodstuffs.size < 4\n foodstuffs\n end",
"title": ""
},
{
"docid": "b04399bb2be43bf1c7a9080d94f8ae81",
"score": "0.55526054",
"text": "def add_recipe(name, ingredients, method, cooking_time)\n @recipes[name.to_sym] = [ingredients, method, cooking_time]\n\n end",
"title": ""
}
] |
1b7031a38e2202b1f612b4d5c9c7b5e4
|
sends an array with individual average times and sends to view to display envia um array com as medias individuais de tempo para a view mostrar
|
[
{
"docid": "80a89f262430757bbecc7932930ad614",
"score": "0.694376",
"text": "def show_avg_time\n avg_times = []\n RACER_RECORDS.each {|racer| avg_times << [ racer.piloto, racer.avg_time_lap ]}\n @view.display_avg_times(avg_times)\n end",
"title": ""
}
] |
[
{
"docid": "b73beba1e0afeea62c86b09b70c6a830",
"score": "0.6742312",
"text": "def display_avg_times(avg_times)\n puts(\"Tempo Médio De Voltas:\")\n puts(\"---------------\")\n avg_times.each do |array|\n puts \"#{array[0]} - Tempo Médio: #{array[1].round(2)} minutos\"\n end\n puts(\"---------------\")\n end",
"title": ""
},
{
"docid": "88fab2c25e1da0dc8088a44f069a8877",
"score": "0.62033594",
"text": "def show_avg_speed\n avg_speeds = []\n RACER_RECORDS.each {|racer| avg_speeds << [ racer.piloto, racer.avg_speed ]}\n @view.display_avg_speeds(avg_speeds)\n end",
"title": ""
},
{
"docid": "7f5d2b73f5f4a5a072bee742ce13d3c2",
"score": "0.5876539",
"text": "def index\n @date = Date.parse(params[:date]) rescue Date.today\n # @late_users_count = UserTrackLog.where('DATE(arrival_time) = ? and is_late = 1', @date).count\n # @avg_time = UserTrackLog.find_by_sql(\"select user_name,AVG(DATE_FORMAT(arrival_time,'%H:%i:%s')) 'av_time',user_id from user_track_logs where DATE(arrival_time) = '#{@date}'\")\n\n @user_track_logs = UserTrackLog.find_by_sql(\" select u.id,u.user_name,arrival_time,is_late,u.user_id,t.late_count from user_track_logs u \n left outer join (select user_name,SUM(is_late :: int) as late_count,user_id\n from user_track_logs group by user_name,user_id) t on (u.user_id =t.user_id)\n where DATE(u.arrival_time) = '#{@date}' order by u.user_name asc, t.late_count desc\")\n\n\n\n deliver_at = @user_track_logs.map{|d| d.arrival_time.hour * 3600 + d.arrival_time.min * 60 + d.arrival_time.sec}\n avg =deliver_at.inject(:+) / deliver_at.count unless deliver_at.blank?\n avg_hour = avg / 3600 if avg\n avg_minut = (avg % 3600) / 60 if avg\n avg_sec = avg % 60 if avg\n\n @avg_time = \"#{avg_hour}:#{avg_minut}:#{avg_sec}\" if avg\n\n\n\n end",
"title": ""
},
{
"docid": "f97e20e908ae2eebab8c693a86574fdd",
"score": "0.58316743",
"text": "def save formatted_time,arr\n # add it to the sum\n arr.each do |n| \n next unless @block.call(*arr[1..-1]) if @block\n i = Integer(n) rescue return\n @value[formatted_time] += i;\n end\n end",
"title": ""
},
{
"docid": "3f5f70a00a53aa4094cdea741a47f558",
"score": "0.5799366",
"text": "def report\n puts \"Time taken: #{average}\"\n puts \"Messages per second: #{@messages_count / average}\" if @messages_count\n end",
"title": ""
},
{
"docid": "0f7833db54bfb68039f8328d491af2b9",
"score": "0.57969415",
"text": "def average\n return @@average_times.inject(:+).to_f / @@average_times.size\n end",
"title": ""
},
{
"docid": "92f698d315dc832081ce805ba1ec9896",
"score": "0.57761544",
"text": "def index\n @quiebres = Quiebre.all\n @array=[]\n @quiebres_totales=0\n @quiebres.each do |q|\n @quiebres_totales+=q.dineroperdido\n end\n # [email protected]_at\n # while(fecha<Date.today)\n # [email protected](created_at:fecha).count\n # @array << [fecha.to_datetime.to_i*100, num]\n # fecha=fecha+1.day\n # end\n @grafico=Quiebre.group(\"date(created_at)\").count\n @grafico.each do |g|\n @array << [g[0].to_datetime.to_i*1000, g[1]]\n end\n # if !@\n end",
"title": ""
},
{
"docid": "fe35503d3169457d47eac95858b57c7b",
"score": "0.57587874",
"text": "def query_times_graphs\n controller = params[:controller_name]\n action = params[:action_name]\n data = redis(logger: true).zrangebyscore(\"request_timings/total/by_action/#{controller}##{action}\",\n 1.month.ago.to_i, '+inf',\n with_scores: true)\n .map { |y, x| [x.to_f, y.to_f] }\n throw 'No Data' if data.nil? || data.empty?\n smoothed = moving_avg(data)\n final = (params[:raw].present? ? data : smoothed).map { |x, y| [Time.at(x.to_i).to_datetime, y] }\n render json: [\n { name: 'Timings', data: final }\n ]\n end",
"title": ""
},
{
"docid": "6969f18f4ab5c56ef85ea43c5c3b0dbe",
"score": "0.5747185",
"text": "def day\n stamp = params[:stamp].to_i\n time = Time.at(stamp)\n day_data = GlucoseSensorData.by_day(time.utc.to_date, :field => :timestamp)\n\n #@day_data.map do |datum|\n # datum[:glucose_scaled] = (Math.log(datum[:glucose]) - Math.log(120)) ** 2\n #end\n\n max = GlucoseSensorData.maximum(:timestamp)\n limit = 3\n range = {}\n unless range == \"all\"\n range = { :begin => max - limit.months, :end => max }\n end\n\n #averages = average_day(max.to_date, range)\n averages = []\n\n response = {\n \"averages\" => averages,\n \"day_data\" => day_data\n }\n\n render :json => response.to_json\n end",
"title": ""
},
{
"docid": "5ab752c194dc279ef5ce5f0acec11400",
"score": "0.57088673",
"text": "def compute_times\n @render_avg = 0.0\n @db_avg = 0.0\n @total_avg = 0.0\n @render_max = 0.0\n @db_max = 0.0\n @total_max = 0.0\n @error_avg = 0.0\n \n @log_entries.each do |la|\n if la.error?\n @error_avg += 1.0\n next\n end\n @render_avg += la.rendering\n @db_avg += la.db\n @total_avg += la.duration\n @render_max = la.rendering if la.rendering > @render_max\n @db_max = la.db if la.db > @db_max\n @total_max = la.duration if la.duration > @total_max\n end\n \n @render_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @db_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @total_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @error_avg /= @log_entries.size.to_f\n\n # using math.log allows us to smooth out the score between\n # infrequent and very frequent actions. 0.1 is added for a\n # non-0 result\n @render_cost = @render_avg * Math.log(@log_entries.size+0.1)\n @db_cost = @db_avg * Math.log(@log_entries.size+0.1)\n @total_cost = @total_avg * Math.log(@log_entries.size+0.1)\n end",
"title": ""
},
{
"docid": "912f7be627fd096eafd658d616bd406d",
"score": "0.55453366",
"text": "def show\n\n #@late_users_count = UserTrackLog.where(' is_late = 1 and user_id = ?',params[:id]).count\n #@avg_time = UserTrackLog.find_by_sql(\"select user_name,AVG(DATE_FORMAT(arrival_time,'%H:%i:%s')) 'av_time',user_id from user_track_logs where user_id = '#{params[:id]}'\")\n\n @user_track_logs = UserTrackLog.find_by_sql(\" select u.id,u.user_name,arrival_time,is_late,u.user_id from user_track_logs u \n \n where u.user_id = '#{params[:id]}' order by arrival_time desc\")\n \n deliver_at = @user_track_logs.map{|d| d.arrival_time.hour * 3600 + d.arrival_time.min * 60 + d.arrival_time.sec}\n avg =deliver_at.inject(:+) / deliver_at.count unless deliver_at.blank?\n avg_hour = avg / 3600 if avg\n avg_minut = (avg % 3600) / 60 if avg\n avg_sec = avg % 60 if avg\n @avg_time = \"#{avg_hour}:#{avg_minut}:#{avg_sec}\" if avg\n\n end",
"title": ""
},
{
"docid": "102f80acfd6e5c2ddda4fa2249eb39f7",
"score": "0.55267346",
"text": "def average_response_time\n return summary_average[:average_response_time]\n end",
"title": ""
},
{
"docid": "258b6994ad2de044566d70cfc68163c9",
"score": "0.55174625",
"text": "def timed(&block)\n @@start_time = Time.now\n Thread.new(&block).join\n @@elapsed_time = Time.now - @@start_time\n @@average_times.push(@@elapsed_time) \n end",
"title": ""
},
{
"docid": "8634413263c9cad0aa10742c7bc9bed6",
"score": "0.5501968",
"text": "def index\n @user=params[:utente]\n @feedbacks = Feedback.where(proprietario_id: @user)\n #Calcolo della media, sommo tutti i voti dell'utente e li moltiplico per 20 in quanto il nostro range è da 1-5\n @media = 0.0\n @feedbacks.each do | feed |\n @media += feed.voto\n end\n @media = (@media/@feedbacks.count)*20\n \n end",
"title": ""
},
{
"docid": "fa3924428520613a071060e096aa407c",
"score": "0.54771996",
"text": "def average(note_array, weighting_array)\n if(note_array.length > 0 && note_array.length == weighting_array.length)\n note_som = 0\n weig_som = 0;\n\n for index in 0...note_array.length\n note_som += note_array[index] * weighting_array[index]\n weig_som += weighting_array[index]\n end\n\n per_cent = (note_som / weig_som) * 100 / 20\n puts \"La moyenne est de #{per_cent} %.\"\n else puts \"Le nombre de notes n'est pas égal au nombre de pondération.\"\n end\nend",
"title": ""
},
{
"docid": "dea5e5623f3684c075aaebf39ae45890",
"score": "0.54625565",
"text": "def stats\n @stats = time_data Gig.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Gig.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Gig.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "d7e199c0e470929538d84c51957b6298",
"score": "0.5425596",
"text": "def display_time_diff(src_path)\n td = calc_time_diff(src_path)\n avg = td.inject{|sum,el| sum + el}.to_f / td.size\n\n td.each {|t| puts t}\n puts \"Size: #{td.size}\"\n puts \"Min: #{td.min}\"\n puts \"Max: #{td.max}\"\n puts \"Avg: #{avg.round}\" \nend",
"title": ""
},
{
"docid": "a26e079d146a9942cacfc57fab615e4b",
"score": "0.5405037",
"text": "def averages(array)\n\t\taverages = []\n\t\taverages << mean(array)\n\t\taverages << median(array)\n\t\taverages << mode(array)\n\t\taverages << length(array)\n\tend",
"title": ""
},
{
"docid": "6f95a4997d0239ae095a65ff8636e664",
"score": "0.54032475",
"text": "def stats\n Project.hit 15\n Project.hit 32\n @stats = time_data TextMessage.all\n @cloud = word_cloud TextMessage.pluck(:text)\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(TextMessage.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(TextMessage.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "c4bee2263fd23069b001e4a22c14d4b9",
"score": "0.5389361",
"text": "def avg_time(data)\n #pp data\n total = 0\n count = 0\n data.each do |_, list|\n list.each do |v|\n unless v[\"value\"].empty?\n hour,min = v[\"value\"].split(':')\n if hour.to_i >= 21\n total += hour.to_i * 60 + min.to_i\n count += 1\n elsif hour.to_i <= 6\n total += 24*60 + hour.to_i * 60 + min.to_i\n count += 1\n end\n end\n end\n end\n avg_hour = total / count / 60 % 24\n avg_min = total / count % 60\n puts \"#{avg_hour}:#{avg_min}\"\nend",
"title": ""
},
{
"docid": "31ceb102396bcdc5084d36f1bc62d472",
"score": "0.5382783",
"text": "def time\n\talltime = Array.new\n\tslices = 10\n\ti = 0\n\twhile i < slices.to_i do\n\t\talltime.push(Time.now)\n\t\ti+=1\n\tend\n\tyield\nend",
"title": ""
},
{
"docid": "611e4f7871b251b05c9090138adb8efd",
"score": "0.53795356",
"text": "def response_by_days\n selected_files.each do |file_name|\n key = file_name[0,6]\n next if @by_day[key]\n result = [key, 0, 0, 0]\n File.readlines(file_name).each do |line|\n next unless line.match 'Completed 200 OK in'\n time = $'.split('ms').first.strip.to_i\n result[1] += 1\n result[2] += time\n end\n# average \n result[3] += result[2]/result[1]\n p result\n @by_day[key] = result\n end\nend",
"title": ""
},
{
"docid": "6fa764eba3836f8810f2476c0db08399",
"score": "0.53761774",
"text": "def mean_response(records)\n if records.length == 0\n return 0.0\n end\n\n return records.map {|r| r.response_time}.reduce(:+) / records.length.to_f\nend",
"title": ""
},
{
"docid": "e92acea9a87bde95a21aaadbc8a6e27d",
"score": "0.5372564",
"text": "def calculateAverage notes\n total_note = 0\n notes.each do |note|\n total_note += note\n end\n total_note / notes.length\nend",
"title": ""
},
{
"docid": "37420fa6519f5696493d97ee547a4ded",
"score": "0.53671366",
"text": "def gettiming\n\tworker = params[:compname]\n\t\n\trealdata = '{\"dataArray\":[{\"label\":\"first\",\"oldtime\":\"1245\"}]}'\n\t\n\ttime = MongoDBConnector.instance.getRunTime(worker)\n\t\n\ttimeList = []\n\ttime.each do |x|\n\t\tx.each do |key, value|\n\t\t\ttimeList.push(:label => key, :oldtime => value )\n\t\tend\n\tend\n\ttime = {:dataArray => timeList}\n\ttime = time.to_json\n\trender :text => time\n end",
"title": ""
},
{
"docid": "f96893dcb16db323d58d8fbcae754238",
"score": "0.53538454",
"text": "def stats\n @stats = time_data SolarReading.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(SolarReading.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(SolarReading.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "a6f52e712dd4dab91ab773ddb57080f4",
"score": "0.5352984",
"text": "def mainWidgetData\n\n\n\t\t\t# Set an empty array\n\t\t\tdata = []\n\t\t\t# Loop through the rawData\n\t\t\[email protected] do |day|\n\t\t\t\t# Set the empty array for each day\n\t\t\t\tdayHash = []\n\t\t\t\tdayHash << [day[:total_prayed], \"total\"]\t# Push in the key value pair [value, \"total\"]\n\t\t\t\tdayHash << [day[:fajr], \"fajr\"]\t\t\t\t# Push in the key value pair [value, \"fajr\"]\n\t\t\t\tdayHash << [day[:zuhr], \"duhr\"]\t\t\t\t# Same as above\n\t\t\t\tdayHash << [day[:asr], \"asr\"]\t\t\t\t# Same as above\n\t\t\t\tdayHash << [day[:maghrib], \"maghrib\"]\t\t# Same as above\n\t\t\t\tdayHash << [day[:isha], \"isha\"]\t\t\t\t# Same as above\n\t\t\t\tdata <<\tdayHash\t\t\t\t\t\t\t\t# Push in the dayHash into the main parent hash\n\t\t\tend\n\t\t\t# Generate a path for the dot chart svg\n\t\t\t# Set the initial value of the path\n\t\t\tpath = \"M10 20 \"\n\t\t\t\n\t\t\tif @timesRequestSent < 16\n\t\t\t\t# Loop through the entire data\n\t\t\t\t(0..(@timesRequestSent-1)).each do |i|\n\t\t\t\t\t# Add path based on the average per day prayer, using the \"total\" value\n\t\t\t\t\tpath += \"L#{30+ 60*i} #{20 - (data[i][0][0]/5.to_f)*20} \"\n\t\t\t\tend\n\t\t\t\tpath += \"L#{60*@timesRequestSent - 10} 20 Z\"\n\t\t\telse\n\t\t\t\tputs \"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\"\n\t\t\t\tdata = data[(@timesRequestSent-15),(@timesRequestSent-1)]\n\t\t\t\tputs data.count\n\t\t\t\t# Loop through the entire data\n\t\t\t\t(0..14).each do |i|\n\t\t\t\t\t# Add path based on the average per day prayer, using the \"total\" value\n\t\t\t\t\tpath += \"L#{30+ 60*i} #{20 - (data[i][0][0]/5.to_f)*20} \"\n\t\t\t\tend\n\t\t\t\tpath += \"L#{60*15 - 10} 20 Z\"\n\t\t\tend\n\t\t\t\n\t\t\t# Return both the path and the day array\n\t\t\t{ data: data, path: path }\n\t\tend",
"title": ""
},
{
"docid": "2090dda55eba1e97faad9bd3b0d30fcb",
"score": "0.5333997",
"text": "def average_weather\n message = \"Média para os proximos dias: \"\n 5.times do |t|\n date = Date.today + 1 + t\n message += forecast.average_temperature(date).to_s\n message += temp_type\n message += \" em \"\n message += date.strftime(\"%d/%m\").to_s\n message += \"#{t == 4 ? '.' : ',' } \"\n end\n message\n end",
"title": ""
},
{
"docid": "63448c3afa89efb6cd778e68c4bc0b11",
"score": "0.5332034",
"text": "def run events\n events.each do |event| \n interprete event\n end\n# return\n puts \"Statistics:\"\n @counts.each do |k,v|\n puts \"#{k.inspect} =>\"\n i = 0\n step = 6\n while i < v.size\n puts \"\\t#{v[i,step]}\"\n i += step\n end\n end\n end",
"title": ""
},
{
"docid": "692a48256ce9ab7bd25e89a8edd51d06",
"score": "0.5327327",
"text": "def average_finish_time(game, nb_game)\n\n#On initialise la somme des nombres de laps\nsomme = 0\n\n#On teste si le nombre de parties > 100, si non on n'accpete pas\n\tif nb_game < 100 then puts \"Il faut un nombre > 100 !\"\n\n#Si oui, on lance nb_parties (en l'occurence 150) fois le jeu (en l'occurence Stairways)\n\telse\n\t\t\tnb_game.times do game\n\t\t\tsomme += stairway\n\t\t\tend\n\n#On affiche la moyenne du nombre de parties\n\t\tputs \"**************************************************************************\"\n\t\tputs \"Le score moyen de vos #{nb_game} parties est de #{somme/nb_game} !\"\n\t\tputs \"**************************************************************************\"\n\n\tend\n\nend",
"title": ""
},
{
"docid": "92776c190b7cf5e171d71e10ceb8ad96",
"score": "0.5323074",
"text": "def index\n result = []\n db_data = get_db_aggregation\n redis_cache = get_cache_aggregation\n\n if redis_cache.empty?\n result = db_data\n elsif db_data.empty?\n result = redis_cache\n else\n db_data.each_with_index do |val,i|\n val.each do |k,value|\n avg_val = (value[\"avg\"].to_f + redis_cache[i][k][\"avg\"].to_f) / 2\n min_val = [value[\"min\"].to_f, redis_cache[i][k][\"min\"].to_f].min\n max_val = [value[\"max\"].to_f, redis_cache[i][k][\"max\"].to_f].max\n result << {k => {\"avg\" => avg_val, \"min\" => min_val, \"max\" => max_val} }\n end \n end\n end\n\n render json: {thermostat_data: result}\n end",
"title": ""
},
{
"docid": "049e36c7956cb361d6618bab6304dfec",
"score": "0.53176004",
"text": "def index\n @time_entries = TimeEntry.all.includes(task: :project).order(\"time_entries.id\")\n @total = TimeEntry.new\n @total.seconds = @time_entries.map(&:elapsed_time).reduce(&:+)\n @time_entry = TimeEntry.new\n end",
"title": ""
},
{
"docid": "f06b4465b84d4f3e06f6b4e0d36c92ae",
"score": "0.5315148",
"text": "def index\n #LOS ULTIMOS 12 MESES\n @sales_group_by_month = SalesCoffee.twelve_months_ago.group_by_month(:date_time).order(date_time: :asc ).sum(:price)\n @sales_quantity_twelve_months = SalesCoffee.twelve_months_ago.group_by_month(:date_time).order(date_time: :asc).count\n @sales_average_twelve_months = SalesCoffee.twelve_months_ago.group_by_month(:date_time).order(date_time: :asc).average(:price)\n\n #SEGUN ORIGEN\n @origen_twelve_months = SalesCoffee.twelve_months_ago\n @origen_six_months = SalesCoffee.six_months_ago\n @origen_three_months = SalesCoffee.three_months_ago\n @origen_last_month = SalesCoffee.last_month_ago\n\n #SEGUN MEZCLA\n @blend_name_twelve_months = SalesCoffee.twelve_months_ago\n @blend_name_six_months = SalesCoffee.six_months_ago\n @blend_name_three_months = SalesCoffee.three_months_ago\n @blend_name_last_month = SalesCoffee.last_month_ago\n end",
"title": ""
},
{
"docid": "68db9189bf32b1363d2f18457999c5ef",
"score": "0.530636",
"text": "def stats\n @stats = time_data Track.all\n @cloud = word_cloud Track.pluck(:artist), split: false, limit: 60\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Track.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Track.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "559ab6838d520ce071fb243f03672026",
"score": "0.5305961",
"text": "def average\n @data['average']\n end",
"title": ""
},
{
"docid": "69c1772e26bd8e1b10f75db45d7022d1",
"score": "0.52890944",
"text": "def index\n @schedules = Schedule.where(user_id: current_user).ongoing\n gon.arr_for_chart = my_chart(@schedules)\n end",
"title": ""
},
{
"docid": "784f0592cbf3dc118535a8b4a4c65259",
"score": "0.5288672",
"text": "def index\n time = time_spent\n hours = ( (1.0/60.0).to_f * time ).round(2)\n\n puts \"Time spent: #{time} minutes (#{hours} hours)\"\n end",
"title": ""
},
{
"docid": "f1719ad52411187591ce77262074a54f",
"score": "0.5274817",
"text": "def getTimingDetails\n labels = [] # store links accessed during review\n percentages = [] # store percentage time per link for pie chart\n tables = [] # store timing data breakdown per link\n stats = [] # store class stat data\n\n # get total time spent on review\n totalTime = getTotalTime(params[:reponse_map_id], params[:round])\n\n # push relevant data for each row into arrays used to fill in JSON\n SubmissionViewingEvent.where(map_id: params[:reponse_map_id], round: params[:round]).each do |entry|\n labels.push(entry.link)\n percentages.push(entry.total_time.to_f / totalTime)\n tables.push({\n \"subject\" => entry.link,\n \"timeCost\" => secondsToHuman(entry.total_time.to_i),\n \"avgTime\" => secondsToHuman(getAvgRevTime(params[:reponse_map_id], params[:round], entry.link))\n })\n end\n\n tables.push({\n \"subject\" => \"Total\",\n # contains total time spent in human format\n \"timeCost\" => secondsToHuman(totalTime),\n # contains average review time for this submission in human format\n \"avgTime\" => secondsToHuman(getAvgRevTime(params[:reponse_map_id], params[:round]))\n })\n\n stats.push({\n \"title\" => 'Class Average',\n \"value\" => secondsToHuman(getClassAvgRevTime(params[:reponse_map_id], params[:round]))\n })\n\n stats.push({\n \"title\" => 'Median',\n \"value\" => secondsToHuman(getMedianRevTime(params[:reponse_map_id], params[:round]))\n })\n\n stats.push({\n \"title\" => 'Standard Deviation',\n \"value\" => secondsToHuman(getStdDevRevTime(params[:reponse_map_id], params[:round]))\n })\n\n # create JSON\n @timingDetails = {\n # contains links accessed in review\n 'Labels'=> labels,\n # contains percentage time spent per link\n 'Data' => percentages,\n # contains link name and time spent for display table\n 'tables' => tables,\n # contains class stats\n 'stats' => stats\n }\n\n # respond to request with JSON containing all data\n respond_to do |format|\n format.json { render json: @timingDetails }\n end\n end",
"title": ""
},
{
"docid": "086eb31418e72209b32e4c109ee6a9da",
"score": "0.5259996",
"text": "def stats\n @stats = {\n total_distance: CyclingEvent.sum(:distance),\n total_time: CyclingEvent.sum(:finish_time),\n average_speed: CyclingEvent.sum(:distance).to_f / CyclingEvent.sum(:finish_time).to_f\n }\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: @stats, callback: params[:callback] }\n format.xml { render xml: @stats }\n end\n end",
"title": ""
},
{
"docid": "d00a01102186f632fc134de514d86bd2",
"score": "0.5253157",
"text": "def stats\n @stats = time_data MonzoTransaction.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(MonzoTransaction.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(MonzoTransaction.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "fef4ff3929a9d2a1a9381607365761c9",
"score": "0.5252057",
"text": "def display_results(result_array)\n puts \"------------------- Completed run ----------------------------\"\n puts \"Samples: #{result_array.length}\"\n puts \"Min time: #{result_array.min}\"\n puts \"Max time: #{result_array.max}\"\n puts \"Average time: #{result_array.mean}\"\n puts \"Standard Deviation: #{result_array.standard_deviation}\"\n puts \"Values: #{result_array.inspect}\" if @show_values\n puts \"--------------------------------------------------------------\"\n end",
"title": ""
},
{
"docid": "3c4d6c7753f749190fa5df3c0c7a22b1",
"score": "0.5245005",
"text": "def generate_time\n\t\tret = Array.new\n\t\tcount unless @fileinfo[:count]\n\t\ttrigger unless @fileinfo[:trigger]\n\t\tsampling unless @fileinfo[:sampling]\n\n\t\t(0..@fileinfo[:count] - @fileinfo[:trigger] - 1).each {|i| \n\t\t\tret << (i * @fileinfo[:sampling] * 1e-6)\n\t\t}\n\t\treturn ret\n\tend",
"title": ""
},
{
"docid": "57abe669398b7a1841d153366da5328f",
"score": "0.5236462",
"text": "def avg_time_spent\n\t\ttotal_time = self.visitors.inject(0){|sum,v| sum + v.total_time }.to_f\n\t\tavg_time = total_time/self.total_visits\n\tend",
"title": ""
},
{
"docid": "7c7e2932417885cb9b3a616503d63a4d",
"score": "0.5235101",
"text": "def index\n @current_user ||= User.find_by_remember_token(cookies[:remember_token])\n @hours = Hour.where(user_id: @current_user.id).where.not(group_id: nil).order('created_at DESC').includes(:group)\n @time = @hours.to_a.map { |x| x[:amount] }.sum\n end",
"title": ""
},
{
"docid": "d833e5c3b4ee803429c41d91ee507818",
"score": "0.52228874",
"text": "def spark\n @investigation = Investigation.find(params[:id])\n @data = []\n @data << resource.activities.seven_days_ago.count\n @data << resource.activities.six_days_ago.count\n @data << resource.activities.five_days_ago.count\n @data << resource.activities.four_days_ago.count\n @data << resource.activities.three_days_ago.count\n @data << resource.activities.two_days_ago.count\n @data << resource.activities.one_day_ago.count\n #@data << Activity.today.count(:conditions=>['investigation_id = ?', id])\n \n #render :partial=>'spark', :locals=>{:data => @data}\n \n session[:return_to] = '/investigations/' [email protected]_param.to_s\n \n #debugger\n send_data(Sparklines.plot(\n @data,\n :type => 'smooth',\n :height=>20,\n :line_color=>'lightgrey',\n :underneath_color => 'lightgrey',\n :min => 0,\n :dot_values => true,\n :step => 10 \n \n ), \n :disposition => 'inline', \n :type => 'image/png', \n :filename => Date.today.to_s + \"-investigation-\" + @investigation.object_id.to_s + \"-sparkline.png\")\n \n \n \n end",
"title": ""
},
{
"docid": "09253fc54b7dbdff33c7d7bc6a3710fd",
"score": "0.521802",
"text": "def index\n @date_time = date_time\n @splitwises = Splitwise.analysis(@date_time)\n end",
"title": ""
},
{
"docid": "b972debf38aac27f9ae7c751ec1af00d",
"score": "0.5208788",
"text": "def average\nlift_Average = @@all.map do |lyft|\n lyft.lift_total\nend\nlift_Average.sum / lift_Average.size\nend",
"title": ""
},
{
"docid": "b1071d17bd505b25ad2f3fdfff2922a5",
"score": "0.52074677",
"text": "def average_predict_time\n\t\treturn @timmer/Float(@predict_call_count)\n\tend",
"title": ""
},
{
"docid": "89e415848f8c944ada75e9e2211631f1",
"score": "0.52033633",
"text": "def processing_times\n total = ab_output.match(/Total:\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)/)\n ninety = ab_output.match(/ 90%\\s+([0-9.]+)/)\n ninetyfive = ab_output.match(/ 95%\\s+([0-9.]+)/)\n [total[1], total[2], total[4], ninety[1], ninetyfive[1], total[5]]\n end",
"title": ""
},
{
"docid": "295ee8b43d332f2001b1fc906e4b3703",
"score": "0.5203174",
"text": "def set_statistic\n @statistic = Statistic.find(params[:id])\n @statistic.avg_time_on_site /= 60 # conversion seconde en mn\n end",
"title": ""
},
{
"docid": "aefdd23b236bb4b46d3b1385d8d29ef5",
"score": "0.51908004",
"text": "def average_queue_duration_by_hour\n gmt_offset = Time.now.getlocal.gmt_offset\n select = [\n \"EXTRACT(HOUR FROM contacts.arrived + '#{gmt_offset} seconds') AS hour\",\n 'AVG(EXTRACT(EPOCH FROM contacts.forwarded_to_agent - contacts.arrived)) AS avg_duration'\n ].join(',')\n data = answered_contacts.select(select).group('hour')\n\n result = Array.new(24, 0)\n data.each { |d| result[(d['hour'])] = d['avg_duration'].round }\n result\n end",
"title": ""
},
{
"docid": "4b27fadafa75dbedf6d19c978cccf11e",
"score": "0.5190364",
"text": "def sendData\n\t# List of all days\n\t@list_of_days = (1.month.ago.to_date...Date.today).to_a\n\t# New Array for graph\n\t@graph = Array.new\n\t# Set all dates to zero\n\t@list_of_days.each do |k|\n\t\t# Convert to useable date\n\t\tdate = k.to_date\n\t\t# Count all clicks/leads per day, per user\n\t\t@clicks = Click.complete_day(date).where(:user_id => current_user.id).count\n\t\t@leads = Lead.complete_day(date).where(:user_id => current_user.id).count\n\t\t# Add to array per day with clicks\n\t\t@graph << { y: date.strftime(\"%Y-%m-%d\"), click: @clicks, lead: @leads}\n\tend\n\t#Respond to JSON\n\trespond_to do |format|\n\t\tformat.json { render json: @graph }\n\tend\n end",
"title": ""
},
{
"docid": "7612a01389664bd25266a4ce8724293c",
"score": "0.5170334",
"text": "def time\n\n init_vars\n\n @pubnub.time(:callback => method(:set_output))\n render :text => @out\n\n end",
"title": ""
},
{
"docid": "3aba6b42e40aa5ad8594a973f25474b9",
"score": "0.5164612",
"text": "def stats\n @page_title = _('Destination_stats')\n @page_icon = \"chart_bar.png\"\n @destination = Destination.where(:id => params[:des_id]).first\n unless @destination\n flash[:notice]=_('Destination_was_not_found')\n redirect_to :controller => :callc, :action => :main and return false\n end\n change_date\n\n @html_flag = @direction.code\n @html_name = @direction.name\n @html_prefix_name = _('Prefix') + \" : \"\n @html_prefix = @destination.prefix\n\n @calls, @Calls_graph, @answered_calls, @no_answer_calls, @busy_calls, @failed_calls = Direction.get_calls_for_graph({:a1 => session_from_date, :a2 => session_till_date, :destination => @destination.prefix, :code => @direction.code})\n\n @sdate = Time.mktime(session[:year_from], session[:month_from], session[:day_from])\n\n year, month, day = last_day_month('till')\n @edate = Time.mktime(year, month, day)\n\n @a_date = []\n @a_calls = []\n @a_billsec = []\n @a_avg_billsec = []\n @a_calls2 = []\n @a_ars = []\n @a_ars2 = []\n\n @t_calls = 0\n @t_billsec = 0\n @t_avg_billsec = 0\n @t_normative = 0\n @t_norm_days = 0\n @t_avg_normative = 0\n\n i = 0\n while @sdate < @edate\n @a_date[i] = @sdate.strftime(\"%Y-%m-%d\")\n\n @a_calls[i] = 0\n @a_billsec[i] = 0\n @a_calls2[i] = 0\n\n sql =\"SELECT COUNT(calls.id) as \\'calls\\', SUM(calls.billsec) as \\'billsec\\' FROM destinations, directions, calls WHERE (destinations.direction_code = directions.code) AND (directions.code ='#{@direction.code}' ) AND (destinations.prefix = #{q(@destination.prefix)}) AND (destinations.prefix = calls.prefix) \"+\n \"AND calls.calldate BETWEEN '#{@a_date[i]} 00:00:00' AND '#{@a_date[i]} 23:23:59'\" +\n \"AND disposition = 'ANSWERED'\"\n res = ActiveRecord::Base.connection.select_all(sql)\n @a_calls[i] = res[0][\"calls\"].to_i\n @a_billsec[i] = res[0][\"billsec\"].to_i\n\n\n @a_avg_billsec[i] = 0\n @a_avg_billsec[i] = @a_billsec[i] / @a_calls[i] if @a_calls[i] > 0\n\n\n @t_calls += @a_calls[i]\n @t_billsec += @a_billsec[i]\n\n sqll =\"SELECT COUNT(calls.id) as \\'calls2\\' FROM destinations, directions, calls WHERE (destinations.direction_code = directions.code) AND (directions.code ='#{@direction.code}' ) AND (destinations.prefix = #{q(@destination.prefix)}) AND (destinations.prefix = calls.prefix) \"+\n \"AND calls.calldate BETWEEN '#{@a_date[i]} 00:00:00' AND '#{@a_date[i]} 23:23:59'\"\n res2 = ActiveRecord::Base.connection.select_all(sqll)\n @a_calls2[i] = res2[0][\"calls2\"].to_i\n\n @a_ars2[i] = (@a_calls[i].to_d / @a_calls2[i]) * 100 if @a_calls2[i] > 0\n @a_ars[i] = nice_number @a_ars2[i]\n @sdate += (60 * 60 * 24)\n i+=1\n end\n\n index = i\n\n @t_avg_billsec = @t_billsec / @t_calls if @t_calls > 0\n\n # Tariff and rate\n\n @rate = Rate.find(:all, :conditions => [\"destination_id=?\", @destination.id])\n\n @rate_details = []\n @rate1 = []\n @rate2 = []\n for rat in @rate\n if rat.tariff.purpose == \"provider\"\n @rate1[rat.id]=rat.tariff.name\n @rate_details[rat.id] = Ratedetail.find(:first, :conditions => [\"rate_id=?\", rat.id])\n else\n if rat.tariff.purpose == \"user_wholesale\"\n @rate2[rat.id]=rat.tariff.name\n @rate_details[rat.id] = Ratedetail.find(:first, :conditions => [\"rate_id=?\", rat.id])\n end\n end\n end\n\n #===== Graph=====================\n #formating graph for Calls\n\n ine=0\n @Calls_graph2 =\"\"\n while ine <= index - 1\n @Calls_graph2 +=@a_date[ine].to_s + \";\" + @a_calls[ine].to_s + \"\\\\n\"\n ine= ine + 1\n end\n\n #formating graph for Calltime\n\n i=0\n @Calltime_graph =\"\"\n for i in 0..@a_billsec.size-1\n @Calltime_graph +=@a_date[i].to_s + \";\" + (@a_billsec[i] / 60).to_s + \"\\\\n\"\n ine=ine +1\n end\n\n #formating graph for Avg.Calltime\n\n ine=0\n @Avg_Calltime_graph =\"\"\n while ine <= index - 1\n @Avg_Calltime_graph +=@a_date[ine].to_s + \";\" + @a_avg_billsec[ine].to_s + \"\\\\n\"\n ine=ine +1\n end\n\n #formating graph for Asr calls\n\n ine=0\n @Asr_graph =\"\"\n while ine <= index - 1\n @Asr_graph +=@a_date[ine].to_s + \";\" + @a_ars[ine].to_s + \"\\\\n\"\n ine=ine +1\n end\n\n end",
"title": ""
},
{
"docid": "5d6d640c7f4e8206eee593f58420f022",
"score": "0.51633734",
"text": "def index\n @student = Student.where(:usuario_id => @session_student.id).first\n @team = Team.where(:id => @student.team_id).first\n \n @sprints = Sprint.joins(:stories).where(:stories => {:project_id => @team.project_id})\n \n graphs = Array.new(@sprints.length)\n @charts = Array.new(@sprints.length)\n j=0\n @sprints.each do |s|\n date1 = s.fechainicio\n date2 = s.fechafin\n @as = (date1..date2).to_a\n @stories = Story.joins(:sprints).where(:sprints => {:id => s.id})\n task=0\n @stories.each do |st|\n @tasks = Task.where(:story_id => st.id)\n @tasks.each do |t|\n task += t.estimadoinicial\n end\n end\n graphs[j] = GoogleVisualr::DataTable.new\n graphs[j].new_column('string', 'Tiempo')\n graphs[j].new_column('number', 'Estimado inicial')\n graphs[j].new_column('number', 'Trabajo remanente')\n graphs[j].add_rows(@as.length)\n \n i=0\n work=0\n workt=0\n diff=0\n tot = task / Float(@as.length-1) \n [email protected]\n @as.each do |a|\n @stories.each do |st|\n @tasks = Task.where(:story_id => st.id)\n @tasks.each do |t|\n @works = Workdetail.where(\"task_id = ? AND fecha = ?\", t.id, a)\n @works.each do |w|\n work += w.hrsporterminar\n workt += w.hrstrabajadas\n end\n end\n end\n\n diff = work - workt\n graphs[j].set_cell(i, 0, a.to_s)\n if i == 0 \n graphs[j].set_cell(i, 1, task)\n suma = task + diff\n graphs[j].set_cell(i, 2, suma)\n elsif a == last \n graphs[j].set_cell(i, 1, 0)\n graphs[j].set_cell(i, 2, 0)\n else \n graphs[j].set_cell(i, 1, task-=tot)\n suma = task + diff\n graphs[j].set_cell(i, 2, suma) \n end\n i+=1\n work=0\n workt=0\n end\n opts = { :width => 600, :height => 400, :title => 'Burndown chart - ' + s.comentario, :colors => ['#3366cc', '#dc3912'], :legend => 'right',:backgroundColor => '#f5f5f5', :vAxis => {:title => \"Esfuerzo\"}, :hAxis => {:title => \"Tiempo\" } }\n @charts[j] = GoogleVisualr::Interactive::LineChart.new(graphs[j], opts)\n j+=1\n end\n \n \n\n \n\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charts }\n end\n end",
"title": ""
},
{
"docid": "7216276a465f81dbc84ddde11d394971",
"score": "0.5162867",
"text": "def show\n @tales=Tale.all.to_a\n @random_tale = @tales.sample\n if not @tale.nil?\n @time=((@tale.text.scan(/\\w+/).size)/200.to_f).ceil\n end\n end",
"title": ""
},
{
"docid": "8ede05e3881020b33cf82fe6cf81781d",
"score": "0.5161638",
"text": "def array_average arr\n arr_sum = 0.0\n\n arr.each do |num|\n arr_sum += num\n end\n\n arr_avg = arr_sum / arr.size\nend",
"title": ""
},
{
"docid": "a8240f3ab0e83b17aed9e5463b193c18",
"score": "0.51598436",
"text": "def index\n nb_days = 7\n start = nb_days.days.ago \n dates = [start.to_f] + Delay.all(:conditions => {:created_at => start..0.days.ago, :hospital_id => get_hospital.id}).map{|d| d.created_at.to_f}.reverse + [0.days.ago.to_f] # We add to additional nodes at the beginning and the end of the timespan\n dates2 = dates.map{|d| (d-start.to_f)/20}\n delays = Delay.all(:conditions => {:created_at => start..0.days.ago, :hospital_id => get_hospital.id}, :select => :minutes).map(&:minutes).reverse\n if delays.empty?\n delays2 = [0.0, 0.1]\n else\n delays2 = [delays[0]] + delays + [delays[-1]]\n end\n dates2 = dates2.collect { |d| d * delays2.max / dates2.max if dates2.max > 0 }\n data = [dates2, delays2]\n wdays = ['Sun', 'Sat', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n (0..Date.today.wday+1).each do |i|\n d = wdays.shift\n wdays.push(d)\n end\n @graph_url = Gchart.line_xy(:size => '500x300', \n :title => \"Last weeks waiting time\",\n :data => data,\n :axis_with_label => 'x,y',\n :axis_labels => [wdays.join('|')]\n )\n # We need some extra parameters for the graph axis that is not supported by Gchart...\n @graph_url = @graph_url + \"&chxt=x,y\"\n\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @delays }\n end\n end",
"title": ""
},
{
"docid": "79d86a931fea2a8f9aedd63ff5f67899",
"score": "0.5154953",
"text": "def index\n if params[:type] == \"t_webhooks\"\n redirect_to t_webhooks_path(:start_date => params[:start_date], :end_date => params[:end_date], :event => params[:event], \n :type => \"t_webhooks\") \n return\n end\n \n set_dates\n set_ip_list\n \n @count_array = []\n @this_event = params[:event] || \"unique_opened\"\n @event_list = [@this_event,\"sent\"]\n @esp_list = [\"gmail\",\"hotmail\",\"yahoo\",\"other\"]\n @esp_list.each_with_index do |esp, esp_index|\n @count_array[esp_index] = []\n 2.times do |j|\n @count_array[esp_index][j] = MWebhook.where(\"date_sent >= ? AND date_sent <= ?\", @start_date, @end_date)\n .send(esp).send(@event_list[j])\n .group('date_sent', 'sending_ip').count\n end\n end\n end",
"title": ""
},
{
"docid": "841dcdc39c3621b3716d90de74916fc9",
"score": "0.51531076",
"text": "def show\n\n trip = Trip.find(params[:id])\n\n departureOrder = LineStation.find_by_station_id(trip.departureStation_id).order\n arrivalOrder = LineStation.find_by_station_id(trip.arrivalStation_id).order\n\n lineStations = LineStation.where(:order => departureOrder..arrivalOrder)\n lineStations = lineStations.where(:line_id => trip.line_id)\n if departureOrder < arrivalOrder\n lineStations.order('order ASC')\n else\n lineStations.order('order DESC')\n end\n\n times = Array.new\n currentTime = trip.beginTime\n lineStations.each do |ls|\n \n station = Station.find(ls.station_id)\n train = Train.find(trip.train_id)\n\n times << { :station => station, :time => currentTime.strftime('%H:%M') }\n\n timeElapsed = ls.distance.to_f / train.velocity\n currentTime = currentTime + timeElapsed.hours\n end\n\n render :json => { :trip => trip, :times => times }\n\n end",
"title": ""
},
{
"docid": "907a6f4388ca03dfc6ab16c6cfc2b7e1",
"score": "0.515048",
"text": "def show\n @flows = Flow.where(device: @device).limit(10).order(id: :desc)\n\n# (bins, freq) = Flow.where(device: @device).pluck(:bytes_sent).histogram([0, 10, 100, 1000, 10000, 100000, 1000000]) \n bytes_sent = Flow.where(device: @device, state: :complete).pluck(:bytes_sent).select { |x| x >= 0 }\n bytes_received = Flow.where(device: @device, state: :complete).pluck(:bytes_received).select { |x| x >= 0 }\n (bins, sent_freq) = bytes_sent.histogram(20, other_sets: [ bytes_received ])\n (bins, rcvd_freq) = bytes_received.histogram(bins)\n\n# str_bins = bins.map do |bin| number_with_precision(bin, :precision => 0, :delimiter => ',') end\n str_bins = bins\n\n @size_data_sent = Hash[str_bins.zip(sent_freq)]\n \n @size_data_received = Hash[str_bins.zip(rcvd_freq)]\n\n most_recent = Flow.where(device: @device, state: :complete).last\n if most_recent\n samples = Flow.where(device: @device, state: :complete).where(\"timestamp < ?\", most_recent.timestamp - 1.day)\n sent = samples.pluck(:bytes_sent)\n received = samples.pluck(:bytes_received)\n timestamps = samples.pluck(:timestamp)\n @time_data_sent = Hash[timestamps.zip(sent)]\n @time_data_received = Hash[timestamps.zip(received)]\n else\n @time_data_sent = {}\n @time_data_received = {}\n end\n\n @destinations = Flow.where(device: @device).pluck(:dst_ip).uniq.sort\n end",
"title": ""
},
{
"docid": "2c0c6d2c01492be70d3a8462da924af3",
"score": "0.51445603",
"text": "def index\n if params[:start_time]\n @rough_movs = RoughMovement.where(\"time >= ?\", params[:start_time].to_f).order(\"time\")\n else\n @rough_movs = RoughMovement.order(\"time\")\n end\n\n @rough_movs = @rough_movs.each_slice([@rough_movs.size, 2000].max/2000).map(&:first)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @rough_movs }\n format.json { render :content_type => 'application/json' }\n end\n end",
"title": ""
},
{
"docid": "45c33d99f8899dffde22c07697ced017",
"score": "0.51258093",
"text": "def index\n require 'str_to_hash'\n\n timelist = {}\n for num in 0..24 do\n timelist.store(num,0)\n end\n\n gon.timelist = timelist\n @LoginUser = User.find_by(add_hash: session[:user_hash])\n #@t = @LoginUser.UserDrink.Dirnk.find_by(10)\n #@users = User.all\n @drinks = Drink.all.limit(5)\n @userDrinkLog = @LoginUser.user_drinks.all\n # @userDrinkLog = @LoginUser.user_drinks.where(created_at:today)\n userweight = @LoginUser.weght\n gon.userCaffeinDayMax = userweight * 5.7\n gon.userCaffeinOneTimeMax = userweight * 3\n safeline = userweight * 3\n today = 0.day.ago.all_day\n yesterday =1.day.ago.all_day\n #drinkdata = @LoginUser.user_drinks.all.where(created_at:today)\n drinkdata = @userDrinkLog.order(created_at:\"DESC\").where(created_at:today)\n @todaylog = drinkdata\n #gon.drinkdata = drinkdata.all\n puts \"-----------DataCheck---------------\"\n sentdata = Hash.new({})\n dataList = []\n i =0;\n drinkdata.each do |driData|\n sentdata[i][\"timeh\"] = driData.created_at.strftime(\"%H\")\n sentdata[i][\"name\"] = driData.drink.name\n sentdata[i][\"cafeinamount\"] = driData.drink.cafeinamount\n #------jsで記述したカフェインの代謝計算-------\n maxtime = sentdata[i][\"timeh\"].to_i\n setcafeMAX = sentdata[i][\"cafeinamount\"]+timelist[maxtime+1]\n\n setcafehalf =setcafeMAX/2\n dec1h = setcafehalf/6\n passh = 1\n boo = true\n while boo do\n over24 = maxtime+passh\n if over24 > 24\n break\n end\n\n if passh==1\n timelist[maxtime+1] = setcafeMAX\n passh += 1\n\n elsif passh >1 && passh < 6 && timelist[maxtime+passh]>= 0\n set = timelist[maxtime+passh-1]-dec1h\n timelist[maxtime+passh] = set\n passh += 1\n\n else timelist[maxtime+passh]>=0\n set = timelist[maxtime+passh-1]-dec1h/2\n timelist[maxtime+passh] = set\n\n if timelist[maxtime+passh]<0\n timelist[maxtime+passh] =0\n break\n end\n passh +=1\n end\n end\n #timelist[maxtime+1] += setcafeMAX/\n kakunin1 = sentdata[i].to_s\n dataList.push(kakunin1.to_h)\n i+=1\n end\n\n #@D103 = Drink.find_by(id:104)\n gon.drinkdataset = dataList\n #puts drinkdata.drink.name\n #gon.name_list=Drink.find(10);\n # testLog = DateTime.now.to_s(:time)\n #gon.testLog.to_s(:time)\n testLog = DateTime.now\n nowstrh = testLog.strftime(\"%H\")\n gon.testLogHour = nowstrh\n nowinth = nowstrh.to_i\n poor = safeline-timelist[nowinth+1]\n gon.poor = poor\n @num = poor\n end",
"title": ""
},
{
"docid": "57a52d66fd08df545ac44465ef6c766d",
"score": "0.5125434",
"text": "def userAvgCalculator\n\t\t\ttotal = 0\t\t\t\t\t\t\t\t\t# Initial total prayers\n\t\t\t# Loop through each all the Day prayers\n\t\t\[email protected] do |day|\n\t\t\t\ttotal += 1 if day[:fajr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:zuhr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:asr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:maghrib] == 2\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:isha] == 2\t\t\t# Add one to total if prayer performed\n\t\t\tend\n\t\t\t# Calculate how many days the user was requested for a response,\n\t\t\t# and the user responded and or the email was deactivated\n\t\t\tavg = (total / @timesRequestSent.to_f).round(2) # Calculate the average\n\t\tend",
"title": ""
},
{
"docid": "b566c5d7114df28c67312a140179cadd",
"score": "0.5123465",
"text": "def performMeasurements()\n\n # Define the grid offsets\n grid = [];\n delta = (3.5/$freq.to_f * 1000.0)/2.0;\n max_deviation = delta * 4.0;\n\n pos = [];\n pos << 0.0;\n pos << max_deviation;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << delta;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << -delta;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << -max_deviation;\n grid << pos;\n\n pos = [];\n pos << -max_deviation;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << -delta;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << delta;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << max_deviation;\n pos << 0.0;\n grid << pos;\n\n puts \"[start]\";\n puts \"Performing measurements for antennas #{getAntList(',')}\";\n\n # Initialize the hashmap of all the measurements.\n @ants.each do |a|\n @measurements[a.name] = [];\n end\n\n # First, perform the measurement for the detault offsets\n # Should already be tracking\n t = Time.new.localtime\n timeString = \"Current Time : \" + t.to_s\n `sleep 10`;\n\n puts \"Getting default center measurements\";\n @ants.each do |a|\n meas = Measurement.new(a.pmDefault);\n `sleep 12`;\n meas.setPwr(\"x\", a.getPwrAvg(\"x\").split(/\\s+/)[2]);\n meas.setPwr(\"y\", a.getPwrAvg(\"y\").split(/\\s+/)[2]);\n @measurements[a.name] << meas;\n\n begin\n file = File.open($defaultPMValuesFilename, \"a+\");\n if(timeString != nil)\n file.write(timeString + \"\\n\");\n timeString = nil;\n end\n file.write(a.name + \",\" + meas.to_s + \"\\n\") ;\n rescue IOError => e\n $stderr.puts \"Trouble saving default PM values: \" + e.to_s;\n exit(1);\n ensure\n file.close unless file.nil?\n end\n end\n\n # For testing, stop here and make sure the default PM values\n # were written to the file.\n #exit(0);\n\n # Offset the PM for each grid position, then get the power for that\n # position.\n grid.each_with_index do |g, i|\n x = g[0];\n y = g[1];\n puts \"\\nGrid position #{(i+1).to_s}, Offsetting PM #{g[0]},#{g[1]}\\n\";\n @ants.each do |a|\n a.offsetPm(x, y);\n end\n puts \"Tracking #{@targetName}\";\n track(@targetName);\n `sleep 5`;\n @ants.each do |a|\n #Commented out for testin\n meas = Measurement.new(a.offsetPM);\n `sleep 12`;\n meas.setPwr(\"x\", a.getPwrAvg(\"x\").split(/\\s+/)[2]);\n meas.setPwr(\"y\", a.getPwrAvg(\"y\").split(/\\s+/)[2]);\n @measurements[a.name] << meas;\n end\n end\n\n # Set PM back to default\n @ants.each do |a|\n a.offsetPm(0.0, 0.0);\n end\n\n\n puts \"Finished measurements for antennas #{getAntList(',')}\";\n puts \"[end]\";\n\n\n @ants.each do |a|\n # Get the Az/El of the antenna for reporting purposes\n azel = getAzEl(a.name);\n\n offsets_xy = Measurement.calcOffset(a.name, \"xy\", @measurements[a.name]);\n offsets_x = Measurement.calcOffset(a.name, \"x\", @measurements[a.name]);\n offsets_y = Measurement.calcOffset(a.name, \"y\", @measurements[a.name]);\n time1 = Time.new.localtime.to_s\n #1a,\n #Tue Jul 19 10:47:38 -0700 2016,\n #GPS-BIIR-11--PRN-19-,\n #205.643,59.481,\n #290.7950,77.7110,290.773043159548,77.3966612701321,0.0219568404518782,0.314338729867927\n #offset.az, offset.el, o2, o1, (o2.to_f - offset.az.to_f).abs(), (o1.to_f - offset.el.to_f).abs() \n str = a.name + \",\" + time1 + \",\" + $satName + \",\" + azel[0] + \",\" + azel[1] + \",\" + \n offsets_xy[0].to_s + \",\" + \n offsets_xy[1].to_s + \",\" + \n offsets_xy[2].to_s + \",\" + \n offsets_xy[3].to_s + \",\" + \n offsets_xy[4].to_s + \",\" + \n offsets_xy[5].to_s;\n fname = a.name + \".pnt\";\n File.open(fname, 'a+') {|f| f.write(str + \"\\n\") }\n\n str2 = a.name + \"\\n\";\n @measurements[a.name].each do |m|\n str2 = str2 + m.to_s + \"\\n\";\n end\n str2 = str2 + str + \"\\n\";\n File.open(\"allants.pnt\", 'a+') {|f| f.write(str2 + \"\\n\") }\n\n time1 = Time.new.localtime\n\n # Output the results to \"corr.pnt\"\n\n str3 = \"\\nant: \" + a.name; \n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Date: \" + time1.to_s;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Sat: \" + $satName; \n\n puts \" Elev X: \" + Measurement.getMeasString(\"el\", \"x\", @measurements[a.name]);\n puts \" Elev Y: \" + Measurement.getMeasString(\"el\", \"y\", @measurements[a.name]);\n puts \" Az X: \" + Measurement.getMeasString(\"az\", \"x\", @measurements[a.name]);\n puts \" Az Y: \" + Measurement.getMeasString(\"az\", \"y\", @measurements[a.name]);\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Elev X: \" + \n Measurement.getMeasString(\"el\", \"x\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Elev Y: \" + \n Measurement.getMeasString(\"el\", \"y\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Az X: \" + \n Measurement.getMeasString(\"az\", \"x\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Az Y: \" + \n Measurement.getMeasString(\"az\", \"y\", @measurements[a.name]) + \"\\n\") }\n\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Az/El: \" + azel[0].to_s + \" \" + azel[1].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Orig: \" + offsets_xy[0].to_s + \" \" + offsets_xy[1].to_s; \n puts str3;\n str3 = \" atasetpmoffsets --absolute #{a.name} #{offsets_xy[0].to_s} #{offsets_xy[1].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\\n\") }\n str3 = \" XY New: \" + offsets_xy[2].to_s + \" \" + offsets_xy[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" XY Diff: \" + offsets_xy[4].to_s + \" \" + offsets_xy[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_xy[2].to_s} #{offsets_xy[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n str3 = \" X New: \" + offsets_x[2].to_s + \" \" + offsets_x[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" X Diff: \" + offsets_x[4].to_s + \" \" + offsets_x[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_x[2].to_s} #{offsets_x[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n str3 = \" Y New: \" + offsets_y[2].to_s + \" \" + offsets_y[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Y Diff: \" + offsets_y[4].to_s + \" \" + offsets_y[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_y[2].to_s} #{offsets_y[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n end\n end",
"title": ""
},
{
"docid": "3d4cea8d916e8ac49b84ced8a2454451",
"score": "0.5122712",
"text": "def index\n @appfigures = self.appfigures\n @chartboost = self.chartboost\n #@money_spent = 0\n \n \n # @chartboost.sort_by {|day| day['Date']}.each do |key|\n # selected_date = key['Date'].to_s\n # money_spent = key['Money Spent'].scan(/[.0-9]/).join().to_f\n # money_earned = key['Money Earned'].scan(/[.0-9]/).join().to_f\n \n # profit = @appfigures[selected_date]['revenue'].to_f + money_earned - money_spent\n # profit = profit.to_s\n \n # p key['Date'] + ' Revenue: $' + @appfigures[selected_date]['revenue'] + ' Spent: '+ key['Money Spent'] + ' CB Rev: '+ key['Money Earned'] + ' Profit: $' + profit\n #end\n \n @appfigures.sort.each do |date, value|\n puts value['date'] + value['revenue']\n puts @chartboost[2]['Money Spent']\n end\n\n end",
"title": ""
},
{
"docid": "80ad8d435a361a2709fed890142e4681",
"score": "0.51155055",
"text": "def show\n @person = Person.find(params[:id])\n @sorted = @person.game_sets.sort_by &:date\n \n #Get individual game averages\n @games1 = []\n @games2 = []\n @games3 = []\n @total = []\n @person.game_sets.each do |game_set|\n @games1 << game_set.games[0]\n @games2 << game_set.games[1]\n @games3 << game_set.games[2]\n @total << game_set.total\n \n end\n @game1_avg = Calculate.avg(@games1)\n @game2_avg = Calculate.avg(@games2)\n @game3_avg = Calculate.avg(@games3)\n \n #Get total pins of all time\n @total_pins = Calculate.total(@total)\n end",
"title": ""
},
{
"docid": "60a217a24f7dff54ed1c0479c562b510",
"score": "0.51150304",
"text": "def index\n t_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n \n @trades_added = []\n # Add last trades\n Coin.all.each do |coin|\n pair = coin.pair.name\n model = set_model_name pair\n count_before = model.count\n \n add_trades pair\n \n count_after = model.count\n @trades_added << count_after - count_before\n end\n\n # Show collected trades\n @trades = []\n @pairs = []\n \n Coin.all.each do |coin|\n id = coin.pair.id\n @pairs[id] = coin.pair.name\n \n model = set_model_name @pairs[id]\n @trades[coin.pair.id] = model.where('timestamp >= ?', (Time.now - 1.day).to_i).order(tid: :desc) \n end\n\n t_finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n @time_elapsed = (t_finish - t_start).round(2)\n end",
"title": ""
},
{
"docid": "1abc04ca245bab9a74a88bd610c2a3fc",
"score": "0.5109667",
"text": "def current_weekly_average\n week_number = Time.now.yday / 7\n @cycling[2] = @cycling[0] / week_number\n @entertainment[2] = @entertainment[0] / week_number\n @programming[2] = @programming[0] / week_number\n @reading[2] = @reading[0] / week_number\n @yoga[2] = @yoga[0] / week_number\n end",
"title": ""
},
{
"docid": "3c2a62dab83504b680e4f6098d08f84d",
"score": "0.5108274",
"text": "def index\n period = params[:period]\n if period.present?\n if period == \"day\"\n @attribute_measures = @attribute.attribute_measures.where(\"created_at >= ?\", Date.today.beginning_of_day)\n elsif period == \"week\"\n #@attribute_measures = @attribute.attribute_measures.where(created_at: Date.today.all_week)\n @attribute_measures = @attribute.attribute_measures.find_by_sql(\"SELECT created_at as created_at, ROUND(AVG(value),2) as value FROM attribute_measures WHERE (created_at BETWEEN '#{1.week.ago}' AND '#{Time.now}') GROUP BY date(created_at), hour(created_at)\")\n elsif period == \"month\"\n #@attribute_measures = @attribute.attribute_measures.where(created_at: Date.today.all_month)\n @attribute_measures = @attribute.attribute_measures.find_by_sql(\"SELECT created_at as created_at, ROUND(AVG(value),2) as value FROM attribute_measures WHERE (created_at BETWEEN '#{1.month.ago}' AND '#{Time.now}') GROUP BY date(created_at)\")\n elsif period == \"year\"\n #@attribute_measures = @attribute.attribute_measures.where(:created_at => Date.today.all_year).order(:created_at).group(\"date(created_at)\").average(:value)\n @attribute_measures = @attribute.attribute_measures.find_by_sql(\"SELECT created_at as created_at, ROUND(AVG(value),2) as value FROM attribute_measures WHERE (created_at BETWEEN '#{1.year.ago}' AND '#{Time.now}') GROUP BY date(created_at)\")\n else\n @attribute_measures = @attribute.attribute_measures.all\n end\n else\n @attribute_measures = @attribute.attribute_measures.all\n end\n\n render json: @attribute_measures.to_json(only:[:value,:created_at])\n end",
"title": ""
},
{
"docid": "10f925f8f986ed6cabf35a85302396f9",
"score": "0.510196",
"text": "def running_average; end",
"title": ""
},
{
"docid": "07780e50efaa75540d62ce31b1a1d771",
"score": "0.51011574",
"text": "def index\n @user_history_records = UserHistoryRecord.all\n num_on_time_by_day = UserHistoryRecord.group_by_day(:arrival, format: \"%B %d, %Y\").where(:on_time => true).count\n total_by_day = UserHistoryRecord.group_by_day(:arrival, format: \"%B %d, %Y\").count\n @percent_on_time_by_day = num_on_time_by_day\n @percent_on_time_by_day.each do |key, record|\n if record != 0\n @percent_on_time_by_day[key] = record / total_by_day[key].to_f\n end\n end\n\n user_on_time = UserHistoryRecord.group(:uuid).where(:on_time => true).count\n user_late = UserHistoryRecord.group(:uuid).where(:on_time => false).count\n @group_by_user = [{:name => 'On Time', :data => user_on_time}, {:name => 'Late', :data => user_late}]\n\n end",
"title": ""
},
{
"docid": "476c6fe89f2da964ffcd8a7b64d299d3",
"score": "0.50831646",
"text": "def index\n @feedbacks = Feedback.all\n @topics = Topic.all\n\n for topic in @topics\n if @topicstats\n @topicstats = @topicstats + [[FeedbackItem.where(:topic_id => topic.id).sum(:position).to_f / @feedbacks.length, FeedbackItem.where(:topic_id => topic.id).sum(:percentage).to_f / @feedbacks.length, topic.id]]\n else\n @topicstats = [[FeedbackItem.where(:topic_id => topic.id).sum(:position).to_f / @feedbacks.length, FeedbackItem.where(:topic_id => topic.id).sum(:percentage).to_f / @feedbacks.length, topic.id]]\n end \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feedbacks }\n end\n end",
"title": ""
},
{
"docid": "ef6bffe900192e82fe5e4b251fe76996",
"score": "0.50808805",
"text": "def report_data\n EnergyConsume.average_temperature_timeline.each_with_object([]) do |data, report|\n year, month, temperature = data\n item = {\n name: \"#{year}/#{month}\",\n temperature: temperature.round(1).to_s,\n }\n report << item\n end\n end",
"title": ""
},
{
"docid": "b3693dc7689299da7272f419615354de",
"score": "0.50762194",
"text": "def avg_time_lap\n times = []\n self.voltas.each { |lap_num, lap_stat| times << time_in_ms(lap_stat[:tempo])}\n return ms_to_min(get_avg(times))\n end",
"title": ""
},
{
"docid": "25b139d03faa5398c96ee8a54b5874a0",
"score": "0.5075469",
"text": "def avg\n only_with('avg', 'DateTime', 'Numeric')\n itms = items.compact\n size = itms.size.to_d\n if type == 'DateTime'\n avg_jd = itms.map(&:jd).sum / size\n DateTime.jd(avg_jd)\n else\n itms.sum / size\n end\n end",
"title": ""
},
{
"docid": "390188680c6ca97d2bad5505728eb615",
"score": "0.50723493",
"text": "def index\n @cars_count = Car.count\n \n @cars = Car.select(\"car_id, price_daily, price_weekly, price_hourly\").to_a\n \n @cars_average_price_daily = if @cars_count > 0\n (@cars.map{|car| car.price_daily}.inject(0.0) { |sum, el| sum + el } / @cars.size).to_i\n else\n 0\n end\n @cars_average_price_weekly = if @cars_count > 0\n (@cars.map{|car| car.price_weekly}.inject(0.0) { |sum, el| sum + el } / @cars.size).to_i\n else\n 0\n end\n @cars_average_price_hourly = if @cars_count > 0\n (@cars.map{|car| car.price_hourly}.inject(0.0) { |sum, el| sum + el } / @cars.size).to_i\n else\n 0\n end\n \n puts @cars_average_price_weekly\n puts @cars_average_price_daily\n puts @cars_average_price_hourly\n end",
"title": ""
},
{
"docid": "5a27e4f053befafc7c61cd5c520e41c0",
"score": "0.5071899",
"text": "def update_averages\n\n # Calculate the timestamps for the averages related to this metrics\n # timestamp.\n timestamp_5m = timestamp.floor(5.minutes)\n timestamp_1h = timestamp.change(:min => 0)\n timestamp_1d = timestamp.beginning_of_day\n timestamp_1w = timestamp.beginning_of_week\n\n # Write the averages using an upsert with $inc so we just increment the\n # value of any pre-defined average for the timespan, or create them if\n # they don't exist.\n conditions = { :node_id => node_id, :path => path }\n value = {\n '$set' => { :node_id => node_id, :path => path },\n '$inc' => { :total => counter, :count => 1 }\n }\n\n # Write the averages for the last 5 minutes.\n conditions_5m = conditions.merge(:timestamp => timestamp_5m)\n value_5m = value.merge('$set' => { :timestamp => timestamp_5m })\n Sherlock::Models::MetricAvg5m.collection.update(conditions_5m, value_5m, :upsert => true)\n calculate_metric_average(Sherlock::Models::MetricAvg5m, node_id, path, timestamp_5m)\n\n # Write the averages for the last hour.\n conditions_1h = conditions.merge(:timestamp => timestamp_1h)\n value_1h = value.merge('$set' => { :timestamp => timestamp_1h })\n Sherlock::Models::MetricAvg1h.collection.update(conditions_1h, value_1h, :upsert => true)\n calculate_metric_average(Sherlock::Models::MetricAvg1h, node_id, path, timestamp_1h)\n\n # Write the averages for the last day.\n conditions_1d = conditions.merge(:timestamp => timestamp_1d)\n value_1d = value.merge('$set' => { :timestamp => timestamp_1d })\n Sherlock::Models::MetricAvg1d.collection.update(conditions_1d, value_1d, :upsert => true)\n calculate_metric_average(Sherlock::Models::MetricAvg1d, node_id, path, timestamp_1d)\n \n # Write the averages for the last week.\n conditions_1w = conditions.merge(:timestamp => timestamp_1w)\n value_1w = value.merge('$set' => { :timestamp => timestamp_1w })\n Sherlock::Models::MetricAvg1w.collection.update(conditions_1w, value_1w, :upsert => true)\n calculate_metric_average(Sherlock::Models::MetricAvg1w, node_id, path, timestamp_1w)\n\n end",
"title": ""
},
{
"docid": "bff72aa075f485aba18be24b5cde07ec",
"score": "0.5068081",
"text": "def chart_times\n access_times = self.daily_requests.limit(10)\n access_times.map(&:times)\n end",
"title": ""
},
{
"docid": "7abfde5e78aba8fc2b952544dafa8462",
"score": "0.5066047",
"text": "def time_data column = \"calories\"\n return [] if !valid?\n return [] if ![\"calories\", \"fat\", \"carbs\", \"protein\"].include?(column)\n\n scope_multiplier = 1\n scope_multiplier = length_scope == \"week\" ? 7 : scope_multiplier\n scope_multiplier = length_scope == \"month\" ? 30 : scope_multiplier\n scope_multiplier = length_scope == \"year\" ? 360 : scope_multiplier\n\n last = num.to_i * scope_multiplier\n\n # First, we get the days\n days = FoodEntry.where(user_id: user_id)\n .group_by_day(:day_ts, default_value: 0, last: last)\n .sum(column)\n .to_a\n\n return days if length_scope == \"day\"\n\n # Group by the weeks\n if length_scope == \"week\"\n weeks = days.group_by_week() { |d| d[0] }\n return average_of weeks\n end\n\n # Group by months\n if length_scope == \"month\"\n months = days.group_by_month { |d| d[0] }\n return average_of months\n end\n\n # Group by year\n if length_scope == \"year\"\n years = days.group_by_year { |d| d[0] }\n return average_of years\n end\n\n return []\n end",
"title": ""
},
{
"docid": "00e67d5f910b8c006f1f435f96ea9868",
"score": "0.5064653",
"text": "def stock_picker_benchmarker number_of_runs, stock_array_size\n\tstart_time = Time.now\n\ttime_per_run = []\n\t\n\tnumber_of_runs.times do\n\t\tstock_input = Array.new(stock_array_size) { rand(1..20) }\n\t\tstart_iter = Time.now\n\n\t\t#p stock_picker(stock_input)\n\t\t\n\t\tend_iter \t= Time.now\n\t\ttime_per_run.push(end_iter - start_iter)\n\tend\n\n\tend_time = Time.now\n\ttotal_duration = end_time - start_time\n\taverage_time_per = time_per_run.inject(0.0) { |sum, el| sum + el} / time_per_run.size\n\n\tputs \"Number of Runs: #{number_of_runs}\"\n\tputs \"Number of Days for stock picker: #{stock_array_size}\"\n\tputs \"Total Duration of test: #{total_duration} ms\"\n\tputs \"Average time per run: #{average_time_per} ms\"\nend",
"title": ""
},
{
"docid": "35fa833eff08faa32edd1582b795449a",
"score": "0.506424",
"text": "def average numbers\n\nend",
"title": ""
},
{
"docid": "7a351c6c198ad21789ba160f2df4460e",
"score": "0.505105",
"text": "def get_series(current_hour)\n @series = []\n logs_per_hour = {}\n Array (00..23).each{|hour| logs_per_hour[hour] = [ServerLoad.new({:ram_usage => 0})]}\n \n Server.all.each { |server| \n logs_per_hour = logs_per_hour.merge!(ServerLoad.where(server_id: server.id, updated_at: (Time.now - 24.hours)..Time.now).group_by(&:hour))\n average_ram_per_hour = logs_per_hour.map { |_,array| (array.map(&:ram_usage).reduce(:+).to_f/ array.size).round(2) }\n \n @series.push({name: server.name, data: change_order(average_ram_per_hour, current_hour)})\n }\n @series\n end",
"title": ""
},
{
"docid": "2d6b3e9b4c756081cc84e2fa95c6927c",
"score": "0.50455827",
"text": "def index\n @players = Player.order(elo: :desc).to_a\n @group1 = @players.first(3)\n @group2 = @players.first(6) - @group1\n @group3 = @players - @group1 - @group2\n @all_elo = Event.all.inject([]){|s,e| s|=eval(e.elos).values}\n @min = @all_elo.min - 20\n @max = @all_elo.max + 20\n end",
"title": ""
},
{
"docid": "48a4e9fd380b6c879a0c862cb50dba13",
"score": "0.50447255",
"text": "def average_response_time\n (active_time / requests.to_f) * 1000\n end",
"title": ""
},
{
"docid": "cd60402c0cbeb479ab04d527258b2749",
"score": "0.50407165",
"text": "def mean(array)\n total = 0.0\n array.each do |value|\n total += value\n end\n total / array.size\nend",
"title": ""
},
{
"docid": "4b51c4d5bb0d7ec68f75b0546de10916",
"score": "0.5035978",
"text": "def times_sum\n time_sum = 0\n self.voltas.each { |lap_num, lap_stat| time_sum += time_in_ms(lap_stat[:tempo])}\n return time_sum\n end",
"title": ""
},
{
"docid": "618cf5b22dc218fb9d47f916318f1988",
"score": "0.5033705",
"text": "def average(array)\n average = array.sum / array.count\nend",
"title": ""
},
{
"docid": "e6a8fba4da54ebf8c8b041b738ce726c",
"score": "0.5033355",
"text": "def average(array)\n total = 0\n array.each do |number|\n total = total + number\n end\n total / array.size\nend",
"title": ""
},
{
"docid": "74f429ceadbfca6909e516ffdc2292d0",
"score": "0.5030931",
"text": "def index\n\t\tgon.metrics = []\n\n\t\t# Get the parameters from the UI, or use defaults.\n\t\tstart = to_epoch(get_param(:start))\n\t\tstop = to_epoch(get_param(:stop))\n\n\t\tstep = params[:step] || (stop - start).to_i / UI_DEFAULTS[:points]\n\t\tgon.start, gon.stop, gon.step = start, stop, step\n\n\t\tgon.clock = params[:clock] || UI_DEFAULTS[:clock]\n\n\t\tbase = obl_qs(:stop, {url: obl_qs(:start) })\n\t\tbase = chg_qs(:time, \"absolute\", {url: base})\n\n\t\tgon.base = base\n\t\n\n\t\t# Get all the metrics, and build up a javascript blob with their useful bits\n\t\tnew_metrics = que_qs(:metric)\n\t\tgon.metrics = []\n\t\t@metrics = []\n\n\t\tnew_metrics.each_with_index do |metric,i|\n\t\t\tm = Metric.new(metric)\n\t\t\t@metrics << m\n\n\t\t\tg = {}\n\t\t\tg[:id] = m.id\n\t\t\tg[:feed_base] = m.feed\n\t\t\tg[:live] = m.live?\n\t\t\tg[:title] = m.titleize\n\t\t\tg[:metadata] = m.metadata\n\t\t\tg[:sourceURL] = m.get_metric_url start, stop, step\n\t\t\tg[:removeURL] = \"javascript:removechart(\\\"#{metric}\\\", \\\"#{rem_qs(:metric, metric)}\\\")\"\n\t\t #\tg[:counter] = true if m.counter? ##TODO Incorporate vaultaire based metadata\n\n\t\t\tgon.metrics << g\n\t\tend\n\n\t\t@gon = gon\n\n\t\t# Validate the times before continuing on\n\t\tif stop < start\n\t\t\tflash.now[:error] = \"Start time has to be before stop time\"\n\t\t\treturn\n\t\tend\n\n\t\tif stop - start < UI_DEFAULTS[:points]\n\t\t\tflash.now[:error] = \"Time range must be at least #{UI_DEFAULTS[:points]} seconds apart.\"\n\t\t\treturn\n\t\tend\n\n\t\t# Everything should be ok from here on out\n\t\t@graph = get_param(:graph)\n\tend",
"title": ""
},
{
"docid": "bc9374e376d2313a30ab93e1f88dd1d6",
"score": "0.5025137",
"text": "def today\n\n\t\ttime = Time.zone.now.hour\n\t\tlogger.info \"hello\"\n\t\tdoc2 = Nokogiri::HTML(open('http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/past-24-hour-psi-readings'))\n\t\tarray = doc2.css('td').to_a\n\n\t\tarrayResult = Array.new\n\t\tarrayResult.push(array[32].content.strip)\n\t\tarrayResult.push(array[33].content.strip)\n\t\tarrayResult.push(array[34].content.strip)\n\t\tarrayResult.push(array[35].content.strip)\n\t\tarrayResult.push(array[36].content.strip)\n\t\tarrayResult.push(array[37].content.strip)\n\t\tarrayResult.push(array[38].content.strip)\n\t\tarrayResult.push(array[39].content.strip)\n\t\tarrayResult.push(array[40].content.strip)\n\t\tarrayResult.push(array[41].content.strip)\n\t\tarrayResult.push(array[42].content.strip)\n\t\tarrayResult.push(array[43].content.strip)\n\t\tarrayResult.push(array[58].content.strip)\n\n\t\tarrayResult.push(array[59].content.strip)\n\t\tarrayResult.push(array[60].content.strip)\n\t\tarrayResult.push(array[61].content.strip)\n\t\tarrayResult.push(array[62].content.strip)\n\t\tarrayResult.push(array[63].content.strip)\n\t\tarrayResult.push(array[64].content.strip)\n\t\tarrayResult.push(array[65].content.strip)\n\t\tarrayResult.push(array[66].content.strip)\n\t\tarrayResult.push(array[67].content.strip)\n\t\tarrayResult.push(array[68].content.strip)\n\t\tarrayResult.push(array[69].content.strip)\n\t\t\n\t\trender :json => arrayResult\n\tend",
"title": ""
},
{
"docid": "b47a841d7b42b6c9e24b14fd99998f25",
"score": "0.5022368",
"text": "def stats\n @stats = time_data Episode.all\n @cloud = word_cloud Episode.pluck(:title)\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Episode.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Episode.all, :hash) }\n end\n end",
"title": ""
},
{
"docid": "f787813e6ae2ce9af2a0e7b59b5c97c0",
"score": "0.5020905",
"text": "def average numbers\n\tb=[]\n\t\tsum = numbers.reduce [] do |total, number| \n\t\ttotal+number\n\t\tend \n\t\tb.push(sum/numbers.length)\n\t\treturn b\n\nend",
"title": ""
},
{
"docid": "9c22e8310e11d6e4aa3af967c0b73f40",
"score": "0.5015074",
"text": "def index\n @pulses = Pulse.all.order('updated_at DESC')\n respond_to do |format|\n format.html { }\n @pulses = @pulses.limit(10) \n items = @pulses.each_with_index.collect do |date, index|\n {\n id: date.id,\n index: index+1,\n pulse_rate: date.pulse_rate,\n pulse_time: date.created_at.strftime(\"%b %e, %l:%M %p\") \n } \n end \n format.json { render json: items} \n end\n\n end",
"title": ""
},
{
"docid": "d0e6b0e50ecce4aedc3bfcadcc0b4257",
"score": "0.50150454",
"text": "def weekdayAvgCalculator data\n\t\t\tdata.each do |key, value|\n\t\t\t\tif value[:count] == 0\n\t\t\t\t\tdata[key] = 0\n\t\t\t\telse\n\t\t\t\t\tavg = (value[:prayerCount] / value[:count].to_f).round(2)\n\t\t\t\t\tdata[key] = avg\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "541aada5e94f29081d64ee80353a493e",
"score": "0.5014951",
"text": "def measure(n=0)\n if n == 0\n start = Time.now\n yield\n end_time = Time.now\n total = end_time - start\n else\n start = Time.now\n n.times { yield }\n end_time =Time.now\n total = end_time - start\n avg = total / n\n end\nend",
"title": ""
},
{
"docid": "4f446132bcbd795ac978f9f792e26090",
"score": "0.5005393",
"text": "def total_average #gets correct answers array length, all answers array length, passes them into caluculate_average method, and returns average\n correct_answers = self.correct_answers.length #length of correct_answers array for this user instance\n all_answers = Answer.all.where(user_id: self).length #length of all answers array for this user instance\n average = calculate_average(correct_answers, all_answers) #uses calculate average method below to get average percentage of questions answerted correctly\n\n end",
"title": ""
},
{
"docid": "c05707e58f4e8395931fc514697b1884",
"score": "0.50032026",
"text": "def line\n\n# Taking from the query parameter that was passed in from the HTML after'?' and converting it to integer:\n prev_total = params[:total].to_i\n\n# Count the total documents in the database now:\n curr_total = Cache.count\n\n# Calculating the difference in the number of documents after both counts:\n new_documents = curr_total - prev_total\n\n# Setting both original and collamine data to 0 \n original, collamine = 0, 0\n\n# If the difference of the both counts are 0, (which means no documents had been added within the time frame)\n if new_documents > 0\n\n# Sort the documents in cache by date and convert to an array\n documents = Cache.desc(:created_at).limit(new_documents).to_a\n\n# Loop through the array and see which ones are collamine / original\n documents.each do |document|\n original = original + 1 if document.source == \"original\"\n collamine = collamine + 1 if document.source == \"collamine\"\n end \n end\n\n# Returns the value of time as an integer:\n time = Time.now.to_i\n\n# Render json data containing time for x axis, count for y axis for updating the line chart:\n render :json => [{time: time, y: original},{time: time, y: collamine}]\n end",
"title": ""
},
{
"docid": "ab16740a42d3447b4249a1552fd49adc",
"score": "0.49996686",
"text": "def index\n @stats = Stat.all\n\n render json: {data:\n @stats.map {|stat|\n days = range_to_days(stat)\n {\n total_seconds: stat.total_seconds,\n human_readable_total: humanize(stat.total_seconds),\n daily_average: stat.daily_average,\n human_readable_daily_average: humanize(stat.daily_average),\n range: stat.range,\n holidays: stat.holidays,\n days_including_holidays: days,\n days_minus_holidays: days - stat.holidays,\n status: stat.status,\n is_already_updating: stat.is_already_updating,\n is_stuck: stat.is_stuck,\n is_up_to_date: stat.is_up_to_date,\n timeout: stat.timeout,\n editors: stat.editors.map {|e|\n {\n name: e.name,\n total_seconds: e.total_seconds,\n percent: e.percent\n }\n }\n }\n }}\n end",
"title": ""
},
{
"docid": "da62018ade5a13b72d7d91be236df0aa",
"score": "0.49923673",
"text": "def generateValue()\n for player in @skater_data\n player.push(0)\n end\n for goalie in @goalie_data\n goalie.push(0)\n end\n indexs = [6,7,8,9,10,11]\n dStats = []\n fStats = []\n for index in indexs\n dStats = getAveragesForStat(index,@skater_data,\"0\")\n fStats = getAveragesForStat(index,@skater_data,\"1\")\n addStat(@skater_data,dStats,\"0\",index)\n addStat(@skater_data,fStats,\"1\",index)\n end\n indexs = [6,7,9,11,12]\n gStats = []\n for index in indexs\n gStats = getAveragesForStat(index,@goalie_data,\"G\")\n addStat(@goalie_data,gStats,\"G\",index)\n end\n \nend",
"title": ""
}
] |
8aed6663777697a289291e53bdf6bea5
|
Form for editing a post
|
[
{
"docid": "ec472c33666c69983401c6a806af5273",
"score": "0.8163907",
"text": "def edit\n\t\t@post = Post.find(params[:id])\n\tend",
"title": ""
}
] |
[
{
"docid": "7ab66614f674b28122c671c826f08e96",
"score": "0.8734354",
"text": "def edit # Show a specific post within an HTML form.\n # Empty, since the @post object is loaded by way of a before filter.\n end",
"title": ""
},
{
"docid": "7ea4f759e0ab15a49817f46b73c31041",
"score": "0.8305773",
"text": "def edit #display the edit post form /posts/:id/edit\n end",
"title": ""
},
{
"docid": "3b05266fca1d378fc7277b614c2f422c",
"score": "0.8299893",
"text": "def edit\n ready_form(@post)\n end",
"title": ""
},
{
"docid": "022a4d1bc94f2ef7474f0dba5b255969",
"score": "0.822361",
"text": "def edit\n\t\t@post = Post.find_by_id(params[:post_id])\n\tend",
"title": ""
},
{
"docid": "e5bd17ebfe01118c92c898f51f08c0b1",
"score": "0.82060677",
"text": "def edit\n \n #get post specified by id\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "b8fb79b10241a83aca3d353296a26c34",
"score": "0.8198722",
"text": "def edit \n\t\trender 'shared/_post_form'\n\tend",
"title": ""
},
{
"docid": "10526f26831797a6594f328546149ed2",
"score": "0.8155934",
"text": "def edit\n @post = Post.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "444a2e453bf6d6287a52ac39c5ee84a2",
"score": "0.81419116",
"text": "def edit \n\t\t@post = Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "de5f69ba8968a9120aa110b848a1fb99",
"score": "0.81296897",
"text": "def edit\n\t @post = Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "de5f69ba8968a9120aa110b848a1fb99",
"score": "0.81296897",
"text": "def edit\n\t @post = Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "de5f69ba8968a9120aa110b848a1fb99",
"score": "0.81296897",
"text": "def edit\n\t @post = Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "af7ea30c22ef06c993d5cdcab1464b4a",
"score": "0.80633515",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "af7ea30c22ef06c993d5cdcab1464b4a",
"score": "0.80633515",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "af7ea30c22ef06c993d5cdcab1464b4a",
"score": "0.80633515",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "1c047dd0c0a27435f5ca89e64f957a0e",
"score": "0.8056189",
"text": "def edit #this needs a view for typing data\n # @post = Post.find(params[\"id\"])\n\n end",
"title": ""
},
{
"docid": "149f789f71699182b90dc6289d069b03",
"score": "0.8014586",
"text": "def post_edit\n @post = Post.find(params[:id])\n @plink = Post.permalink(@post[0])\n @tags = Tag.find(:all, :order => 'name asc')\n @authors = Author.find(:all, :order => 'name asc')\n @preview = (@post.body ? @post.body : '') + (@post.extended ? @post.extended : '')\n $admin_page_title = 'Editing post'\n @onload = \"document.forms['post_form'].elements['post[title]'].focus()\"\n render :template => 'admin/posts/post_edit'\n end",
"title": ""
},
{
"docid": "af783d58d381704ce26b1f6271e6dbb4",
"score": "0.8013521",
"text": "def edit \n @post = Post.find(params[:id]) \n end",
"title": ""
},
{
"docid": "2d33b39962e01cd26fc4858fd9130b06",
"score": "0.8007845",
"text": "def edit\n \t@post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "56c90cf9e9ee4a12772b6870bd1592fb",
"score": "0.8001035",
"text": "def edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "e723ef7a1ba98d649f7b76a232fe0312",
"score": "0.7946379",
"text": "def edit\n @post = Post.edit(post_params)\n @post.save\n\n redirect_to @post\n end",
"title": ""
},
{
"docid": "ffb18491690025bddd92984aa80bbf9d",
"score": "0.79299796",
"text": "def edit\n # Same as show action, we need to find the specific post to edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "93a5604d642e017cd13e3e00fd27ea13",
"score": "0.7925979",
"text": "def edit # this needs a view for typing data\n\t# replaced by before action\n\t# @post = Post.find(params[\"id\"])\nend",
"title": ""
},
{
"docid": "1ef80456bc97c77843d9e88f60eaae04",
"score": "0.7846524",
"text": "def edit\n\n @post = Post.find(params[:post_id])\n\n return @post\n\n end",
"title": ""
},
{
"docid": "89139a4c4970b656c2ec1d01fd83b6e9",
"score": "0.7785784",
"text": "def edit\n \t@post = PostsService.findPostById(params[:id])\n end",
"title": ""
},
{
"docid": "fb82ecae00ae4e554b90c7c20a61e4c3",
"score": "0.7776792",
"text": "def edit\n @post =Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "3f2857a6df4f978a94afb03a70d00fed",
"score": "0.77660125",
"text": "def edit\n @post = Post.find(params[:id])\nend",
"title": ""
},
{
"docid": "71a4e34809dc8ce65d0cb89178b8fc74",
"score": "0.7765297",
"text": "def edit\n @post = Post.find(params[:id])\n render :edit\n end",
"title": ""
},
{
"docid": "3fc59ea3ffa1aa80bd5b9421f495ec82",
"score": "0.7686523",
"text": "def edit\n @post = Post.where(id: params[:id]).first\n end",
"title": ""
},
{
"docid": "e320e9c7d5cdb8b969290683a3174998",
"score": "0.761932",
"text": "def edit_form\n @post = Post.new(post_params)\n unless @post.valid?\n render :edit\n else\n redirect_to :action => \"update_confirm\", title: @post.title, description: @post.description, state: @post.status,id: @post.id\n end\n end",
"title": ""
},
{
"docid": "d05266a0f1f0c54a3687f72ea430444f",
"score": "0.7611265",
"text": "def edit\n if [email protected]?\n redirect_to @post, flash: { alert: \"Sorry! You can not edit your post.\" }\n end\n end",
"title": ""
},
{
"docid": "b8f2d20564c7fe964f52f3e7fce81e9a",
"score": "0.7557531",
"text": "def update\n\t\t# this finds the post that we want to edit\n\t\t@post = Post.find(params[:id])\n\t\t# we have the permit for title and body because we included them in the private method below \n\t\tif @post.update(params[:post].permit(:title, :body))\n\t\t\t# this redirects to the show page\n\t\t\tredirect_to @post\n\t\telse\n\t\t\t# edit form to show\n\t\t\trender 'edit'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d43dd09d08b5bd2ddcfc18849ca709",
"score": "0.75550514",
"text": "def edit\n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "8fb3ceaa0741bc6624e29897e7ee67a6",
"score": "0.75159085",
"text": "def edit \n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "8fb3ceaa0741bc6624e29897e7ee67a6",
"score": "0.75159085",
"text": "def edit \n @post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "b206fb532591cd4237f4283b5bfc7266",
"score": "0.7508174",
"text": "def edit\n\t\t# @user = User.find(params[:id])\n\t\t@post = Post.find(params[:id])\n\t\trender :edit\n\tend",
"title": ""
},
{
"docid": "f81e73cef57dc3e100433a4d4ba94b26",
"score": "0.75071317",
"text": "def edit\n # return an HTML form for editing a specific thing\n end",
"title": ""
},
{
"docid": "219a4dcddfd85157be2eb81c1edbfd67",
"score": "0.7434719",
"text": "def edit\n @post = Post.find_by(id:params[:id])\nend",
"title": ""
},
{
"docid": "13509c59af740b25348d3dad73a62af3",
"score": "0.73710644",
"text": "def editpost(params)\n db = getdb()\n db.results_as_hash = true\n db.execute(\"SELECT post_id, post_title, post_text, author_id FROM posts WHERE post_id = ?\", params[\"post_id\"])\n end",
"title": ""
},
{
"docid": "5f9e3f5637bc1c068ad7c2ec071c7588",
"score": "0.7358585",
"text": "def edit\n \t@post = Post.find(params[:id])\n @post.beer = Beer.find(params[:id])\n @post.brewery = Brewery.find(params[:id])\n @post.style = Style.find(params[:id])\n end",
"title": ""
},
{
"docid": "08ec02a3b77d998425274a71a9f42e7f",
"score": "0.7339803",
"text": "def edit\n # it will render a view to edit and update the post. The before_action will trigger the action to find\n # in the database the relevant post thanks to the URL hash\n # Again this action looks empty, but it’s not due to the before_action filter.\n end",
"title": ""
},
{
"docid": "ff5a6b7ee3c8533a0aa439f4b31f6055",
"score": "0.7332389",
"text": "def update\n #@post = Post.find(params[:id])\n if @post.update_attributes(params[:post])\n redirect_to posts_path\n else\n @title = \"Edit post #{@post}\"\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "73ab51cc33e4c7914565b9a40a4ad238",
"score": "0.72904557",
"text": "def edit\n @post = current_user.posts.find(params[:id])\n end",
"title": ""
},
{
"docid": "96ba605f8aecc3d63d04c76790e53ca5",
"score": "0.726776",
"text": "def update\n if @post.update(post_params)\n\t\t\tredirect_to post_path\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\n end",
"title": ""
},
{
"docid": "67d32eb5d3333ed95007d804ed9213c8",
"score": "0.72572637",
"text": "def edit_post(id, options={})\n @connection.post(\"/blog/#{name}/post/edit\", options.merge('id' => id)).response\n end",
"title": ""
},
{
"docid": "a128e82f49a1631987623e2e2983520f",
"score": "0.7255351",
"text": "def edit\n # prepare to edit blog post\n @blog_post = BlogPost.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "702c46ecb3c70a1d4e46046a25833a07",
"score": "0.7238589",
"text": "def edit\n end",
"title": ""
},
{
"docid": "364fb23023d4b4087a39d3f35b446e3d",
"score": "0.7215858",
"text": "def update\n if @post.update(post_params)\n redirect_to root_path\n else\n render :edit \n end\n end",
"title": ""
},
{
"docid": "f4ff1066848679932c3afb2ffbb63d65",
"score": "0.7186835",
"text": "def edit\n @post = Post.find(params[:post_id])\n @tag = Tag.find(params[:id])\n end",
"title": ""
},
{
"docid": "26e9478a691062d61ab7ff81726d8d2d",
"score": "0.7179772",
"text": "def edit\n @blog_post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "26e9478a691062d61ab7ff81726d8d2d",
"score": "0.7179772",
"text": "def edit\n @blog_post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "26e9478a691062d61ab7ff81726d8d2d",
"score": "0.7179772",
"text": "def edit\n @blog_post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "26e9478a691062d61ab7ff81726d8d2d",
"score": "0.7179772",
"text": "def edit\n @blog_post = BlogPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "16729bc59a675c6a29beafe991952a1b",
"score": "0.71700066",
"text": "def update\n if @post.update(post_params)\n redirect_to post_path\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "2080b56ec72b3a6e025e6abb12e76a82",
"score": "0.7169117",
"text": "def update\n @post = Post.find(params[:id])\n # update a post and bring in previous post values\n if(@post.update(post_params))\n # show the edited post after it's successfully updated\n redirect_to @post\n else\n # if form validations do not pass, render the edit view again\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "e06da48c33cdd3ec93b61d7baff793aa",
"score": "0.7164033",
"text": "def update # Update a specific post.\n # Uses the form data from the edit form to\n # update the @post variable. The form data\n # will be in the params hash.\n \n # These three lines can be replaced with\n # update_attributes below.\n # @post.title = params[:post][:title]\n # @post.body = params[:post][:body]\n # if @post.save # Save back to the posts table in the db.\n \n if @post.update_attributes(params[:post])\n # If the validations pass and the post is saved,\n # redirect to the show action for this post.\n redirect_to :action => :show, :id => @post\n else\n # If the save fails, meaning the validations fail,\n # use the view associated with the edit action to\n # re-display the edit form for this @post.\n render :action => :edit\n end\n end",
"title": ""
},
{
"docid": "76eb60de6ad99de5bf45a29e24fdb2a7",
"score": "0.7158633",
"text": "def edit\n @current_tab = 'blog'\n @post = @service.posts.find(params[:id])\n @page_title = \"Blog :: Editando: #{@post.title}\"\n end",
"title": ""
},
{
"docid": "394370bce628d740ab5baa628df14724",
"score": "0.7158271",
"text": "def edit\n update\n end",
"title": ""
}
] |
833140a5350b86d29b043b6b5160018d
|
instance method that returns a Placing instance with its name set to name of the age group the racer will be compting in
|
[
{
"docid": "71aa3bc36ed78c8287b2ec8c5337e56c",
"score": "0.71928954",
"text": "def get_group racer\n if racer && racer.birth_year && racer.gender\n #determin age as of Jan 1 on year of race; put racer in group rounded down to nearest 10 and up\n #to nearest9s; masters is 60+\n quotient=(date.year-racer.birth_year)/10\n min_age=quotient*10\n max_age=((quotient+1)*10)-1\n gender=racer.gender\n name=min_age >= 60 ? \"masters #{gender}\" : \"#{min_age} to #{max_age} (#{gender})\" #text format of groups\n Placing.demongoize(:name=>name)\n end\nend",
"title": ""
}
] |
[
{
"docid": "e75c77de4ca7f34cbdb42bb061a2fb38",
"score": "0.7415583",
"text": "def get_group racer\n if racer && racer.birth_year && racer.gender\n quotient = (date.year-racer.birth_year)/10\n min_age = quotient*10\n max_age = ((quotient+1)*10)-1\n gender = racer.gender\n name = min_age >= 60 ? \"masters #{gender}\" : \"#{min_age} to #{max_age} (#{gender})\"\n Placing.demongoize(:name=>name)\n end\n end",
"title": ""
},
{
"docid": "41f6256198153c714cb056f940fe2beb",
"score": "0.63015515",
"text": "def assign_age_group(age)\n if age < 18\n return \"kid\"\n elsif age > 64\n return \"senior\"\n else\n return \"adult\"\n end\nend",
"title": ""
},
{
"docid": "f3c042aebcf255c01878b14a36e9b832",
"score": "0.59957284",
"text": "def age_group\n return @age_group\n end",
"title": ""
},
{
"docid": "acdfc317e911d8da16926909692e4534",
"score": "0.56776005",
"text": "def age_group\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9ce7f450b6840fb8a30d76d98e326954",
"score": "0.5641363",
"text": "def name\n I18n.t(@age_group, scope: :\"models.age_group\")\n end",
"title": ""
},
{
"docid": "ca493e118b99291389e355f86f6e1385",
"score": "0.5497222",
"text": "def group_resource\n titles = %w( winter spring summer autumn )\n @group_resource ||= GroupResource.find_or_create(\"mentors_#{titles[quarter_code-1]}#{year}\")\n end",
"title": ""
},
{
"docid": "f02020788661c4f7b77a3c84502a2153",
"score": "0.5488542",
"text": "def set_name\n self.group_name = self.group.fullname if self.group_type == \"Volunteer\"\n self.group_name = self.group.name if self.group_type == \"Assoc\"\n self.group_name = self.group.title if self.group_type == \"Event\"\n end",
"title": ""
},
{
"docid": "e43e93e65f43ad43e4ed1ade2d70f6e4",
"score": "0.54848504",
"text": "def age_group(age)\n case age\n when 0..17 then \"kid\"\n when 18..64 then \"adult\"\n else \"senior\"\n end\nend",
"title": ""
},
{
"docid": "672d33a9fca2e8de78e928bbb5f92334",
"score": "0.5474826",
"text": "def age_group=(value)\n @age_group = value\n end",
"title": ""
},
{
"docid": "e83dce1fa622c65af5bbabd622de8e72",
"score": "0.5467821",
"text": "def age_group\n return @data['age_group']\n end",
"title": ""
},
{
"docid": "729b29583e7d28e7765051d36dcf9ce9",
"score": "0.5419317",
"text": "def age_groups(age)\n case age\n when 0..17 then 'kid'\n when 18..64 then 'adult'\n else 'senior'\n end\nend",
"title": ""
},
{
"docid": "29c1ee3af8515ecf1359721fe7ba094d",
"score": "0.54097223",
"text": "def get_new_named_planet(name)\n name = nil if name.strip.length < 1 || invalid_name?(name)\n new_planet_info = [\n # sets planet_name to name if name contains at least one character\n !name.nil? ? name.strip : get_string_attribute(\"name\"),\n get_string_attribute(\"location\"), # initial_location\n get_int_attribute(\"distance from Sun in km\", 0), # initial_distance_from_sun\n get_float_attribute(\"year length\"), # initial_year\n get_int_attribute(\"diameter\", 1), # initial_diameter\n get_float_attribute(\"mass in kg\"), # initial_mass\n get_int_attribute(\"number of moons\", 0) # initial_number_of_moons\n ]\n return Planet.new(*new_planet_info)\nend",
"title": ""
},
{
"docid": "62c5b74fab52ca065469c4f5650a56b5",
"score": "0.53995186",
"text": "def assign_name\n if self.score_session && self.round_format\n self.name = create_name\n end\n# binding.pry # update 3 round validation\n# binding.pry # new 6 round validation\n end",
"title": ""
},
{
"docid": "52e627e4b653e151edc662f747d75b50",
"score": "0.5383727",
"text": "def id\n @age_group\n end",
"title": ""
},
{
"docid": "1d554ad228d8dd96beee54c4afe2f93b",
"score": "0.5373643",
"text": "def gn_named_place(placename)\n \n id = uuid(placename[:ident]) # @todo check if placename id is uuid or uri \n latitude = placename[:latitude] || placename[:north] || 0.0\n longitude = placename[:longitude] || placename[:east] || 0.0\n #altitude = placename[:altitude] || placename[:height] || 0.0\n published = placename.key?(:published) ? placename[:published] : placename[:created]\n\n # gn:NamedPlace \n named_place = node \"gn:NamedPlace\" \n named_place[\"gml:id\"] = \"placename-#{id}\"\n \n # gn:beginLifespanVersion\n begin_lifespan_version = node \"gn:beginLifespanVersion\"\n begin_lifespan_version.content = published\n named_place.add_child(begin_lifespan_version)\n \n # gn:geometry \n geometry = node \"gn:geometry\"\n \n point = node \"gml:Point\"\n point[\"gml:id\"] = \"point-#{id}\"\n \n # EPSG:4936 = 3D; EPSG:4258 = 2D, both [ETRS89](http://en.wikipedia.org/wiki/European_Terrestrial_Reference_System_1989)\n # EPSG:4326 = [WGS84](http://en.wikipedia.org/wiki/World_Geodetic_System#A_new_World_Geodetic_System:_WGS_84)\n point[\"srsName\"] = \"http://www.opengis.net/def/crs/EPSG/0/4936\"\n \n pos = node \"gml:pos\"\n pos.content = \"#{latitude} #{longitude}\"\n pos[\"srsDimension\"] = 2 #altitude != 0.0 ? \"3\" : \"2\"\n \n named_place.add_child(geometry)\n geometry.add_child(point)\n point.add_child(pos)\n \n # gn: inspireId\n inspire_id = node \"gn:inspireId\"\n named_place.add_child(inspire_id)\n \n identifier = node(\"base:Identifier\")\n inspire_id.add_child(identifier)\n\n local_id = node(\"base:localId\")\n local_id.content = id\n identifier.add_child(local_id)\n \n namespace = node \"base:namespace\"\n namespace.content = \"http://api.npolar.no/placename\" \n identifier.add_child(namespace)\n \n # gn:LocalType (2 nn/en)\n named_place.add_child(gn_local_type(\"nn\", placename[:terrain]))\n named_place.add_child(gn_local_type(\"en\", self.class.terrain(placename[:terrainid])))\n \n # gn:name (1..*)\n named_place.add_child(gn_name(placename))\n\n if placename[:approved]\n if not request[\"reject-nameStatus\"] == \"historical\"\n placenames_from_variants(placename).each do | variant |\n named_place.add_child(gn_name(variant))\n end\n end\n end\n \n # gn:type\n gn_type_node = node(\"gn:type\") \n gn_type_node.content = gn_type_value(placename)\n named_place.add_child(gn_type_node)\n \n named_place\n end",
"title": ""
},
{
"docid": "78eb154a6781d188843ec4f3a8a234fa",
"score": "0.5358715",
"text": "def find_or_create_group(name)\n found_groups = @groups.select { |group| group.name == name }\n if found_groups.length > 0\n found_groups[0]\n else\n new_group = ASEPalette::Group.new(name)\n @groups << new_group\n new_group\n end\n end",
"title": ""
},
{
"docid": "20de61781f08d34e61456e2c47f83f9c",
"score": "0.5337092",
"text": "def name\n \"#{self[:group]}\"\n end",
"title": ""
},
{
"docid": "955215805cc4caaca5887d88291efafd",
"score": "0.53306264",
"text": "def initialize name\n @gamer = name\n end",
"title": ""
},
{
"docid": "396f6ebd26490057561d10f80671ca1c",
"score": "0.53211576",
"text": "def face_name\r\n \"#{name} - #{clothing}\"\r\n end",
"title": ""
},
{
"docid": "8626c5a341dd8f3fc5424e921a46beaf",
"score": "0.5305427",
"text": "def create_guidance_group\n GuidanceGroup.create(name: self.abbreviation? ? self.abbreviation : self.name , org_id: self.id)\n end",
"title": ""
},
{
"docid": "614361b8fac2c9546d3593eedd90ec27",
"score": "0.5299742",
"text": "def name\n self.gender.name == \"Male\" ? gender = \"Men\" : gender = \"Women\" \n \"#{self.division.name}-#{self.age_class.name}-#{gender}\"\n end",
"title": ""
},
{
"docid": "3c7ba7f514037a3b924a314b1880a5d1",
"score": "0.5282669",
"text": "def age_group(age)\n case \n when 17 >= age && age >= 0\n return \"kid\"\n when 64 >= age && age >= 18\n return \"adult\"\n when age > 65\n return \"senior\"\n end\nend",
"title": ""
},
{
"docid": "2118a3b5206836517c758e94fa44a16f",
"score": "0.5265572",
"text": "def build_plate(pt)\r\n lumber = Lumber.new(fill_options(%w[style layer metric],\r\n 'depth' => length,\r\n 'origin' => pt,\r\n 'rotation' => 90.degrees,\r\n 'orientation' => FRONT))\r\n\tgroup = lumber.draw\r\n\t# print \"group = \" + group.to_s + \"\\n\"\r\n\treturn group\r\nend",
"title": ""
},
{
"docid": "9ddf929c680b9d6a3d9361025e9f4352",
"score": "0.52409726",
"text": "def new \n @group = Group.new\n end",
"title": ""
},
{
"docid": "3cdb7fe685a4e01e9e0803c1d51eeb7f",
"score": "0.52399075",
"text": "def set_garage\n @garage = Garage.friendly.find params[:name]\n end",
"title": ""
},
{
"docid": "1a09336b18292032a5b331a1b8bdae7c",
"score": "0.5234022",
"text": "def name\n \"Group #{id}\"\n end",
"title": ""
},
{
"docid": "466ca85fcfd3b62f57a8f0607b8120ea",
"score": "0.5220375",
"text": "def make_test_group(name_of_group, size_of_group, funds_per_person=50.0)\n peeps = []\n for index in 1..size_of_group\n peeps << Customer.new(\"Person#{index}\",\"\",funds_per_person)\n end\n group = Group.new(name_of_group)\n group.add_people(peeps)\n return group\nend",
"title": ""
},
{
"docid": "48e1fcbe9e499503bfa3bf4ee8e099af",
"score": "0.5220279",
"text": "def new\n workshop = Workshop.current.pluck(\"name\")\n @group = [[\"--选择省份--\"]]\n workshop.each do |name|\n @group << Group.current.where(:workshop_id => Workshop.current.find_by(:name => name).id).pluck(\"name\",\"id\")\n end\n gon.group_name = @group\n super\n end",
"title": ""
},
{
"docid": "90f2f2a1691cfcd1046274941b26b1bd",
"score": "0.52055764",
"text": "def assign_name\n if self.round && self.set_end_format\n self.name = create_name\n end\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.51974505",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "99d18471ba39d09f4ba272618bfcf3ec",
"score": "0.51870775",
"text": "def legal_age_group_classification\n return @legal_age_group_classification\n end",
"title": ""
},
{
"docid": "d7c6869ac57b6edb4b9ad5cbd7b1da48",
"score": "0.5179262",
"text": "def fix_name(name)\n if name\n if name.include?(\"Gamma\")\n return \"Gamma Group\"\n else\n return name\n end\n end\n end",
"title": ""
},
{
"docid": "a4f4b671cc5de8e9ce7a9dadd58c2e6f",
"score": "0.515733",
"text": "def age_group\n years = age.split(\"-\")\n return Range.new(years.first.to_f, (years.last.to_f + 0.99))\n end",
"title": ""
},
{
"docid": "0ab58bef644ac26810db16bb78e01705",
"score": "0.51443297",
"text": "def research_group_name\n name.left_name.right_name\nend",
"title": ""
},
{
"docid": "0ab58bef644ac26810db16bb78e01705",
"score": "0.51443297",
"text": "def research_group_name\n name.left_name.right_name\nend",
"title": ""
},
{
"docid": "d2e7c68d518588eff1908f7bd2a60b36",
"score": "0.51318914",
"text": "def initialize name\n @life = 3\n @name = name\n end",
"title": ""
},
{
"docid": "e845d2eed064f9efaee3532eb482c079",
"score": "0.510117",
"text": "def establish_assocation(name)\n case name\n when 'Competitors'\n if @inside_match\n @competitors = @match.competitors\n elsif @inside_tournament\n @competitors = @tournament.competitors\n elsif @inside_outright\n @competitors = @outright.competitors\n end\n when 'OutrightOdds'\n @outright.bet = @outrightodds\n when 'Bet'\n if @inside_match\n @match.bets << @bet\n end\n when 'Odds'\n if @inside_bet\n @bet.odds << @odds\n elsif @inside_outrightodds\n @outright.bet.odds << @odds\n end\n when 'Score'\n if @inside_match\n @match.scores << @score\n end\n when 'Goal'\n if @inside_match\n @match.goals << @goal\n end\n when 'Player'\n if @inside_goals\n @goal.player = @player\n elsif @inside_cards\n @card.player = @player\n end\n when 'Card'\n if @inside_match\n @match.cards << @card\n end\n when 'W'\n if @inside_match\n @match.bet_results << @w\n end\n when 'PR'\n if @inside_match\n @match.probabilities << @pr\n end\n when 'P'\n @pr.outcome_probabilities << @p\n when 'Texts'\n if @inside_competitors\n @competitors << @competitor\n end\n when 'Text'\n if @inside_eventname\n current_level_data.event_names << {}\n elsif @inside_competitors\n @competitors.last.names << {}\n else\n current_level_data.names << {} unless current_level_data == @match || current_level_data == @outright\n end\n when 'Result'\n if @inside_outrightresult\n @outright.bet_results << {}\n end\n when 'RoundInfo'\n if @inside_match\n @match.round = @roundinfo\n end\n when 'Value'\n end\n end",
"title": ""
},
{
"docid": "cc7ff7f0b97ef619f913eb29ba970d18",
"score": "0.50982827",
"text": "def name\n this_dogs_name\n end",
"title": ""
},
{
"docid": "ddef05ca4c887ed817efc53646e2fd0b",
"score": "0.5082924",
"text": "def round_name_and_year\n \"#{round_name} #{self.year}\"\n end",
"title": ""
},
{
"docid": "1aac6c3ffc000a73d112e374b078a64c",
"score": "0.5082754",
"text": "def new_guest #creates a new guest\n new_arrival = Guest.new(\"Tommy Amsterdam\", 1, 3)\n return new_arrival.name\nend",
"title": ""
},
{
"docid": "6f43600da29d0a947227be9e6f4d78d0",
"score": "0.5073922",
"text": "def name \n @this_dogs_name \n end",
"title": ""
},
{
"docid": "6dc97399a21906f2f2f24cbf211e99b6",
"score": "0.50736594",
"text": "def age\n if self[:adult]\n 'Adult'\n else\n 'Juvenile'\n end\n end",
"title": ""
},
{
"docid": "428dfd20450990bc1f16e3936bf4c227",
"score": "0.5072134",
"text": "def age!\n @age += 1\n if @age > 3\n #4 eggs objects are created into Array\n 4.times do\n new_egg = Egg.new\n @eggs << new_egg\n end\n end\n end",
"title": ""
},
{
"docid": "3794439583ed83c6cf6a4497da2a9675",
"score": "0.5067893",
"text": "def name_with_profession\n \"#{profession.name}: #{name}\"\n end",
"title": ""
},
{
"docid": "a76ad682dce4d8730eb2c12793440020",
"score": "0.5066988",
"text": "def name_by_birthyear(birthyear)\n generation = case birthyear\n when 1946..1963 then \"Baby Boomer\"#在ruby1.9中使用:而不是then是非法的\n when 1964..1976 then \"Generation X\"\n when 1978..2000 then \"Generation Y\"\n else nil\n end\n generation\nend",
"title": ""
},
{
"docid": "8f42a9b53966c74cb5f8206dbbb0c7e0",
"score": "0.5062102",
"text": "def groups\n @title = \"Grupos\"\n end",
"title": ""
},
{
"docid": "ca6a46b5011e8b4f2d9448592abbc903",
"score": "0.50514686",
"text": "def name\n @group.name\n end",
"title": ""
},
{
"docid": "cee2d5d7c828bcaccf80af52adddc76f",
"score": "0.50371575",
"text": "def create_group(name)\n return group = Group.create(name: name)\nend",
"title": ""
},
{
"docid": "4d9cb1634adf276dfa632f1000793ab9",
"score": "0.50288343",
"text": "def person_name\n PersonName.new(first, middle, last, nickname, suffix, honorific)\n end",
"title": ""
},
{
"docid": "27bc40243aa6756a4d43a2452885d282",
"score": "0.5016625",
"text": "def geotab_reference_name\n class_name = self.to_s.split(\"::\").last\n if GROUP_ENTITIES.include?(class_name)\n \"Group\"\n else\n class_name.gsub(\"Datum\", \"Data\")\n end\n end",
"title": ""
},
{
"docid": "85cde131c2e54870222891cabb9f7513",
"score": "0.5016539",
"text": "def initialize (name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "85cde131c2e54870222891cabb9f7513",
"score": "0.5016539",
"text": "def initialize (name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "01edf15b752841f0f5f74953cf5d8826",
"score": "0.5014623",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "1db0b6d09a19232d6be372f4adde2e99",
"score": "0.50111467",
"text": "def startgroup\n @group = Group.new\nend",
"title": ""
},
{
"docid": "64a82dbcfca83ac26c03c2f62e4d7cd5",
"score": "0.5009123",
"text": "def group_for_babysitting_date\n self.group.group_name\n end",
"title": ""
},
{
"docid": "8fe8323de5b0e39f6c112541df15f60c",
"score": "0.5002533",
"text": "def name \n @this_dogs_name\n end",
"title": ""
},
{
"docid": "8fe8323de5b0e39f6c112541df15f60c",
"score": "0.5002533",
"text": "def name \n @this_dogs_name\n end",
"title": ""
},
{
"docid": "4578c3b1416bd735ab8b67e6c7bc2d0c",
"score": "0.5001891",
"text": "def << group\n group.set_fleet @fleet.name\n end",
"title": ""
},
{
"docid": "2098c0f07ea3b74c7f38a2f13eb0d28c",
"score": "0.4997027",
"text": "def set_AgeGroup(value)\n set_input(\"AgeGroup\", value)\n end",
"title": ""
},
{
"docid": "037f1840987d8d0306592f08be240fc6",
"score": "0.4995013",
"text": "def name \n @this_dog_name\n end",
"title": ""
},
{
"docid": "b247f231d0eeeaf6b38262b5699e110a",
"score": "0.4988689",
"text": "def team_name\n team.name\n end",
"title": ""
},
{
"docid": "7aa97f02809da2020913fd9f54c3089d",
"score": "0.49855474",
"text": "def initialize(name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "7aa97f02809da2020913fd9f54c3089d",
"score": "0.49855474",
"text": "def initialize(name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "7aa97f02809da2020913fd9f54c3089d",
"score": "0.49855474",
"text": "def initialize(name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "7aa97f02809da2020913fd9f54c3089d",
"score": "0.49855474",
"text": "def initialize(name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.4983938",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.49837103",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.49837103",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "25e585a78ce91905f1156f82a6453f4b",
"score": "0.4981154",
"text": "def make_groups\n\tnumber_of_groups = ($cohort.size-1) / $ag_cap + 1\n\t$roster = Array.new(number_of_groups) {Array.new()} \n\twhile $cohort.size > 0\n\t\t$roster.map! {|team| team << $cohort.pop}\n\tend\nend",
"title": ""
},
{
"docid": "4aa8ac6e110f3e3f7ce9f036a99c4de3",
"score": "0.49793065",
"text": "def get_new_planet\n get_new_named_planet(\"\")\nend",
"title": ""
},
{
"docid": "dac771c7c6c28fd892f64a27b554eb9e",
"score": "0.49751306",
"text": "def group!( name )\n\t\t\tgroup = groups.find{|g| g.name == name}\n\t\t\tif group.nil?\n\t\t\t\tgroups << group = Group.new( name, [], [] )\n\t\t\tend\n\n\t\t\tgroup\n\t\tend",
"title": ""
},
{
"docid": "23f74b64b85d3d44d14955c2998bc53b",
"score": "0.49714303",
"text": "def initialize(name)\n @name = name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "33c25b35f483bee1f252122dbd2caffb",
"score": "0.49713162",
"text": "def modify_by_race\n\t\tif (@race.name == \"Human\")\n\t\t\t@name = HumanName.choosename(@m, @f, @n)\n\t\t\t#add racial bonuses\n\t\t\t@str += 1\n\t\t\t@dex += 1\n\t\t\t@con += 1\n\t\t\t@int += 1\n\t\t\t@wis += 1\n\t\t\t@cha += 1\n\t\t\t@age = rand(16..100)\n\t\t\tcalculate_height(rand(60..76))\n\t\t\t@weight = rand(125..250)\n\t\t#for the moment, there is only Mountain Dwarf. Mountain Dwarf is king.\n\t\telsif (@race.name == \"Dwarf\")\n\t\t\t@name = DwarfName.choosename(@m, @f, @n)\n\t\t\t@con += 2\n\t\t\t@str += 2\n\t\t\t#dwarves reach adulthood at 50 and live for about 350 years\n\t\t\t@age = rand(50..350)\n\t\t\tcalculate_height(rand(48..60))\n\t\t\t#dwarves are 4-5 feet tall and about 150 pounds\n\t\t\t@weight = 125 + rand(50)\n\t\t#high elf\n \t\telsif (@race.name == \"Elf\")\n\t\t\t@name = ElfName.choosename\n\t\t\t@dex += 2\n\t\t\t@int += 1\n\t\t\t@age = rand(100..750)\n\t\t\tcalculate_height(rand(52..62))\n\t\t\t@weight = rand(100..145)\t\t\t\n\t\tend #end if race\n\tend",
"title": ""
},
{
"docid": "4cf715ed27c138240b0c1d8cd1f3ee96",
"score": "0.49711922",
"text": "def initialize(name)\r\n\t\t@name = name\r\n\t\t@age = 1 + rand(50)\r\n\t\t@demeanor = \"happy\"\r\n\tend",
"title": ""
},
{
"docid": "2558407ee08881a32a0909c3074be52a",
"score": "0.49707606",
"text": "def initialize(name, age, number_pets)\n @name = name\n @age = age\n @number_pets = number_pets\n \tend",
"title": ""
},
{
"docid": "d108d2d274add6281cb66ce5640839eb",
"score": "0.4960091",
"text": "def generation\n # default is to return same world\n @age += 1\n self\n end",
"title": ""
},
{
"docid": "a3494f28217ba19df48f75fdc243da90",
"score": "0.49543074",
"text": "def name_factory; end",
"title": ""
},
{
"docid": "a3494f28217ba19df48f75fdc243da90",
"score": "0.49543074",
"text": "def name_factory; end",
"title": ""
},
{
"docid": "3ae11d456820d1dc5b840954b285bf63",
"score": "0.49529898",
"text": "def initialize name, shape\n\t\t@name = name\n\t\t@people = []\n\t\t@shape = shape\n\t\t@yearsold = 5000000000\n\tend",
"title": ""
},
{
"docid": "3329cb99ef03d43fa2aa4143b05cf9e1",
"score": "0.49427873",
"text": "def assign_name(team, typeOfPiece, pieceNumber = ' ')\n if team == 'White'\n return \"W-\" + typeOfPiece + \"#{pieceNumber}\"\n else\n return \"B-\" + typeOfPiece + \"#{pieceNumber}\"\n end\nend",
"title": ""
},
{
"docid": "c7414c6549839ed73d5ab3bcb35d1dd7",
"score": "0.49397275",
"text": "def construct name\n end",
"title": ""
},
{
"docid": "0a178b0232149796a5d578024ada8a8c",
"score": "0.49381363",
"text": "def name\n @this_dogs_name\n end",
"title": ""
},
{
"docid": "49d30359fe13c489c8abf1cd63d9aaf5",
"score": "0.49379578",
"text": "def return_age_group(age)\n case age\n when 0..17\n return \"kid\"\n when 18..64\n return \"adult\"\n when (65..)\n return \"senior\"\n else \n return \"Error! invalid age\"\n end\n \n #return \"kid\" if age < 18\n #return \"adult\" if age >= 18 && age < 65\n #return \"senior\" if age >= 65\n #\"error! Invalid age.\"\nend",
"title": ""
},
{
"docid": "5920d5b3765df66801fe86b02b34d0c9",
"score": "0.4936578",
"text": "def name \r\n @this_dogs_name\r\n end",
"title": ""
},
{
"docid": "9108f1278691f6f0c46f0d960a71e83f",
"score": "0.49289897",
"text": "def group_name\n\n \tGroup.find(object.group_id).nombre\n\n end",
"title": ""
}
] |
0b320c48aaaec72de3ee6015c7725ad0
|
here all actions on going to inactive plugin: plugin model
|
[
{
"docid": "26a8f1e3775bd008af3961019cbcedae",
"score": "0.7031107",
"text": "def my_plugin_on_inactive(plugin)\n end",
"title": ""
}
] |
[
{
"docid": "ffad02d76659a694c99b9fe8020eec4a",
"score": "0.6871397",
"text": "def ecc_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "858e2dc4adc53dfe29af2326c351109b",
"score": "0.6713424",
"text": "def my_plugin_on_active(plugin)\n end",
"title": ""
},
{
"docid": "edb933b4ebd8800530456783329ecc6a",
"score": "0.6707645",
"text": "def sample_menu_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "d05c81d3e2733afad20a0195c9ec9666",
"score": "0.6699141",
"text": "def ecommerce_on_inactive(plugin)\n\n end",
"title": ""
},
{
"docid": "cc287001e5b47b3b6e4b2c1b6b306c17",
"score": "0.6636891",
"text": "def hubspot_form_on_inactive(plugin)\n\n end",
"title": ""
},
{
"docid": "7de4e19910f5a3b2feb10b0db83833b5",
"score": "0.6532453",
"text": "def camaleon_mandrill_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "da74e7faa2263bdf5624569f4269d921",
"score": "0.6464336",
"text": "def vzaar_uploader_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "59d78c9cfa9ed5d4de4233f79f093122",
"score": "0.62756133",
"text": "def hubspot_form_on_active(plugin)\n\n end",
"title": ""
},
{
"docid": "1eb39a76eae04d619d85a0e838bfb01a",
"score": "0.6231091",
"text": "def plugins\n\n end",
"title": ""
},
{
"docid": "be9be78ae929a3d992d5912a8fcd0efc",
"score": "0.62299085",
"text": "def facebook_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "3a4e3403afc481406321c6983f5bbbf4",
"score": "0.6202119",
"text": "def cama_image_lightbox_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "8c33ab332847645a037fe87333e6a78d",
"score": "0.61380583",
"text": "def camaleon_user_tag_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "9200c243a0a97575b347f5f991fd0ed2",
"score": "0.61045885",
"text": "def social_shortcode_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "8cd464c8a8b3f63c21858f8a3774b9d4",
"score": "0.6091092",
"text": "def sample_menu_on_active(plugin)\n end",
"title": ""
},
{
"docid": "305bc507e0d78448fa086117f10b1896",
"score": "0.606875",
"text": "def tessitura_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "e94c8dd1b5ebc6e7369049c9a911a6bf",
"score": "0.60528004",
"text": "def inactive\n end",
"title": ""
},
{
"docid": "e94c8dd1b5ebc6e7369049c9a911a6bf",
"score": "0.60528004",
"text": "def inactive\n end",
"title": ""
},
{
"docid": "a3880b4f88022ed4deb9bab0d660385e",
"score": "0.59795636",
"text": "def cama_subscriber_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "46357003293a140b7c12d4bac38bfc81",
"score": "0.5892732",
"text": "def vzaar_uploader_on_active(plugin)\n end",
"title": ""
},
{
"docid": "c5207f4f2bbbfd14b175601a9ba085da",
"score": "0.585102",
"text": "def facebook_on_active(plugin)\n end",
"title": ""
},
{
"docid": "1874272c8725025602d0eb1a4da2b1f4",
"score": "0.5829989",
"text": "def plugin_id; end",
"title": ""
},
{
"docid": "8c81f58411d45584b974b60986432079",
"score": "0.5813395",
"text": "def index\n @plugin_instances = PluginInstance.where(plugin_id: params[:plugin_id]).order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "caabce3fd5013061e1298dee080f2194",
"score": "0.5778955",
"text": "def update\n super if self.active\n end",
"title": ""
},
{
"docid": "caabce3fd5013061e1298dee080f2194",
"score": "0.5778955",
"text": "def update\n super if self.active\n end",
"title": ""
},
{
"docid": "caabce3fd5013061e1298dee080f2194",
"score": "0.5778955",
"text": "def update\n super if self.active\n end",
"title": ""
},
{
"docid": "6c40f44e9174830517b72e6cb6e75081",
"score": "0.57730263",
"text": "def plugin_init; end",
"title": ""
},
{
"docid": "72fe44ca26942ac08efa7b4c06acaca3",
"score": "0.57604104",
"text": "def cama_image_lightbox_on_active(plugin)\n end",
"title": ""
},
{
"docid": "b058bf394b596c6d117c029b215353f5",
"score": "0.5754755",
"text": "def plugin_loaded\n end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.57525575",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.57525575",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.57525575",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.57525575",
"text": "def active; end",
"title": ""
},
{
"docid": "280c25f3699303b3136ffa056af38a44",
"score": "0.5741504",
"text": "def custom_plugins\n\tplugins\n end",
"title": ""
},
{
"docid": "7b4d7b5aaef527451279d84390b8ca70",
"score": "0.5741414",
"text": "def inhabilitar\n if @motive.inhabilitar!\n @motive.update(:user_updated_id => current_user.id)\n redirect_to motives_path , notice: I18n.t('motives.controller.disable')\n end\n end",
"title": ""
},
{
"docid": "7ecd3d6eee3646eb8966984da7f9af15",
"score": "0.57381624",
"text": "def add_plug_in\n user_plugin = UserPlugin.new\n user_plugin.user_id = current_user.id\n user_plugin.plugin_id = params[:id]\n user_plugin.save\n redirect_to \"/plugin_integration\"\n end",
"title": ""
},
{
"docid": "7ecd3d6eee3646eb8966984da7f9af15",
"score": "0.57381624",
"text": "def add_plug_in\n user_plugin = UserPlugin.new\n user_plugin.user_id = current_user.id\n user_plugin.plugin_id = params[:id]\n user_plugin.save\n redirect_to \"/plugin_integration\"\n end",
"title": ""
},
{
"docid": "56534779b5731a78025f5ced32019a04",
"score": "0.57328975",
"text": "def post_plugin\n @post_plugin\n end",
"title": ""
},
{
"docid": "4b135ff5573c0ef9f259fdbf474ef962",
"score": "0.5731214",
"text": "def index\n @plugin_instances = Locomotive::PluginInstance.all\n display @plugin_instance\n end",
"title": ""
},
{
"docid": "5c8245fc28c1ca82cb57cdc714faa656",
"score": "0.5725799",
"text": "def plugin_finalize; end",
"title": ""
},
{
"docid": "2adda34bf96effc3cd6843c32f03d402",
"score": "0.5725063",
"text": "def index\n @plugins = Plugin.all\n end",
"title": ""
},
{
"docid": "5e0af7dffaacc3da6ea6f024927dca68",
"score": "0.5723104",
"text": "def update\n # update only if actove\n super if self.active\n end",
"title": ""
},
{
"docid": "5e0af7dffaacc3da6ea6f024927dca68",
"score": "0.5723104",
"text": "def update\n # update only if actove\n super if self.active\n end",
"title": ""
},
{
"docid": "5e0af7dffaacc3da6ea6f024927dca68",
"score": "0.5723104",
"text": "def update\n # update only if actove\n super if self.active\n end",
"title": ""
},
{
"docid": "de16896df674d9996b64636c57994b09",
"score": "0.57118493",
"text": "def deactivate; end",
"title": ""
},
{
"docid": "de16896df674d9996b64636c57994b09",
"score": "0.57118493",
"text": "def deactivate; end",
"title": ""
},
{
"docid": "94015514487bd3f3840cf04469f1ca83",
"score": "0.5674007",
"text": "def social_shortcode_on_active(plugin)\n end",
"title": ""
},
{
"docid": "54f8bd32fc32621925e7000669857904",
"score": "0.5672456",
"text": "def cama_subscriber_on_active(plugin)\n end",
"title": ""
},
{
"docid": "56766340833fa89487ceaef8fe0faac9",
"score": "0.5659757",
"text": "def not_loadable_actions; end",
"title": ""
},
{
"docid": "b05302237fb91fa62a164b0fa203766b",
"score": "0.56553227",
"text": "def ecommerce_on_inactive(plugin)\n current_site.post_types.hidden_menu.where(slug: \"commerce\").first.destroy\n end",
"title": ""
},
{
"docid": "63591f9411dc13f72d9a787a6b73054d",
"score": "0.5643568",
"text": "def deactivate\n end",
"title": ""
},
{
"docid": "63591f9411dc13f72d9a787a6b73054d",
"score": "0.5643568",
"text": "def deactivate\n end",
"title": ""
},
{
"docid": "8ee99230fba9fe0f4f5a3b363665765f",
"score": "0.56415194",
"text": "def plugin_load; end",
"title": ""
},
{
"docid": "fa9a98992051fe20af4b500cf1e64937",
"score": "0.5635052",
"text": "def set_plugin\n @plugin = Plugin.find(params[:id])\n end",
"title": ""
},
{
"docid": "fa9a98992051fe20af4b500cf1e64937",
"score": "0.5635052",
"text": "def set_plugin\n @plugin = Plugin.find(params[:id])\n end",
"title": ""
},
{
"docid": "fa9a98992051fe20af4b500cf1e64937",
"score": "0.5635052",
"text": "def set_plugin\n @plugin = Plugin.find(params[:id])\n end",
"title": ""
},
{
"docid": "233d95d8385d8314279c4afe28f473da",
"score": "0.5633349",
"text": "def execute(ioController)\n # First check if this plugin already has a declared instance for the Root Tag\n lOldOptions = ioController.Options.clone\n lFound = false\n lRootTagID = ioController.getTagID(ioController.RootTag)\n if (ioController.Options[:intPluginsOptions][@PluginName] != nil)\n lIdx = 0\n ioController.Options[:intPluginsOptions][@PluginName].each do |ioInstancePluginInfo|\n iTagID, iActive, iOptions, iInstancesInfo = ioInstancePluginInfo\n if (iTagID == lRootTagID)\n # Found it\n lFound = true\n if (iActive)\n log_msg \"There is already an active view #{@PluginName}.\"\n lOldOptions = nil\n else\n # Make sure the list we will modify is cloned\n lOldOptions[:intPluginsOptions][@PluginName][lIdx] = ioInstancePluginInfo.clone\n ioController.Options[:intPluginsOptions][@PluginName][lIdx][1] = true\n end\n break\n end\n lIdx += 1\n end\n end\n if (!lFound)\n if (ioController.Options[:intPluginsOptions][@PluginName] == nil)\n ioController.Options[:intPluginsOptions][@PluginName] = []\n end\n # Make sure the list we will modify is cloned\n lOldOptions[:intPluginsOptions][@PluginName] = ioController.Options[:intPluginsOptions][@PluginName].clone\n # Create a new one\n ioController.accessIntegrationPlugin(@PluginName) do |iPlugin|\n ioController.Options[:intPluginsOptions][@PluginName] << [\n lRootTagID,\n true,\n iPlugin.getDefaultOptions,\n [ nil, nil ]\n ]\n end\n end\n if (lOldOptions != nil)\n ioController.notifyOptionsChanged(lOldOptions)\n end\n end",
"title": ""
},
{
"docid": "1f97724f61682e8723cfc052c0b6c663",
"score": "0.5593183",
"text": "def job_vacancy_on_inactive(plugin)\n current_site.post_types.hidden_menu.where(slug: \"job\").first.destroy\n\n end",
"title": ""
},
{
"docid": "51138e02d17c316b583d021b9e55ffc9",
"score": "0.5591553",
"text": "def list\r\n html = ''\r\n if @parent.session[:edit_mode] > 1 \r\n html << dc_link_for_create({ controller: 'cmsedit', table: 'dc_plugin', formname: 'dc_plugin_edit',\r\n title: t('dc_plugin.new_plugin', 'Create new plugin!'), target: 'iframe_edit' }) \r\n end\r\n plugins = DcPlugin.where(active: true).order_by('updated_at desc').page(@parent.params[:page]).per(10)\r\n html << @parent.render( partial: 'plugins/index', locals: { plugins: plugins }, formats: [:html] )\r\nend",
"title": ""
},
{
"docid": "943f83a7d7e40cfbefcb8c8af1916321",
"score": "0.55902123",
"text": "def camaleon_google_analytic_on_inactive(plugin)\n end",
"title": ""
},
{
"docid": "73a26dff5e8fa37457d4f72aa9d6a0c9",
"score": "0.55618906",
"text": "def camaleon_download_on_inactive(plugin)\n uninstall\n end",
"title": ""
},
{
"docid": "a7a7f5833ea83786edd4abdb02f1d369",
"score": "0.55578524",
"text": "def action_enable\n # TODO\n end",
"title": ""
},
{
"docid": "abe3c13037a9c3c5928175da8611d57f",
"score": "0.5551747",
"text": "def activate; end",
"title": ""
},
{
"docid": "abe3c13037a9c3c5928175da8611d57f",
"score": "0.5551747",
"text": "def activate; end",
"title": ""
},
{
"docid": "1e580d0410f8648ace97fba909a4402a",
"score": "0.5545962",
"text": "def activate\r\n end",
"title": ""
},
{
"docid": "cd4c731b8f1929ad1f8023641c5f6e94",
"score": "0.5507626",
"text": "def activate!; end",
"title": ""
},
{
"docid": "e490476edda6c572e42da044c2e84cc1",
"score": "0.5501974",
"text": "def plugin\n @plugin # FIXME: ||= Locomotive::Plugin.find_by_id(plugin_type)\n end",
"title": ""
},
{
"docid": "6694b148990ea08c8132d37387f8fad9",
"score": "0.54998964",
"text": "def all_plugins; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5498911",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5498911",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5498911",
"text": "def actions; end",
"title": ""
},
{
"docid": "e885afd03756f4c082e5452577fce2f0",
"score": "0.54851586",
"text": "def action(instance); end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.54786265",
"text": "def activate\n end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.54786265",
"text": "def activate\n end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.54786265",
"text": "def activate\n end",
"title": ""
},
{
"docid": "be60d38911d296224ab0d73278391c7e",
"score": "0.54784554",
"text": "def activate\n \n end",
"title": ""
},
{
"docid": "be60d38911d296224ab0d73278391c7e",
"score": "0.54784554",
"text": "def activate\n \n end",
"title": ""
},
{
"docid": "cb24806a1217c1c391a9cdcd6a541554",
"score": "0.54722834",
"text": "def action_disable\n # TODO\n end",
"title": ""
},
{
"docid": "def81aa9f72594aa32b4a2282f213b6a",
"score": "0.5471914",
"text": "def habilitar\n if @motive.habilitar!\n @motive.update(:user_updated_id => current_user.id)\n redirect_to motives_path , notice: I18n.t('motives.controller.enable')\n end\n end",
"title": ""
},
{
"docid": "07eaf8f50a1fcdb29e36e43011773478",
"score": "0.54576755",
"text": "def onActivateModel(model)\n end",
"title": ""
},
{
"docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2",
"score": "0.5457611",
"text": "def plugin_setup!; end",
"title": ""
},
{
"docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2",
"score": "0.5457611",
"text": "def plugin_setup!; end",
"title": ""
},
{
"docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2",
"score": "0.5457611",
"text": "def plugin_setup!; end",
"title": ""
},
{
"docid": "aff6f49f059806bb1314d4effa9dcfdf",
"score": "0.54566425",
"text": "def activate()\n\n end",
"title": ""
},
{
"docid": "e2a3d8100b54d08ab8fcf64c9932f70d",
"score": "0.5445013",
"text": "def plugins() = @plugins ||= {}",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.5444744",
"text": "def active?; end",
"title": ""
},
{
"docid": "f32e72f5460f822c27b31f19f2214d57",
"score": "0.54334724",
"text": "def load_plugins; end",
"title": ""
},
{
"docid": "f32e72f5460f822c27b31f19f2214d57",
"score": "0.54334724",
"text": "def load_plugins; end",
"title": ""
},
{
"docid": "8762d56956d9170f4f402b1bfe214f9b",
"score": "0.5424072",
"text": "def plugin_create_instance!\n true\n end",
"title": ""
},
{
"docid": "6cfc74ae3c5ee1c40d41272424730f6e",
"score": "0.54177386",
"text": "def plugin_hash; end",
"title": ""
},
{
"docid": "10274e7f41997349e26cef8a0e821eac",
"score": "0.54124135",
"text": "def sample_menu_on_upgrade(plugin)\n end",
"title": ""
},
{
"docid": "87814cf74d767e8b59bb790544905b77",
"score": "0.54100454",
"text": "def active!\n check_args\n super\n end",
"title": ""
},
{
"docid": "87814cf74d767e8b59bb790544905b77",
"score": "0.54100454",
"text": "def active!\n check_args\n super\n end",
"title": ""
},
{
"docid": "9dfb73472e78dd33cb4ccb0d910a5c0d",
"score": "0.5387992",
"text": "def ecc_on_upgrade(plugin)\n end",
"title": ""
}
] |
50237403552deb9d620278d2cc2a9a04
|
allow tests to overwrite this method so that we don't access the real api when running unit tests
|
[
{
"docid": "8c0659d85c208266bcda704ce7e45945",
"score": "0.0",
"text": "def create_video\n Yt::Video.new(id:(@video_id))\n end",
"title": ""
}
] |
[
{
"docid": "e223b6498b42a8245c5e113225590b5b",
"score": "0.69553053",
"text": "def api; end",
"title": ""
},
{
"docid": "e223b6498b42a8245c5e113225590b5b",
"score": "0.69553053",
"text": "def api; end",
"title": ""
},
{
"docid": "10718d42cac5d82a7c1d9e2550ce2f06",
"score": "0.6934589",
"text": "def api_only; end",
"title": ""
},
{
"docid": "10718d42cac5d82a7c1d9e2550ce2f06",
"score": "0.6934589",
"text": "def api_only; end",
"title": ""
},
{
"docid": "10718d42cac5d82a7c1d9e2550ce2f06",
"score": "0.6934589",
"text": "def api_only; end",
"title": ""
},
{
"docid": "927bc6f8e05860fb70fe95b0ae28bc97",
"score": "0.6860357",
"text": "def from_api?; false end",
"title": ""
},
{
"docid": "aced9ce2cec8c57662b4a6929f457c68",
"score": "0.6637608",
"text": "def new_api\n load_config\n require 'extensions/metasploit/extension.rb'\n @api = BeEF::Extension::Metasploit::RpcClient.instance\n @api.unit_test_init()\n end",
"title": ""
},
{
"docid": "093d12c638e21c4b1602e4e16fe1a625",
"score": "0.6628229",
"text": "def api_only=(_); end",
"title": ""
},
{
"docid": "13c36513e94184857ee2b0312f7ab1a4",
"score": "0.6519692",
"text": "def api\n @api\n end",
"title": ""
},
{
"docid": "4151def6ff4464fd239a58f0b16e02cf",
"score": "0.6380452",
"text": "def api\n # Should return an instance of the API instantiated \n # with the credentials passed into the initialized.\n # Raise an error to warn it isn't implemented.\n raise NotImplementedError.new \n end",
"title": ""
},
{
"docid": "92241de94a80d5d11161332f6a2ace15",
"score": "0.6376994",
"text": "def set_api_stub\n return @_api_stub if @_api_stub\n @_api_stub = Her::API.new\n allow(MnoEnterprise::BaseResource).to receive(:her_api).and_return(@_api_stub = Her::API.new)\n @_api_stub\n end",
"title": ""
},
{
"docid": "dcdffaa903b9384f2c8f0ac9f467c0b7",
"score": "0.6360476",
"text": "def fabricate_via_api!\n validate_reuse_preconditions\n\n resource_web_url(api_get)\n rescue Errors::ResourceNotFoundError\n super\n ensure\n self.class.resources[reuse_as] ||= {\n tests: Set.new,\n resource: self\n }\n\n self.class.resources[reuse_as][:attributes] ||= all_attributes.each_with_object({}) do |attribute_name, attributes|\n attributes[attribute_name] = instance_variable_get(\"@#{attribute_name}\")\n end\n self.class.resources[reuse_as][:tests] << Runtime::Example.location\n end",
"title": ""
},
{
"docid": "13cfbe50a73176f08b681f3684afe561",
"score": "0.6357071",
"text": "def apis; end",
"title": ""
},
{
"docid": "e3f919ef12baaa303d35c608315ed363",
"score": "0.6348656",
"text": "def initialize(api)\n @api = api\n end",
"title": ""
},
{
"docid": "35a51327dd0b5c9a884bb0e6f7155697",
"score": "0.6305363",
"text": "def testing\n # ...\n end",
"title": ""
},
{
"docid": "0c3b28294b0d27e9e02c03deb92de5f6",
"score": "0.63033754",
"text": "def hidden_apis; end",
"title": ""
},
{
"docid": "c05e9d65eccaca38aec84456202907ab",
"score": "0.62869877",
"text": "def test_authentication\n @api.test_authentication\n return\n end",
"title": ""
},
{
"docid": "52aeaf7a2e777a09322c8bf2cb27d136",
"score": "0.6265853",
"text": "def parent_api; end",
"title": ""
},
{
"docid": "52aeaf7a2e777a09322c8bf2cb27d136",
"score": "0.6265853",
"text": "def parent_api; end",
"title": ""
},
{
"docid": "d1fb503a873049b44780754ece8bbf3a",
"score": "0.6263915",
"text": "def test_api_create\n assert_nothing_raised do\n new_api\n end\n end",
"title": ""
},
{
"docid": "3aaa68cd8ecc624e36ded9d607808521",
"score": "0.61865026",
"text": "def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end",
"title": ""
},
{
"docid": "8c273c0642a2e035e7b1527af996e47f",
"score": "0.61623144",
"text": "def setup\n if @request.present?\n @request.env['HTTP_ACCEPT'] = 'application/json'\n @request.headers['x-api-key'] = 'some_api_key'\n end\n ActiveSupport::Cache::FileStore.any_instance.stubs(:read).returns(\"anandsai_auth\")\n end",
"title": ""
},
{
"docid": "c63214a71f6c847325525ae3ea759085",
"score": "0.61236846",
"text": "def test!\n @@api.post(endpoint: self.endpoint + ['test'])\n end",
"title": ""
},
{
"docid": "107fcb8a28d82e35e71a606658da5e14",
"score": "0.61114335",
"text": "def api_only=(_arg0); end",
"title": ""
},
{
"docid": "cceb736a16521cb27b41b9606f5944f7",
"score": "0.60941374",
"text": "def initialize\n self.api_root = BASE_URL\n end",
"title": ""
},
{
"docid": "84a9e3605c9df3bf615df5c21a793b98",
"score": "0.60914767",
"text": "def is_api?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "84a9e3605c9df3bf615df5c21a793b98",
"score": "0.60914767",
"text": "def is_api?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d562e717bf44292918fa14f228af7b96",
"score": "0.60725075",
"text": "def remove_via_api!\n QA::Runtime::Logger.debug(\"#{self.class.name} - deferring removal until after suite\")\n end",
"title": ""
},
{
"docid": "01cb644baa95c1b847ced0299b61b377",
"score": "0.60058993",
"text": "def test_api_call\n settings = Wovnrb.get_settings\n token = settings['project_token']\n url = 'wovn.io/dashboard'\n stub = stub_request(:get, \"#{settings['api_url']}?token=#{token}&url=#{url}\").\n to_return(:body => '{\"test_body\": \"a\"}')\n\n i = Wovnrb::Interceptor.new(get_app, settings)\n\n i.call(Wovnrb.get_env)\n assert_requested(stub, :times => 1)\n end",
"title": ""
},
{
"docid": "01cb644baa95c1b847ced0299b61b377",
"score": "0.60058993",
"text": "def test_api_call\n settings = Wovnrb.get_settings\n token = settings['project_token']\n url = 'wovn.io/dashboard'\n stub = stub_request(:get, \"#{settings['api_url']}?token=#{token}&url=#{url}\").\n to_return(:body => '{\"test_body\": \"a\"}')\n\n i = Wovnrb::Interceptor.new(get_app, settings)\n\n i.call(Wovnrb.get_env)\n assert_requested(stub, :times => 1)\n end",
"title": ""
},
{
"docid": "525bfb7eb245e4277cf7e723df898d4c",
"score": "0.5997446",
"text": "def api_error; end",
"title": ""
},
{
"docid": "232b25513091304a27f2747caac15538",
"score": "0.5978946",
"text": "def call_api\n @client.build_url\n @client.get\n assign_data\n end",
"title": ""
},
{
"docid": "058ff3e3636b86cfd801e4292ab79e40",
"score": "0.597633",
"text": "def api\n return @api\n end",
"title": ""
},
{
"docid": "27ebf9200adbd04f0a078da9c91fedc9",
"score": "0.5974029",
"text": "def api\n @config = ZipMoney::Configuration\n configure_api if @_api.nil?\n \t @_api\n end",
"title": ""
},
{
"docid": "d766a75b4214570768d2a62d813fb4fd",
"score": "0.5970053",
"text": "def api_url\n raise NotImplementedError, \"#{self.class} must implement #api_url!\"\n end",
"title": ""
},
{
"docid": "da998d80580073d6fc693542f2dc0ddb",
"score": "0.5955913",
"text": "def scryfall; ScryfallApi.new end",
"title": ""
},
{
"docid": "d21bbdea21bc1f1ffff727c5f0c25573",
"score": "0.59392494",
"text": "def is_api?\n false\n end",
"title": ""
},
{
"docid": "4efe9e824f33362a4fafd9e9770bcd18",
"score": "0.593919",
"text": "def api_stub_configure(api)\n # This block should match the her.rb initializer\n api.setup MnoEnterprise.send(:api_options).merge(url: \"http://localhost:65000\") do |c|\n # Request\n c.use Faraday::Request::BasicAuthentication, MnoEnterprise.tenant_id, MnoEnterprise.tenant_key\n c.use Faraday::Request::UrlEncoded\n\n # Response\n c.use Her::Middleware::MnoeApiV1ParseJson\n c.use Her::Middleware::MnoeRaiseError\n\n # Add stubs on the test adapter\n c.use MnoeFaradayTestAdapter do |receiver|\n @_stub_list.each do |key,stub|\n params = stub[:params] && stub[:params].any? ? \"?#{stub[:params].to_param}\" : \"\"\n path = \"#{stub[:path]}#{params}\"\n \n receiver.send(stub[:method] || :get,path) { |env|\n body = Rack::Utils.parse_nested_query(env.body)\n \n # respond_with takes a model in argument and automatically responds with\n # a json representation of the model\n # If the action is an update, it attempts to update the model\n if model = stub[:respond_with]\n model.assign_attributes(body['data']) if stub[:method] == :put && model.respond_to?(:assign_attributes) && body['data']\n resp = from_api(model)\n else\n if stub[:response].is_a?(Proc)\n args = stub[:response].arity > 0 ? [body] : []\n resp = stub[:response].call(*args)\n else\n resp = stub[:response] || {}\n end\n end\n \n # Response code\n if stub[:code].is_a?(Proc)\n args = stub[:code].arity > 0 ? [body] : []\n resp_code = stub[:code].call(*args)\n else\n resp_code = stub[:code] || 200\n end\n\n\n [resp_code, {}, resp.to_json]\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "69ee762ed673b1e6a9e726253794097f",
"score": "0.5936774",
"text": "def api_object\n unless $api\n $api = FyberAPI.new(\n 'b07a12df7d52e6c118e5d47d3f9e60135b109a1f',\n {\n appid: 157,\n format: 'json',\n device_id: '2b6f0cc904d137be2e1730235f5664094b83',\n locale: 'de',\n ip: '109.235.143.113'\n }\n )\n end\n $api\n end",
"title": ""
},
{
"docid": "e262b3c769c3a3eddb21c4324a600fd8",
"score": "0.5920984",
"text": "def test_login\n new_api\n assert(@api.login)\n end",
"title": ""
},
{
"docid": "2d1549aa0830877cf0ae649f8a0a72c7",
"score": "0.59188646",
"text": "def api_mode; end",
"title": ""
},
{
"docid": "912a2d1fd751bd752d0407c3d932a7b4",
"score": "0.5904744",
"text": "def restful_api\n @restful_api ||= AlephApi::RestfulApiClient.new(url: @restful_api_url)\n end",
"title": ""
},
{
"docid": "351e340b2a02e72f12fc85d26b2a02c3",
"score": "0.5897198",
"text": "def test_all\n assert_gets(\"/api/v2/#{api_class}?offset=0&limit=999\") { wf.all }\n end",
"title": ""
},
{
"docid": "0764b59efa7f1b6d2f97dd17a3154cbc",
"score": "0.58936846",
"text": "def api_endpoint\n @api_endpoint ||= ENDPOINTS[:sandbox][:api]\n end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.5891873",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.5891873",
"text": "def spec; end",
"title": ""
},
{
"docid": "026bcf8d03a13c57c0369eaedd2a727b",
"score": "0.5880522",
"text": "def test_firecloud_api_available\n # check that API is up\n api_available = @fire_cloud_client.api_available?\n assert [true, false].include?(api_available), 'Did not receive corret boolean response'\n end",
"title": ""
},
{
"docid": "5817dbcf228f3b8926f8fc7783265616",
"score": "0.58802927",
"text": "def setup\n RedmineContactsInvoices::TestCase.prepare\n\n @controller = ExpenseImportsController.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n \n User.current = nil \n end",
"title": ""
},
{
"docid": "909e9d525e0089d13c5b7764802e9921",
"score": "0.5875227",
"text": "def api\n @http ||= Http.new(config)\n end",
"title": ""
},
{
"docid": "0774985b235957b43e7f98c8530016dc",
"score": "0.58667904",
"text": "def api\n @api ||= WeatherApiCalls.new\n end",
"title": ""
},
{
"docid": "6bfcd1538673044a463f1edd7a1bd308",
"score": "0.5865759",
"text": "def api\n TaskMapper::Provider::Fogbugz.api\n end",
"title": ""
},
{
"docid": "6bfcd1538673044a463f1edd7a1bd308",
"score": "0.5865759",
"text": "def api\n TaskMapper::Provider::Fogbugz.api\n end",
"title": ""
},
{
"docid": "c36b2d1f5ca88b6864ccf44496d3c99f",
"score": "0.5853717",
"text": "def api_method\n ''\n end",
"title": ""
},
{
"docid": "365e5c6aa159034c4fe9d1276c9ebce4",
"score": "0.58506775",
"text": "def api_client\n self.class.api_client\n end",
"title": ""
},
{
"docid": "c18f83a27218d26a4fc1fe04d5744710",
"score": "0.5844549",
"text": "def stub_api_init(source_types:, tenants:, application_types: nil, applications:, topology_sources:)\n stub_api_source_types_get(:response => source_types)\n stub_api_applications_get(:response => applications)\n stub_api_application_types_get(:response => application_types) if application_types\n stub_api_tenants_get(tenants)\n stub_api_topology_sources_get(:response => topology_sources)\n end",
"title": ""
},
{
"docid": "791ee1e18deaf749948a8ceb5bef8dc7",
"score": "0.58442116",
"text": "def setup_api\n #\n @api = Api.new(current_user)\n\n #\n if white_listed?(path)\n return\n end\n\n #\n token = params[:token] || request.headers['X-Api-Token'] || request.headers['X-API-TOKEN']\n\n unless token.blank?\n user = nil\n token = Token.where(:kind => 'api', :uuid => token.to_s).first\n\n if token and token.context.is_a?(User)\n user = token.context\n end\n\n if user\n @api.user = user\n else\n render(:nothing => true, :status => :unauthorized)\n return\n end\n else\n email, password = http_basic_auth_info\n\n if !email.blank? and !password.blank?\n user = User.where(:email => email).first\n\n if user and user.password == password\n @api.user = user\n else\n headers['WWW-Authenticate'] = ('Basic realm=\"\"' % realm)\n render(:nothing => true, :status => :unauthorized)\n return\n end\n else\n if defined?(current_user) and current_user\n @api.user = current_user\n else\n @api.user = nil\n #headers['WWW-Authenticate'] = ('Basic realm=\"\"' % realm)\n #render(:nothing => true, :status => :unauthorized)\n #return\n end\n end\n end\n\n #\n unless @api.route?(@path) or @path == 'index'\n render :nothing => true, :status => 404\n end\n end",
"title": ""
},
{
"docid": "5bbbb1781544d09a842288aeac69ea8a",
"score": "0.58341795",
"text": "def stub_content_api_default_artefact\n stub_request(:get, %r{\\A#{CONTENT_API_ENDPOINT}/[a-z0-9-]+\\.json}).to_return { |request|\n slug = request.uri.path.split('/').last.chomp('.json')\n {:body => artefact_for_slug(slug).to_json}\n }\n end",
"title": ""
},
{
"docid": "ad21efe30c678e65d5a0eb2a5e13800a",
"score": "0.58306926",
"text": "def test_connection\n end",
"title": ""
},
{
"docid": "8f02de7f9d657ea96c5e01b3fc34b964",
"score": "0.5825828",
"text": "def test_should_create_project_via_API_JSON\r\n get \"/logout\"\r\n post \"/projects.json\", :api_key => 'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n project = JSON.parse(response.body)\r\n check_new_project(project) \r\n end",
"title": ""
},
{
"docid": "1a6186064d8218f9aa0c8b82bcc4fdae",
"score": "0.5815711",
"text": "def __dummy_test__\n end",
"title": ""
},
{
"docid": "d4b52727c6fe426a66b9e96126335e66",
"score": "0.58114696",
"text": "def set_api(*args); end",
"title": ""
},
{
"docid": "d4b52727c6fe426a66b9e96126335e66",
"score": "0.58114696",
"text": "def set_api(*args); end",
"title": ""
},
{
"docid": "30f137680fc05e40a1e8c48757a8f5ec",
"score": "0.5810977",
"text": "def mock_defective_auth_hash\n nil\n end",
"title": ""
},
{
"docid": "85352b825a85591269d0d3696ae0c01f",
"score": "0.5805292",
"text": "def test\n Srchio::Response.new(self.class.get(\"/test\"))\n end",
"title": ""
},
{
"docid": "69183812dabe6ebac3d8677793cde36c",
"score": "0.58003175",
"text": "def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end",
"title": ""
},
{
"docid": "233cba94795e798305a1dbd50942b879",
"score": "0.57935256",
"text": "def api\n @api ||= PrismicService.init_api\n end",
"title": ""
},
{
"docid": "1686df7fb55722b976904d4fce4a1d4c",
"score": "0.5791927",
"text": "def require_api_token\n end",
"title": ""
},
{
"docid": "253663384469fa7fc64cbd15ac27a1ca",
"score": "0.57905",
"text": "def test_api_request\r\n t = AuthorInfo.make_request(\"James_Joyce\")\r\n assert_equal(true, t.length > 0)\r\n end",
"title": ""
},
{
"docid": "38588ff2f06b4d3c4c4fb6a634b6abcc",
"score": "0.5785628",
"text": "def api\n TaskMapper::Provider::Fogbugz.api\n end",
"title": ""
},
{
"docid": "b4e258aa9c26c487d731d52b3e888082",
"score": "0.57598436",
"text": "def get(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "b1bc25a008d04f310835d6eb7f29ae79",
"score": "0.5757125",
"text": "def setup\n @controller = ImpasseTestCaseController.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n User.current = nil\n end",
"title": ""
},
{
"docid": "8d6bcbe2b8c2234d4e0cf2b1593d4b40",
"score": "0.5735725",
"text": "def initialize\n @api_user = \"\"\n @api_key = \"\"\n end",
"title": ""
},
{
"docid": "8904a35eaebd561a2664e46fb40358d3",
"score": "0.5734705",
"text": "def setup\n RedmineEvm::TestCase.prepare\n\n @controller = BaselinesController.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n User.current = nil\n end",
"title": ""
},
{
"docid": "75d81c13314ad29b21ae0babcf4e96c2",
"score": "0.57315993",
"text": "def api_location\n nil\n end",
"title": ""
},
{
"docid": "ce03ab9b0390770031a9a7a65676bb2f",
"score": "0.57295245",
"text": "def api_request?\n false\n end",
"title": ""
},
{
"docid": "ef2b47668c41eb64cebbe4b94c6152b4",
"score": "0.5728344",
"text": "def test_can_get_dev_by_api_key\n dev = Dav::Dev.get_by_api_key($dav_dev_auth, $testuser_dev[\"api_key\"])\n assert_equal($testuser_dev[\"secret_key\"], dev.secret_key)\n end",
"title": ""
},
{
"docid": "c9fd3a6b7cb4f923bb43db4ee1ff0668",
"score": "0.5725338",
"text": "def test_connection\n return ShopifyAPI::Shop.current\n end",
"title": ""
},
{
"docid": "e68024345c9d2eb6d0a01ffecc99dda8",
"score": "0.5712478",
"text": "def rest_endpoint; end",
"title": ""
},
{
"docid": "2b198e4eb0d519139c9882c58ff69b6f",
"score": "0.5708195",
"text": "def setup_api\n if white_listed?(path)\n @api = Api.new\n return\n end\n\n email, password = http_basic_auth_info\n\n if !email.blank? and !password.blank?\n user = User.find_by_email(email)\n if user.password == password\n @api = Api.new(user)\n else\n render(:nothing => true, :status => :unauthorized)\n return\n end\n else\n begin\n if current_user\n @api = Api.new(current_user)\n else\n render(:nothing => true, :status => :unauthorized)\n end\n rescue NameError\n @api = Api.new\n end\n end\n end",
"title": ""
},
{
"docid": "829a4b1a76779dc6888a47c523d13ecd",
"score": "0.5702024",
"text": "def open_api_spec\r\n OpenAPISpecController.instance\r\n end",
"title": ""
},
{
"docid": "3c15c67b00dfdcc384590417a314271b",
"score": "0.56960064",
"text": "def testing_api_request(id)\n fixture = File.read(File.expand_path(\"../fixtures/api_response.json\", __FILE__))\n stub_request(:get, \"https://favro.com/api/v1/cards?cardSequentialId=#{id}&unique=true&limit=1\")\n .to_return(body: fixture, status: 200)\nend",
"title": ""
},
{
"docid": "bb9ff38f465d81360c2e3c4ab8f11131",
"score": "0.5689153",
"text": "def get_admin(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "78eb2999ec9cf1bda8bb610daf9288e6",
"score": "0.5688149",
"text": "def api_client\n @api_client ||= WildFly::ApiClient.new\n end",
"title": ""
},
{
"docid": "71ae7684e1fe16f817edafa603e6944e",
"score": "0.5682269",
"text": "def api\n @api ||= Battlenet.new(:eu)\n end",
"title": ""
},
{
"docid": "e27d8b321e885967b49a097b3a4fc4f9",
"score": "0.56754714",
"text": "def current_api_user\n @current_api_user ||= stub_model(User, email: \"[email protected]\")\n end",
"title": ""
},
{
"docid": "131d6841def1d9243ffb0cb5795752df",
"score": "0.5673993",
"text": "def test_invalid_api_key\n Prowl.any_instance.expects(:perform).returns(666)\n assert_equal 666, Prowl.add(:apikey => \"my api key\", :application => \"Fishes\", :event => \"Silly\", :description => \"Blah\")\n end",
"title": ""
},
{
"docid": "bd91307bac0f507f0e68d1ee894ae721",
"score": "0.5671071",
"text": "def can_use_api?\n api_enabled\n end",
"title": ""
},
{
"docid": "310d7ee9e089845d909f1688bad2d6c4",
"score": "0.5666139",
"text": "def hidden_apis=(_arg0); end",
"title": ""
},
{
"docid": "09e25c74d10819b23d9ee2da9c5a8b8f",
"score": "0.56646055",
"text": "def api\n self.well_info.api\n end",
"title": ""
},
{
"docid": "530e65cba197567f73b8125444ac33cc",
"score": "0.5661298",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "bc1e69b1945be97610b059516595450b",
"score": "0.56541336",
"text": "def initialize(api_url)\n\t\turi = URI(api_url)\n\t\tcall_api(uri)\n\tend",
"title": ""
},
{
"docid": "9e3bc6a0a9374baee62e3280c427c687",
"score": "0.5653889",
"text": "def initialize_api_endpoint\n if PrMigrator.configuration.github_enterprise_endpoint\n Octokit.configure do |c|\n c.api_endpoint = PrMigrator.configuration.github_enterprise_endpoint\n end\n end\n end",
"title": ""
},
{
"docid": "2973bf36bb2639457986e4b748b2ceda",
"score": "0.56410295",
"text": "def api_endpoint\n @api_endpoint ||= DEFAULT_API_ENDPOINT\n end",
"title": ""
},
{
"docid": "174aa222c4cffda2b43def02d958c119",
"score": "0.5639417",
"text": "def around\n create_client\n\n if STUB_API\n cassette = \"#{self.class}_#{name}\"\n VCR.use_cassette(cassette, record: RECORD_MODE,\n match_requests_on: %i[method uri body]) do\n yield\n end\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "f2fc91909d45a62be97dca5cc5907a93",
"score": "0.5635766",
"text": "def current_api_user\n @current_api_user ||= stub_model(Refinery::Api.user_class, email: \"[email protected]\")\n end",
"title": ""
},
{
"docid": "f803e941321f6ffc00ecd14e72d28e8d",
"score": "0.5633066",
"text": "def get_api_results(_url)\n JSON.parse File.read('spec/inspector/stubbed_example.json')\n end",
"title": ""
},
{
"docid": "f2cdc9f80085eea6b07c250a7e0da6c7",
"score": "0.5629539",
"text": "def preflight; end",
"title": ""
},
{
"docid": "333cb50a16a1038f824ff32254c51124",
"score": "0.5629093",
"text": "def initialize\n begin\n @api_methods = Api_methods\n @api_version = Api_version\n rescue StandardError => e\n $log.error(sprintf(\"%s: %s\", __method__, e.message))\n raise\n end\n end",
"title": ""
},
{
"docid": "d7dde1d6e48431acc2acb626fe153300",
"score": "0.5626501",
"text": "def get_live_fixtures\n fixtures = parse_api_request(\"#{BASE_URL}fixtures/live\")[\"fixtures\"]\nend",
"title": ""
},
{
"docid": "01c213a3e43c4ec20a13b021c708ecb2",
"score": "0.5616493",
"text": "def api\n # Don't cache instance for now because of a ruby marshaling bug present\n # in MRI 1.9.3 (Bug #7627) that causes instance variables to be\n # marshaled even when explicitly specifying #marshal_dump.\n Octokit::Client.new(:login => login, :access_token => token)\n end",
"title": ""
},
{
"docid": "135248c505b3d3159045b10e55c4db67",
"score": "0.5615814",
"text": "def setup\n @client = @@client\n end",
"title": ""
}
] |
be51e291f9328059482f1faa97bd4fd7
|
Public: Determines the total amount of biocarrier CO2 emissions caused by the demand of this node. Returns a numeric in kg.
|
[
{
"docid": "923d0aa495242299a8ccdd13a38bd5d4",
"score": "0.5732716",
"text": "def primary_co2_emission_of_bio_carriers\n fetch(:primary_co2_emission_of_bio_carriers) do\n (demand || 0.0) * recursive_factor(:bio_co2_per_mj_factor)\n end\n end",
"title": ""
}
] |
[
{
"docid": "763bdbe4d644476f4d3fad9458af6773",
"score": "0.6374724",
"text": "def free_co2_factor\n dataset_get(:free_co2_factor) || 0.0\n end",
"title": ""
},
{
"docid": "85053d583ac2dd8001e795c1cbf61d5a",
"score": "0.6347535",
"text": "def cost \n return @extra_cost + @basic_cycle.cost\n end",
"title": ""
},
{
"docid": "d3085ae4f8cab4927ebb284e38600895",
"score": "0.6275873",
"text": "def cbl\n n = 0.0\n if actor?\n n += Float(eval(actor_block_settings(:base_cbl)))\n n += self.actor.critical_block_chance\n n += self.class.critical_block_chance\n for equip in equips\n next if equip.nil?\n n += equip.critical_block_chance\n end\n else\n n += Float(eval(enemy_block_settings(:base_cbl)))\n n += self.enemy.critical_block_chance\n end\n for state in states\n next if state.nil?\n n += state.critical_block_chance\n end\n n *= 0.01\n # determine maximum critical block chance\n n = [n, cbl_max].min\n n = [n, 0].max\n \n return n\n end",
"title": ""
},
{
"docid": "3de96ab85aa282dac0b8b9a8693e608f",
"score": "0.626274",
"text": "def total_capacity\n @clients.collect { |c| c.bit_rate }.sum\n end",
"title": ""
},
{
"docid": "60a203c83fc2557df5ec3047e289bb32",
"score": "0.62492937",
"text": "def total_cost\n cost_per_room = @rooms[0].cost * @discount_rate\n\n total_cost = (cost_per_room * @rooms.length) * @date_range.nights\n\n return total_cost.to_f.round(2)\n end",
"title": ""
},
{
"docid": "ac433b0bb80648b2764860d51e98a67f",
"score": "0.62436765",
"text": "def capacity_from_other_demand\n node = @context.graph.node(@config.output_capacity_from_demand_of)\n avg_load = node.demand / 8760 / 3600\n\n avg_load * @config.output_capacity_from_demand_share\n end",
"title": ""
},
{
"docid": "7cb5a2dc83cebc381ffeecd42543c186",
"score": "0.62015885",
"text": "def costs_co2\n %w[molecule_nodes energy_nodes]\n end",
"title": ""
},
{
"docid": "c08bfd277f1a2005e72216434510bcb5",
"score": "0.60971993",
"text": "def fuel_consumption\n return self['fuelConsumption'].to_f / 1000.0\n end",
"title": ""
},
{
"docid": "4855d784fc3fd9b56e063c7de151c322",
"score": "0.6077044",
"text": "def valorTotalCO2\r\n la = @listaAlimentos.head\r\n lg = listaGramos.head\r\n totalCO2 = 0.0\r\n while la != nil do\r\n totalCO2 = totalCO2 + la.value.gei * lg.value\r\n la = la.next\r\n lg = lg.next\r\n end\r\n return totalCO2\r\n end",
"title": ""
},
{
"docid": "c1b5c9c29afcdc59cda86fa4c167e90b",
"score": "0.6067227",
"text": "def capacity\n return 0 if power_total == 0\n power_dc / power_total\n end",
"title": ""
},
{
"docid": "6db05f4c8d1218c40e255701be3aa276",
"score": "0.6033208",
"text": "def total_gain\r\n (((current_value - initial_value) - @commission) * 100).round / 100.0\r\n end",
"title": ""
},
{
"docid": "65eb1e1c684001dea9719713988cec64",
"score": "0.60075265",
"text": "def crd; (cri_dmg * 100).to_i; end",
"title": ""
},
{
"docid": "36a3b95ce610736fd27a52ecaee810fe",
"score": "0.59820074",
"text": "def total_cost\n total_cost = (days_booked - 1)* RATE\n return total_cost\n end",
"title": ""
},
{
"docid": "f37688af36c9e1438cf1e238d9d71333",
"score": "0.59774226",
"text": "def cost \n return @extra_cost + @basic_bike.cost\n end",
"title": ""
},
{
"docid": "c160eb8041a81c2adf05d5edd82c39a5",
"score": "0.5974474",
"text": "def cents\n frequency_ratio = (@degree_a.ratio / @degree_b.ratio.to_f)\n 1_200 * Math.log(frequency_ratio, 2)\n end",
"title": ""
},
{
"docid": "8db5d321536e08c8fe2decd467c05322",
"score": "0.59499246",
"text": "def barrier_consume_rate\n base = H87AttrSettings::BARRIER_MP_CONSUME\n [base + features_sum(:barrier_save), 0.01].max\n end",
"title": ""
},
{
"docid": "e30b604465939c174ebd3fe1823192c8",
"score": "0.59310526",
"text": "def calculate_consumption(nb_cylinders, car_weight)\n\treturn 39.686261 -1.507795*nb_cylinders - 3.190972*car_weight\nend",
"title": ""
},
{
"docid": "8ab6b531d971bd92dc631507f37f567a",
"score": "0.5927248",
"text": "def total_submitted_charges\n sum = 0\n @eobs.each do |eob|\n sum += eob.amount('total_submitted_charge_for_claim')\n end\n sum\n end",
"title": ""
},
{
"docid": "fafe5b693f233a7f529add7eac925062",
"score": "0.59236217",
"text": "def total_bill\n (@hire_cost + @room_bar_tab).round(2)\n end",
"title": ""
},
{
"docid": "d37b80cd582899e007e91247ef5a4eae",
"score": "0.5908723",
"text": "def consumption_price\n @cost_strategy\n end",
"title": ""
},
{
"docid": "3f00cd8cee7928f524b6773a49ad0f63",
"score": "0.5901722",
"text": "def crd\n (cri_dmg * 100).to_i\n end",
"title": ""
},
{
"docid": "3cd8708d81236e19e31b0058ebfc9908",
"score": "0.5892469",
"text": "def total_cost()\n total_cost = nil\n if @room != nil\n total_cost = @room.price.to_f * @number_of_days\n end\n return total_cost\n end",
"title": ""
},
{
"docid": "3cd8708d81236e19e31b0058ebfc9908",
"score": "0.5892469",
"text": "def total_cost()\n total_cost = nil\n if @room != nil\n total_cost = @room.price.to_f * @number_of_days\n end\n return total_cost\n end",
"title": ""
},
{
"docid": "0ed80d82146388d3922b84c8793094ec",
"score": "0.5891687",
"text": "def cost\n @cost.ceil\n end",
"title": ""
},
{
"docid": "a254bc4bf97a0c95286bfb89cb99be0c",
"score": "0.5886939",
"text": "def calculate_cost\n nights_booked = length_of_stay\n cost = (nights_booked * ROOM_RATE)\n return cost\n end",
"title": ""
},
{
"docid": "b475aed5abd4d99f7779c21ca0290576",
"score": "0.5871375",
"text": "def production_cost\n components.map do |component|\n component.production_cost\n end.sum\n end",
"title": ""
},
{
"docid": "5497f31372feb15b44fffc409e80c735",
"score": "0.5861768",
"text": "def total_cost\n @monthly_payment * @loan_length\n end",
"title": ""
},
{
"docid": "e8d834fb3be1b3be3c04c9c7672d7994",
"score": "0.5859733",
"text": "def cost \n return @extra_cost + @basic_car.cost\n end",
"title": ""
},
{
"docid": "50c6cc5373ab8386d125ddc0dfaf6c2d",
"score": "0.5850733",
"text": "def total_cost\n\t\t\t@room_cost * (@end_date - @start_date - 1) * @rooms.length\n\t\tend",
"title": ""
},
{
"docid": "4880dba6128220dfa8d355f3b415a0a3",
"score": "0.5847722",
"text": "def total_charges\n @room_rate = room_rate * (@check_out - @check_in).to_i\n end",
"title": ""
},
{
"docid": "021b8887f0285f81552d7241a4f7f9fc",
"score": "0.58455455",
"text": "def surcharge_amount\r\n extra_cost = self.cost.to_f.amount_of(self.surcharge*100)\r\n end",
"title": ""
},
{
"docid": "47a6a71a598f1511d093242926dd7cb4",
"score": "0.58424616",
"text": "def influencer_cpc_fee\n cpc_fee - (cpc_fee * borwin_fee)\n end",
"title": ""
},
{
"docid": "a0dc701b06051e475a922ca9877d2a87",
"score": "0.58328885",
"text": "def total_quantity\n cached_qty_bank.to_f + cached_qty_consigned.to_f\n end",
"title": ""
},
{
"docid": "b0efa8268c8150c01f8d301cfbe7afea",
"score": "0.58317596",
"text": "def cost\n commission = [self.payment/10.0, MTURK_COMMISSION_MINIMUM].max\n return (self.payment + commission) * tasks.size\n end",
"title": ""
},
{
"docid": "e9fdae00137a00595f5e515340a82822",
"score": "0.5826436",
"text": "def expected_cost\n if expected_cost_cents.present?\n read_attribute(:expected_cost_cents) / 100.0\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "6b508abc886e0538efea9361da65c22b",
"score": "0.5823316",
"text": "def critical_rate\n return data.critical_rate\n end",
"title": ""
},
{
"docid": "60cb67a2eb2a0b4f543b9e338125f199",
"score": "0.580104",
"text": "def production_cost\n reagents.map do |reagent|\n reagent.production_cost\n end.sum\n end",
"title": ""
},
{
"docid": "307ac5957732974c9dc5adc08fbbf491",
"score": "0.5787904",
"text": "def cost\n total_cost = reservation_duration * 200\n return total_cost.to_f\n end",
"title": ""
},
{
"docid": "2d52cfed79b96630ac8ceebcddafb16a",
"score": "0.57818985",
"text": "def electricity_output_capacity\n fetch(:electricity_output_capacity, false) do\n typical_input_capacity ? typical_input_capacity * electricity_output_conversion : 0.0\n end\n end",
"title": ""
},
{
"docid": "a2872dad6726689a3abe89700206fa7d",
"score": "0.5775369",
"text": "def calc_cadence\n # formula to calculate rpm of a wheel\n @cadence = (get_speed / 12 * 2)\n @cadence_int = @cadence.to_i\n return @cadence_int\n end",
"title": ""
},
{
"docid": "eef0f54427ceb152f841475f492aa5e1",
"score": "0.5770601",
"text": "def total_cost\r\n return @qty * @price\r\n end",
"title": ""
},
{
"docid": "d1200c6845fc0a3abf7aae2f476390bc",
"score": "0.5752607",
"text": "def production_cost\n reagent.production_cost * quantity\n end",
"title": ""
},
{
"docid": "bd8fef9caa83cc61b752d2a246b63c4e",
"score": "0.5749392",
"text": "def parts_cost\n asset_event_asset_subsystems.map(&:parts_cost).compact.reduce(0, :+)\n end",
"title": ""
},
{
"docid": "b0ab1c53436d927e9fd4ddffc076e9db",
"score": "0.57399684",
"text": "def total_cost\n quantity * unit_cost_price\n end",
"title": ""
},
{
"docid": "66ca1ee8ce06a624351ba47940258e2a",
"score": "0.573296",
"text": "def cost \n return @extra_cost + @basic_shift.cost\n end",
"title": ""
},
{
"docid": "e2f140eebaf4652ebaa6cf7bc1538237",
"score": "0.57304996",
"text": "def total_fuel_required\n # A 2.7-ism. Requires bleeding-edge Ruby. Like from the HEAD.\n Enumerator.produce(fuel_required) { |remaining|\n self.class.fuel_required remaining\n }.take_while { |f| f > 0 }.sum\n end",
"title": ""
},
{
"docid": "70dd1ff95634f22b99468b70feb99639",
"score": "0.5729422",
"text": "def total_total\n remb_depense_total + net_total\n end",
"title": ""
},
{
"docid": "08c46c0bc4686fa3c1e33c1d4c5c8c02",
"score": "0.57283837",
"text": "def cost \n return @extra_cost + @basic_med.cost\n end",
"title": ""
},
{
"docid": "5757b74d8e6eada8f950ffa934c86e4b",
"score": "0.57234967",
"text": "def coefficients_total\n self.coefficients_counts.nil?? 0 : self.coefficients_counts.inject(0){|sum,key_value| sum += key_value[1]}\n end",
"title": ""
},
{
"docid": "7192ea148ef7f1efd3395fa92b1a99ff",
"score": "0.569169",
"text": "def denom\n return @b\n end",
"title": ""
},
{
"docid": "1e97dfff957d4fe0fc33cd3b94dfac17",
"score": "0.56894445",
"text": "def cost\n 0\n end",
"title": ""
},
{
"docid": "6fe8355530952164c673eb557ef76499",
"score": "0.568723",
"text": "def value(consumption)\n v = (self.n * consumption.weight.Gm_Wgt * consumption.measurement ).to_f/100.0\n puts \"v:#{v}\"\n return v\n end",
"title": ""
},
{
"docid": "fa4921ffa0903cfd0d4d772d4f1a1888",
"score": "0.56841636",
"text": "def outstanding_demand\n return 0.0 unless @deferments[0]\n @deferments.sum(0.0, &:amount)\n end",
"title": ""
},
{
"docid": "d146ee021a3aeefff8c95f4a319a8e40",
"score": "0.5674841",
"text": "def totalCost\n\t\tfinalValue = 0\n\t\t@totalExchGrouped = self.costs.group(\"exchange_id\").sum('value')\n\t\[email protected] do |exch|\n\t\t\tfinalValue += Exchange.find(exch[0]).rate*exch[1]\n\t\tend\n\t\treturn finalValue\n\tend",
"title": ""
},
{
"docid": "c574dd74e62b49fe00fec32b77451ae3",
"score": "0.56727976",
"text": "def cost\n return @extra_cost + @basic_patient.cost\n end",
"title": ""
},
{
"docid": "3455df595f7698b88a73506c4c42d512",
"score": "0.5663596",
"text": "def get_free_capacity \n return @capacity - @total_weight;\n end",
"title": ""
},
{
"docid": "63b9c82392b5c97b7a44b5322e54ff9d",
"score": "0.5657753",
"text": "def cost\n (@quantity * @unit_cost).round(2)\n end",
"title": ""
},
{
"docid": "fd7f304c4721fc282bea3fe3a0505275",
"score": "0.565573",
"text": "def cri_dmg\n native_cri_dmg + features_sum(:critical_damage)\n end",
"title": ""
},
{
"docid": "19d7baa6a53713b7014fd6535c356e5b",
"score": "0.5652068",
"text": "def blc\n n = 0.0\n if actor?\n n += Float(eval(actor_block_settings(:base_blc)))\n n += self.actor.block_chance\n n += self.class.block_chance\n for equip in equips\n next if equip.nil?\n n += equip.block_chance\n end\n else\n n += Float(eval(enemy_block_settings(:base_blc)))\n n += self.enemy.block_chance\n end\n for state in states\n next if state.nil?\n n += state.block_chance\n end\n n *= 0.01\n # determine maximum block chance\n n = [n, blc_max].min\n n = [n, 0].max\n \n return n\n end",
"title": ""
},
{
"docid": "314d89ff1b601e5de083920384fe09a4",
"score": "0.56478983",
"text": "def getCoste\n return @coste\n end",
"title": ""
},
{
"docid": "cab57bacd456e65b33fd3ea053b56db8",
"score": "0.5647695",
"text": "def calculate_carrier_demand\n unchanged_leader? ? @original_carrier_demand : (demand_curve.sum * 3600)\n end",
"title": ""
},
{
"docid": "e6e8eea952c38a639f6284d06380ad3c",
"score": "0.56457597",
"text": "def base_price\n [\n category_cost,\n desired_length_cost,\n uploaded_footage_cost\n ].sum\n end",
"title": ""
},
{
"docid": "182c58cc2152540c18b5148efe09a8dd",
"score": "0.5644103",
"text": "def gastoEnergeticoTotal()\n \t(self.gastoEnergeticoBasal() + self.efectoTermogeno() + self.gastoActividadFisica()).round(2)\n \tend",
"title": ""
},
{
"docid": "220b521383664a025e58fd4d17bb5842",
"score": "0.56393194",
"text": "def cost\n end",
"title": ""
},
{
"docid": "5fd14eae26260a482d9cb76abade4c14",
"score": "0.56361747",
"text": "def gauge_total\n return nil if gauge_feet.nil? && gauge_inch.nil?\n (gauge_feet.to_f * 12 + gauge_inch.to_f).round(2)\n end",
"title": ""
},
{
"docid": "7b06793e5134d06b6b8f43e2d9900403",
"score": "0.56346697",
"text": "def total\n total_order_cost = super\n total_order_cost += 10.0 if total_order_cost > 0.0\n return total_order_cost\n end",
"title": ""
},
{
"docid": "8d937a2bb2be7a10c60e6d4526cd1d73",
"score": "0.5620472",
"text": "def cpu_hand_total_value\n cpu_hand.collect(&:value).inject(:+)\n end",
"title": ""
},
{
"docid": "4e532f85676339115be0e4eddfc44502",
"score": "0.562039",
"text": "def indirect_cost_rate\n if Setting.get_value(\"use_indirect_cost\")\n self.protocol.indirect_cost_rate.to_f / 100\n else\n return 0\n end\n end",
"title": ""
},
{
"docid": "7ec184e2ede059adb2e471b0cd2160b0",
"score": "0.561202",
"text": "def barrier_rate\n [0.0 + features_sum(:barrier_rate), 1].min\n end",
"title": ""
},
{
"docid": "d8750dd80b0e94ddc750006d45cfcefc",
"score": "0.5603421",
"text": "def typical_electricity_production_capacity\n fetch(:typical_electricity_production_capacity) do\n electricity_output_conversion * input_capacity\n end\n end",
"title": ""
},
{
"docid": "4638177f976dc631c964996f669543ce",
"score": "0.5603026",
"text": "def total_value\n coins.reduce(0) do |sum, (coin_name, quantity)|\n sum + coin_value(coin_name) * quantity\n end\n end",
"title": ""
},
{
"docid": "8b4fca3c22a7b5d68f4b7ffddefb7533",
"score": "0.5602921",
"text": "def getCost()\n return @cost\n end",
"title": ""
},
{
"docid": "38d64632bc43961ef3442199712bb4a6",
"score": "0.5601594",
"text": "def cost\r\n 0\r\n end",
"title": ""
},
{
"docid": "38d64632bc43961ef3442199712bb4a6",
"score": "0.5601594",
"text": "def cost\r\n 0\r\n end",
"title": ""
},
{
"docid": "129943dcd19710c54d439a7b4fdb8d38",
"score": "0.5600638",
"text": "def total_consumption_estimated\n invoices.reject(&:marked_for_destruction?).sum(:consumption_estimated)\n end",
"title": ""
},
{
"docid": "ed222f8444129029e65c0d42ebacab6a",
"score": "0.559242",
"text": "def cost\n value\n end",
"title": ""
},
{
"docid": "578a5785440a847f1e1c2b1866bce62f",
"score": "0.559236",
"text": "def total_cost\n\t\ttotal = 0\n\t\tself.line_items.each do |item|\n\t\t\ttotal += (item.cost * item.quantity_purchased)\n\t\tend\n\t\ttotal\n\tend",
"title": ""
},
{
"docid": "cd657b395530c01a057a53f832c0438b",
"score": "0.5592341",
"text": "def total_cash_needed\n\t\t(cash_purchase? ? purchase_price : loans.map(&:down_payment).reduce(:+)) + closing_costs + estimated_repairs + loans.map(&:points_payment).reduce(:+)\n\tend",
"title": ""
},
{
"docid": "100a0f0cfdf60c194548c9dac62e006e",
"score": "0.55891544",
"text": "def gastoEnergeticoTotal()\n (self.gastoEnergeticoBasal() + self.efectoTermogeno() + self.gastoActividadFisica()).round(2)\n end",
"title": ""
},
{
"docid": "9a69070159cb25333baa78c6c800b1b6",
"score": "0.5588331",
"text": "def calc_cadence\n # formula to calculate rpm of a wheel\n @cadence = 25 / (3 * 3.14 * 0.305) * get_speed\n return @cadence\n end",
"title": ""
},
{
"docid": "cb7e949fc63b1995cf954505cf318bff",
"score": "0.55878943",
"text": "def calculate_total_cost()\n items = self.stock_items()\n if items.length == 0\n @total_cost = 0\n else\n daily_cost = items.reduce(0) {|sum, item| sum += item.rental_cost.to_f}\n @total_cost = @duration * daily_cost\n end\n self.update()\n end",
"title": ""
},
{
"docid": "b2eb7f1a72ced5ff8b7be011fcdfb3cc",
"score": "0.55800533",
"text": "def received_amount\n self.collection_tranche_pegged? ?\n self.tranche_pegged_items.map(&:received_amount).copmact.reduce(&:+) :\n self.settled_total\n end",
"title": ""
},
{
"docid": "f8bd85cbc4af5a3e4db36307f716e95f",
"score": "0.55747825",
"text": "def total_variable_cost\n return self.variable_cost * self.launches_made + self.payment_to_contracts\n end",
"title": ""
},
{
"docid": "06835542c294a1d604a4987d47daf51d",
"score": "0.5570056",
"text": "def denom\n\t\treturn @b\n\tend",
"title": ""
},
{
"docid": "06835542c294a1d604a4987d47daf51d",
"score": "0.5570056",
"text": "def denom\n\t\treturn @b\n\tend",
"title": ""
},
{
"docid": "9a25ff730a1362314b47852071867957",
"score": "0.5567073",
"text": "def total_comprobante\n (self.importe * self.signo)\n end",
"title": ""
},
{
"docid": "2e783bf89b4d2e7b91be5b007c8fbfdd",
"score": "0.55602",
"text": "def total_cost\n num_of_days = end_date - start_date\n room_cost = room_rate * num_of_days\n\n return room_cost\n end",
"title": ""
},
{
"docid": "23efe7a03fa6f75b4dba7fdeeddae891",
"score": "0.5558471",
"text": "def cost\n @inputs.size - @inputs.map(&:bit).count(Bit::DC)\n end",
"title": ""
},
{
"docid": "3fba6fb5b36c97c563a94a1fbb183e93",
"score": "0.5545971",
"text": "def cost\n @r[@end]\n end",
"title": ""
},
{
"docid": "0ff815eeecfe02055bb99612423c2a04",
"score": "0.55446106",
"text": "def GEI_total\n\t\tr = 0\n n = @alimentos.head\n i = @gramos.head\n\n while !n.nil?\n\n r += ((n.value.gei)*(i.value/100))\n n = n.next\n i = i.next\n end\n\n\t\t\n\n return (r).round(2)\n\tend",
"title": ""
},
{
"docid": "45ac46534573fa3cab597f93cb93841a",
"score": "0.554351",
"text": "def ram_total\n %x[free -ot].split[7]\n end",
"title": ""
},
{
"docid": "ea03d5dc59161b035d74cb4d14e0ec19",
"score": "0.5541815",
"text": "def this_total_costs\n item_costs + worker_costs + tool_costs + vehicle_costs + subcontractor_costs\n end",
"title": ""
},
{
"docid": "953ef8675e38ea6fc93d4932a42ad4f7",
"score": "0.55381423",
"text": "def demand\n # regressie toepassen uit analyse\n (demand_28d_before * 0.9526 + 29.8462).round\n end",
"title": ""
},
{
"docid": "8af9288d31ceb88fe3da12a39f4d3e05",
"score": "0.5534599",
"text": "def provisional_total_cost\n # feels like the bodies of this conditional could be dried up\n if number_of_express_deliveries < 2 # could this be a method?\n (number_of_express_deliveries * EXPRESS_DELIVERY_COST) + (number_of_standard_deliveries * STANDARD_DELIVERY_COST)\n else\n (number_of_express_deliveries * DISCOUNTED_EXPRESS_DELIVERY_COST) + (number_of_standard_deliveries * STANDARD_DELIVERY_COST)\n end\n end",
"title": ""
},
{
"docid": "0818a363782f0497236c2a118192c379",
"score": "0.5534514",
"text": "def net_total\n net_total_base.round(2)\n end",
"title": ""
},
{
"docid": "7964a0ac4e460ebb358bea819d47de17",
"score": "0.5534268",
"text": "def total_fine()\n fine = daily_cost().to_f * days_overdue().to_f\n return fine.to_s + \"0\"\n end",
"title": ""
},
{
"docid": "2334770f23ebe25d400d24a2322e1400",
"score": "0.55339694",
"text": "def one_time_charge\n order_items.one_time_charges.sum(:cost).to_i\n end",
"title": ""
},
{
"docid": "576917166dca218d6147b6ce64879ecd",
"score": "0.55335927",
"text": "def get_gas_price\n gas_price = fetch_from_cache.to_i\n\n return GlobalConstant::GasEstimations.default_gas_price if gas_price <= 0\n\n gas_price += GlobalConstant::GasEstimations.buffer_gas\n\n return GlobalConstant::GasEstimations.min_gas_price if gas_price < GlobalConstant::GasEstimations.min_gas_price\n\n return GlobalConstant::GasEstimations.max_gas_price if gas_price > GlobalConstant::GasEstimations.max_gas_price\n\n gas_price\n end",
"title": ""
},
{
"docid": "7f6229e0eb2c3a849da2f0a24dce0e13",
"score": "0.55312717",
"text": "def energy_bohr(n)\n ENERGY_BINDING / n**2\n end",
"title": ""
},
{
"docid": "42e7f06e6d41a0ecce7b7c53b72a4b91",
"score": "0.5525647",
"text": "def total\n if @products.length == 0\n return 0\n else\n total_cost = @products.values.reduce(:+)\n total_cost *= 1.075\n return total_cost.round(2)\n end\n end",
"title": ""
}
] |
0746fce065b8f1b4dcaa44370bb28477
|
PATCH/PUT /teacher_leave_applications/1 PATCH/PUT /teacher_leave_applications/1.json
|
[
{
"docid": "a1bd4e5a35769c3fd4acb77390f65297",
"score": "0.77537185",
"text": "def update\n respond_to do |format|\n if @teacher_leave_application.update(teacher_leave_application_params)\n format.html { redirect_to @teacher_leave_application, notice: 'Teacher leave application was successfully updated.' }\n format.json { render :show, status: :ok, location: @teacher_leave_application }\n else\n format.html { render :edit }\n format.json { render json: @teacher_leave_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d7989ce1dac7ecff7ef32c756e430b54",
"score": "0.6830157",
"text": "def set_teacher_leave_application\n @teacher_leave_application = TeacherLeaveApplication.find(params[:id])\n end",
"title": ""
},
{
"docid": "10ee17ef017da5303b0227766ff87fea",
"score": "0.67128444",
"text": "def update\n respond_to do |format|\n if @leave_application.update(leave_application_params)\n format.html { redirect_to @leave_application, notice: 'Leave application was successfully updated.' }\n format.json { render :show, status: :ok, location: @leave_application }\n else\n format.html { render :edit }\n format.json { render json: @leave_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c3ed14d4c03ac6f0cccbfeb504d7116",
"score": "0.649494",
"text": "def teacher_leave_application_params\n params.require(:teacher_leave_application).permit(:teacher_id, :subject, :message, :is_approved)\n end",
"title": ""
},
{
"docid": "bc44e045dd670c858dff8ea43f553f9c",
"score": "0.6204093",
"text": "def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to root_path, notice: 'Application was successfully submitted.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f323f3fa26a4ad5df8a543ff38d5211d",
"score": "0.6196904",
"text": "def update\n @newapp = Newapp.find(params[:id])\n\n respond_to do |format|\n if @newapp.update_attributes(params[:newapp])\n format.html { redirect_to @newapp, notice: 'Newapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1cc0ebde84274b11c5ef3522a06dc97",
"score": "0.6163669",
"text": "def update\n respond_to do |format|\n if @task_application.update(task_application_params)\n format.html { redirect_to @task_application, notice: 'Task application was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @task_application }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe8ab111ee716ed0958c00d24c0bf29c",
"score": "0.61586815",
"text": "def update\n @student_application = StudentApplication.find(params[:id])\n\n respond_to do |format|\n if @student_application.update_attributes(params[:student_application])\n format.html { redirect_to @student_application, notice: 'Student application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b22aa79f71cf18ab6af3bb30cd375e72",
"score": "0.61082286",
"text": "def update\n @application_event=ApplicationsEvent.find(params[:applications_event_id])\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n if @applications_application.update_attributes(params[:applications_application])\n format.html { redirect_to @applications_application, notice: 'Applications application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @applications_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9f402969d818e28e33938d959e52cd1",
"score": "0.6104323",
"text": "def update\n return unless admin?\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "552977fb3995413cb934c56f30ef16fe",
"score": "0.6097316",
"text": "def destroy\n @teacher_leave_application.destroy\n respond_to do |format|\n format.html { redirect_to teacher_leave_applications_url, notice: 'Teacher leave application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f46490862ab527be0238a9610d2ff628",
"score": "0.6085289",
"text": "def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c87fc208f2810f61720fe0408665a0a",
"score": "0.60790616",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to student_url(current_user), notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "760580889b41f1efe796d79e1404945b",
"score": "0.60676193",
"text": "def update\n respond_to do |format|\n if @agent_application.update(agent_application_params)\n format.html { redirect_to @agent_application, notice: 'Agent application was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_application }\n else\n format.html { render :edit }\n format.json { render json: @agent_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15b6f6c2e1f5b4a33bacc969697fdfa7",
"score": "0.60656804",
"text": "def create\n @leave_application = LeaveApplication.new(leave_application_params)\n @student = Student.find(leave_application_params[:student_id])\n @classteacher = @student.divisions.last.class_teacher\n\n @leave_application.save\n unless @classteacher.nil?\n @leave_application.update(teacher_id: @classteacher.teacher.id)\n end\n\n\n # respond_to do |format|\n # if @leave_application.save\n # format.html { redirect_to @leave_application, notice: 'Leave application was successfully created.' }\n # format.json { render :show, status: :created, location: @leave_application }\n # else\n # format.html { render :new }\n # format.json { render json: @leave_application.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "83487eb3284c017a92cc7046c28ec6a5",
"score": "0.60521156",
"text": "def create\n @teacher_leave_application = TeacherLeaveApplication.new(teacher_leave_application_params)\n\n respond_to do |format|\n if @teacher_leave_application.save\n # format.html { redirect_to @teacher_leave_application, notice: 'Teacher leave application was successfully created.' }\n format.json { render json:{ success: true, message: 'Leave application submitted' } }\n else\n # format.html { render :new }\n format.json { render json: {success: false, error: @teacher_leave_application.errors} }\n end\n end\n end",
"title": ""
},
{
"docid": "d083b4ff3702d4a77fe19c74b2b13f36",
"score": "0.6051665",
"text": "def update\n respond_to do |format|\n if @employment_application.update(employment_application_params)\n format.html { redirect_to @employment_application, notice: 'Employment application was successfully updated.' }\n format.json { render :show, status: :ok, location: @employment_application }\n else\n format.html { render :edit }\n format.json { render json: @employment_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "844a058b9ca4706cbb40ee7a03149d56",
"score": "0.603594",
"text": "def update\n respond_to do |format|\n if @activity_application.update(activity_application_params)\n format.html {redirect_to [@meetup_event, @activity_application], notice: 'Activity application was successfully updated.'}\n format.json {render :show, status: :ok, location: meetup_event_activity_application_path(@meetup_event, @activity_application)}\n else\n format.html {render :edit}\n format.json {render json: @activity_application.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "d6c146786bc3ce830e347c988b309f40",
"score": "0.5977808",
"text": "def update\n\n if @app.update_attributes(params[:app])\n respond_to do |format|\n format.html {\n redirect_to app_path(@app), notice: 'app was successfully updated.'\n }\n format.json { render :nothing => true}\n end\n else\n respond_to do |format|\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62121992f3a3212db7aa5b996ca70a68",
"score": "0.59651834",
"text": "def update\n @app = @client.app(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app]) # FIXME\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8285ee571f6d1ef34a41d4747ff8efd",
"score": "0.5964291",
"text": "def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html {\n flash[:success] = 'Application was successfully updated.'\n redirect_to [:admin, @application]\n }\n format.json { head :no_content }\n else\n format.html {\n flash[:error] = 'Failed to update application.'\n render action: \"edit\"\n }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7e02fef11785da509ae77000cb007a7",
"score": "0.59483993",
"text": "def update\n respond_to do |format|\n if @instructor_app.update(instructor_app_params)\n format.html { redirect_to portal_path(current_user.id), notice: 'Instructor app was successfully updated.' }\n format.json { render :show, status: :ok, location: @instructor_app }\n else\n format.html { render :edit }\n format.json { render json: @instructor_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c4a5802a8485b8e123d411f4e677b67",
"score": "0.593703",
"text": "def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9122f135ea143a9cc9f49caa9721acb1",
"score": "0.5921614",
"text": "def update\n @application = policy_scope(Application).find(params[:id])\n\n @application.schedule_items.clear\n @application.experiences.clear\n @application.roles.clear\n\n policy_scope(Application).update(@application.id, application_params)\n authorize @application\n if params[:application][:decision] == 'update'\n if @application.save\n flash[:notice] = t('.successfully_updated')\n else\n flash[:alert] = t('.not_created')\n end\n elsif params[:decision] == 'accept'\n @application.accept!\n flash[:notice] = t('.accepted')\n elsif params[:decision] == 'reject'\n @application.reject!\n flash[:notice] = t('.rejected')\n else\n flash[:alert] = t('.cant_change_state')\n end\n redirect_to applications_path\n end",
"title": ""
},
{
"docid": "0e95c08bb62b17ac6480ea86130ce692",
"score": "0.5921163",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1070d4aee52f28221a6c3d4291d3253f",
"score": "0.5899255",
"text": "def update\n @app_role = AppRole.find(params[:id])\n\n respond_to do |format|\n if @app_role.update_attributes(params[:app_role])\n format.html { redirect_to @app_role, notice: 'App role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ee55d99fe038b505a0d557810513b84",
"score": "0.5898729",
"text": "def leave_application_params\n params.require(:leave_application).permit(:subject, :message, :is_approved, :seen_date, :teacher_id, :student_id)\n end",
"title": ""
},
{
"docid": "b4d2b801e0a8eda16eef02cd1f180064",
"score": "0.5896912",
"text": "def update\n respond_to do |format|\n if @herga_application.update(herga_application_params)\n format.html { redirect_to @herga_application, notice: 'Herga application was successfully updated.' }\n format.json { render :show, status: :ok, location: @herga_application }\n else\n format.html { render :edit }\n format.json { render json: @herga_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cf9c1f78ece2e44a3b7e602e67743b",
"score": "0.5885334",
"text": "def update\n #@jobapp = Jobapp.find(params[:id])\n\n respond_to do |format|\n if @jobapp.update_attributes(params[:jobapp])\n format.html { redirect_to @jobapp, notice: 'Jobapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jobapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c6dd7daa167606a1ba8352348c168b4",
"score": "0.58761895",
"text": "def update\n @program_attendance = ProgramAttendance.find(params[:id])\n\n respond_to do |format|\n if @program_attendance.update_attributes(params[:program_attendance])\n format.html { redirect_to @program_attendance, notice: 'Program attendance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program_attendance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b066b5048c19e7112654c21829d82238",
"score": "0.5861322",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, alert: 'Your application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1610cafb4b4ce705c5f8e4d1e02a5ca",
"score": "0.58589447",
"text": "def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "934883efeab1ae6b346ffafb34fa629d",
"score": "0.5854778",
"text": "def update\n @student_id = session[:user_id]\n @course_id = params[:course_id]\n\n respond_to do |format|\n if @application.update(application_params)\n \n if @application.status_id == 1\n UserMailer.rejection_email(@application.student).deliver\n elsif @application.status_id == 8\n UserMailer.acceptance_email(@application.student).deliver\n elsif @application.status_id == 5\n @application.course.instructors.each do |instructor|\n UserMailer.instructor_email(instructor).deliver\n end\n end\n\n \n format.html { redirect_to course_application_path(@application.course, @application), notice: 'Application was successfully updated.' }\n\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d351ecc31f4168747d4906607a2d9052",
"score": "0.58491504",
"text": "def update\n @user_app = UserApp.find(params[:id])\n\n respond_to do |format|\n if @user_app.update_attributes(params[:user_app])\n format.html { redirect_to @user_app, notice: 'User app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d452b6ae2fde997623b4ae562e771bec",
"score": "0.5842034",
"text": "def update\n @second_rails_app = SecondRailsApp.find(params[:id])\n\n respond_to do |format|\n if @second_rails_app.update_attributes(params[:second_rails_app])\n format.html { redirect_to @second_rails_app, notice: 'Second rails app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @second_rails_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14dac0a4519f15aa6146f56b98c5c55d",
"score": "0.58398145",
"text": "def update\n @app = App.find(params[:id])\n\n if params[:cancel_edit_app_button]\n respond_to do |format|\n format.html do\n if request.xhr? \n render :partial => 'app', :locals => { :app => @app }\n else\n redirect_to apps_url\n end\n end\n \n format.xml { head :ok }\n end\n \n return\n end\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html do\n if request.xhr?\n render :partial => 'app', :locals => {:app => @app}\n else\n flash[:notice] = 'App was successfully updated.'\n redirect_to app_activities_path(@app)\n end\n end\n format.xml { head :ok }\n else\n format.html do\n if request.xhr?\n render :partial => 'edit_horizontal', :locals => {:app => @app}\n else\n render :action => 'edit'\n end\n end\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75ac98d2a402bb769e0aab327596a7d6",
"score": "0.5832036",
"text": "def update\n @app = App.find(params[:id])\n\n if @app.update(app_params)\n head :no_content\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e610355ebfb7911b944a9b7f40c85b24",
"score": "0.58308876",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e610355ebfb7911b944a9b7f40c85b24",
"score": "0.58308876",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e610355ebfb7911b944a9b7f40c85b24",
"score": "0.58308876",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f83d7efa4b716e8bcff0b800ab5950b",
"score": "0.5829177",
"text": "def set_leave_application\n @leave_application = LeaveApplication.find(params[:id])\n end",
"title": ""
},
{
"docid": "d3e4a4c997b0ff02366eaa9a617dcf3b",
"score": "0.5826921",
"text": "def update\n respond_to do |format|\n if @mapp.update(mapp_params)\n format.html { redirect_to @mapp, notice: 'Mapp was successfully updated.' }\n format.json { render :show, status: :ok, location: @mapp }\n else\n format.html { render :edit }\n format.json { render json: @mapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c46fe188e2f9b7019c2a94ea74853cb6",
"score": "0.58266735",
"text": "def update_app data={}\n put '/app', data\n end",
"title": ""
},
{
"docid": "7437875ab56d6bd362911b649d04e775",
"score": "0.58196723",
"text": "def update\n @application.owner = current_user if @application.owner.blank?\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to settings_admin_oread_applications_path, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "861de11e785d17d72e93f3ebc1344201",
"score": "0.5816413",
"text": "def index\n @teacher_leave_applications = TeacherLeaveApplication.all\n end",
"title": ""
},
{
"docid": "7b8108f4e2b39563e0064119edb82137",
"score": "0.5812852",
"text": "def update\n respond_to do |format|\n if @client_application.update(client_application_params)\n format.html { redirect_to @client_application, notice: 'Client application was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_application }\n else\n format.html { render :edit }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cca4406e7b4981168633cf0b147548",
"score": "0.5807094",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cca4406e7b4981168633cf0b147548",
"score": "0.5807094",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3430b104798939cd84a332d73971757f",
"score": "0.58065045",
"text": "def update\n respond_to do |format|\n if @todo_app.update(todo_app_params)\n format.html { redirect_to @todo_app, notice: 'Todo app was successfully updated.' }\n format.json { render :show, status: :ok, location: @todo_app }\n else\n format.html { render :edit }\n format.json { render json: @todo_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea5cb5644219ad503cff088ce7ee8b83",
"score": "0.5791251",
"text": "def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to vacancy_path(@job_application.vacancy_id), notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da176dbdf9cd211be2693284ceb0942d",
"score": "0.5790506",
"text": "def update\n @client_app = ClientApp.find(params[:id])\n\n respond_to do |format|\n if @client_app.update_attributes(params[:client_app])\n format.html { redirect_to(client_apps_path, :notice => 'Client app was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seed.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a486cbf66d5d3adaca36ea8219227537",
"score": "0.5790504",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2bc3fd953f7a507a8300cf9838f3fc7",
"score": "0.57868177",
"text": "def update\n #params = parse_parametrs(params)\n @teacher = Teacher.find(params[:id])\n\n respond_to do |format|\n if @teacher.update_attributes(params[:teacher]) &&\n @teacher.user.update_attributes({:name => params[:name],\n :last_name => params[:last_name],\n :middle_name => params[:middle_name],\n :role_pending => params[:role_pending]\n })\n\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "debe29fbe7227ba3cc694d05b563d2e9",
"score": "0.577431",
"text": "def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ae13d6c9a6a7d01a2c65d15d5bee608",
"score": "0.5771933",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c4f02c6001ab074292c58263550eae0",
"score": "0.5769851",
"text": "def update\n respond_to do |format|\n if @yarn.update_attributes(params[:yarn])\n format.html { redirect_to @yarn, notice: 'Yarn was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yarn.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab7c47e366683774e6ea883b0ee2d47d",
"score": "0.57650185",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to dynamic_url(@application, action: :edit), notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fbc143ac2b32782598d8c2f50c12dd4",
"score": "0.57433",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: \"Application was successfully updated.\" }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "698dbdc67ebba7f4a69ab7a9de17d3d2",
"score": "0.5740817",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n #if blank, send email because step 4 is finished. remove and false when SMTP creds are integrated\n if application_params[:next_step].blank? and false\n UserMailer.notify_feedback(@application).deliver_now\n end\n\n format.html { redirect_to \"/applications/#{@application.id}/#{application_params[:next_step]}\", notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bd839c4f555fd59ac50d39ae24f6015",
"score": "0.5730081",
"text": "def update\n respond_to do |format|\n if @parent_app.update(parent_app_params)\n format.html { redirect_to @parent_app, notice: 'Parent app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @parent_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "696d1d49ce0cfcf09aa5e3b7c2cfc55a",
"score": "0.57290447",
"text": "def update\n @application = Application.find(params[:id])\n\n if @application.update_attributes(params[:application])\n flash[:notice] = 'Application was successfully updated.'\n end\n \n respond_with @application\n end",
"title": ""
},
{
"docid": "f31300f24de22231f0ce7ab11946bb16",
"score": "0.5723757",
"text": "def update\n respond_to do |format|\n if @teacher.update(teacher_params)\n format.html { redirect_to admin_teacher_path(@teacher), notice: 'teacher was successfully updated.' }\n format.json { render action: 'show', status: :updated, location: @teacher }\n #format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e0e912f083d1220e8cb46996e52a9a2",
"score": "0.5722519",
"text": "def update\n if @application.update(application_params)\n render json: @application, status: :ok, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52feb93a73257873e1012d1cd17c2dce",
"score": "0.57212234",
"text": "def update\n @teacher = Teacher.find(params[:id])\n respond_to do |format|\n if @teacher.update(params.require(:teacher).permit(:name, :email, :address, :discipline, :phone))\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { render :show, status: :ok, location: @teacher }\n else\n format.html { render :edit }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4423703e19792a404134e23db4d690cb",
"score": "0.571426",
"text": "def update\n respond_to do |format|\n if @user_application.update(user_application_params)\n format.html { redirect_to @user_application, notice: 'User application was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_application }\n else\n format.html { render :edit }\n format.json { render json: @user_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b29ba0f855e3ae8b98daada112f135c6",
"score": "0.57060635",
"text": "def update\n @application = Application.find(params[:id])\n \n respond_to do |format|\n if @application.update_attributes(params[:application])\n flash[:notice] = 'Application was successfully updated.'\n format.html { redirect_to(@application) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a686c299eadca7134cc6370e2213bb98",
"score": "0.5703655",
"text": "def update\n respond_to do |format|\n if @application.update(application_params)\n format.html {redirect_to @application, notice: 'Application was successfully updated.'}\n format.json {render :show, status: :ok, location: @application}\n else\n format.html {render :edit}\n format.json {render json: @application.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "b1c1c3e8a2bcbcdf770a32f78b38c084",
"score": "0.5691491",
"text": "def update\n authorize! :update, @app\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80857e405f9769c50902cefda9ed9316",
"score": "0.5691404",
"text": "def update\n respond_to do |format|\n if @test_app.update(test_app_params)\n format.html { redirect_to @test_app, notice: 'Test app was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_app }\n else\n format.html { render :edit }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5e4ef057b49169c3be6b2b9114cd7e7",
"score": "0.56871414",
"text": "def update\n @teacher = Teacher.find(params[:id])\n\n respond_to do |format|\n if @teacher.update_attributes(params[:teacher])\n format.html { redirect_to [:admin, @teacher], :notice => 'Teacher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @teacher.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d085bdeecb509b669e600bd955d93ccd",
"score": "0.5682653",
"text": "def update\n @application = Application.find(params[:id])\n new_name = params[:application][:name].to_s.downcase\n @application.name = params[:application][:name]\n User.edit_app_name(@application.id, new_name) if @application.valid?\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to applications_path, notice: 'Приложение обновлено.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96ad58f4c4b31bb46c73cffa813fa99d",
"score": "0.567711",
"text": "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96ad58f4c4b31bb46c73cffa813fa99d",
"score": "0.567711",
"text": "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96ad58f4c4b31bb46c73cffa813fa99d",
"score": "0.567711",
"text": "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96ad58f4c4b31bb46c73cffa813fa99d",
"score": "0.567711",
"text": "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96ad58f4c4b31bb46c73cffa813fa99d",
"score": "0.567711",
"text": "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1e2b7855242deb397f5b6537fca9e07",
"score": "0.5676181",
"text": "def update\n @candidate_app = CandidateApp.find(params[:id])\n\n respond_to do |format|\n if @candidate_app.update_attributes(params[:candidate_app])\n format.html { redirect_to @candidate_app, notice: 'Candidate app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @candidate_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5380f5a0ae88a277da7185d160607ebf",
"score": "0.5663257",
"text": "def update\n if @application.update(application_params)\n render :show, status: :ok, location: @application\n else\n render json: @application.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1e79d6a98678fecd6fcbb63abb2d1bf7",
"score": "0.56631386",
"text": "def update\n respond_to do |format|\n if @program_employee.update(program_employee_params)\n format.html { redirect_to @program_employee, notice: 'Program employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1275ffe28a70dc0b9a6010751c3cf511",
"score": "0.5658202",
"text": "def update\n respond_to do |format|\n if @test_app.update(test_app_params)\n format.html { redirect_to @test_app, notice: \"Test app was successfully updated.\" }\n format.json { render :show, status: :ok, location: @test_app }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7be5d92b35ead4631c2c2c1008ac046",
"score": "0.56543416",
"text": "def update\n respond_to do |format|\n if @switterapp.update(switterapp_params)\n format.html { redirect_to @switterapp, notice: 'Switterapp was successfully updated.' }\n format.json { render :show, status: :ok, location: @switterapp }\n else\n format.html { render :edit }\n format.json { render json: @switterapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6567ec5b61c3e8ad0ea660d8e34127d5",
"score": "0.5652763",
"text": "def update\n\n unless @login_user_role == \"1\"\n flash[:error] = \"You don't have paermission.\"\n redirect_to :action => \"index\"\n return\n p \"hoge\"\n end\n\n #approveおよびdenyは承認者権限のみなのでチェックが必要\n @application = Application.find(params[:id])\n result = false\n if params['commit'] == \"approve\"\n result = @application.update_attribute(\"status\",1)\n\n\n\n\n\n #ary = ParseDate::parsedate(@application['start']) #=> [2001, 5, 24, 22, 56, 30, \"JST\", 4]\n #t = Time::local(*ary[0..-3]) #=> Thu May 24 22:56:30 JST 2001\n\n#2013-06-13 20:56:11 UTC\n\n starttime = Time.strptime(@application['start'].to_s, '%Y-%m-%d %H:%M:%S')\n endtime = Time.strptime(@application['start'].to_s, '%Y-%m-%d %H:%M:%S')\n\n job = Job.new\n\n #sgの算出処理必要\n #job.send_at starttime, :authorize_ingress_from_gw_to_target, @access_key, @secret_access_key, @region,sg\n #job.send_at endtime, :revoke_ingress_from_gw_to_target, @access_key, @secret_access_key, @region,sg\n\n\n elsif params['commit'] == \"deny\"\n result = @application.update_attribute(\"status\",2)\n end\n respond_to do |format|\n if result\n format.html { redirect_to :action => \"index\", notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c38e5a2c7424652ccd3d84693991c874",
"score": "0.5641824",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n @program.update_attribute('approved', false)\n UserMailer.notify_approver(@program).deliver\n format.html { redirect_to brand_programs_path(@program.brand), notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aef9d54e1b89bf6282f030f4ab8a52a7",
"score": "0.5634138",
"text": "def update\n @toyota_epc_part_number_application_to_models_parent = ToyotaEpc::PartNumberApplicationToModelsParent.find(params[:id])\n\n respond_to do |format|\n if @toyota_epc_part_number_application_to_models_parent.update_attributes(params[:toyota_epc_part_number_application_to_models_parent])\n format.html { redirect_to @toyota_epc_part_number_application_to_models_parent, :notice => 'Part number application to models parent was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @toyota_epc_part_number_application_to_models_parent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf42b842520c5b3c6ea9f8bcb54c190b",
"score": "0.563292",
"text": "def update\n respond_to do |format|\n if @stay_has_teacher.update(stay_has_teacher_params)\n format.html { redirect_to @stay_has_teacher, notice: 'Stay has teacher was successfully updated.' }\n format.json { render :show, status: :ok, location: @stay_has_teacher }\n else\n format.html { render :edit }\n format.json { render json: @stay_has_teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8825647e7e8b4fa46f7cc613abc80c6",
"score": "0.5628169",
"text": "def update\n respond_to do |format|\n if @membership_application.update(membership_application_params)\n format.html { redirect_to @membership_application, notice: 'Membership application was successfully updated.' }\n format.json { render :show, status: :ok, location: @membership_application }\n else\n format.html { render :edit }\n format.json { render json: @membership_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e31d70acd7e79e066b869b8034bc0f0",
"score": "0.5626819",
"text": "def update\n respond_to do |format|\n if @loan_application.update(loan_application_params)\n format.html { redirect_to @loan_application, notice: 'Loan application was successfully updated.' }\n format.json { render :show, status: :ok, location: @loan_application }\n else\n format.html { render :edit }\n format.json { render json: @loan_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fb29710030d56b6cde8a32ab55bc9a5",
"score": "0.56164974",
"text": "def update\n #@meeting_thread = MeetingThread.find(params[:id])\n\n respond_to do |format|\n if @meeting_thread.update_attributes(params[:meeting_thread])\n format.html { redirect_to @meeting_thread, notice: 'Meeting thread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting_thread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a440e311401615c1d579224732c1b615",
"score": "0.56126416",
"text": "def update\n respond_to do |format|\n if @teacher.update(teacher_params)\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb5ab157c5fcbad5ce4b6e92fd156c6d",
"score": "0.5610833",
"text": "def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90f7fb6b9ccd829160d1b00d4effc7c8",
"score": "0.5605403",
"text": "def update\n @teacher = Teacher.find(params[:id])\n\n respond_to do |format|\n if @teacher.update_attributes(params[:teacher])\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90f7fb6b9ccd829160d1b00d4effc7c8",
"score": "0.5605403",
"text": "def update\n @teacher = Teacher.find(params[:id])\n\n respond_to do |format|\n if @teacher.update_attributes(params[:teacher])\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb2d1362580344aeada0a25670acbbfc",
"score": "0.56041384",
"text": "def update \n if @app \n @app.update(app_params)\n\n if @app.valid?\n head :no_content\n else \n head :bad_request\n end\n else \n head :not_found\n end\n end",
"title": ""
},
{
"docid": "1821ee4ab3b1184181870926b36d760b",
"score": "0.5594099",
"text": "def update\n @leave_request = LeaveRequest.find(params[:id])\n respond_to do |format|\n if @leave_request.update(leave_request_params)\n UserAudit.create({:user => current_user, :action => \"updated leave request\", :end_user => @leave_request.user.email})\n format.html { redirect_to @leave_request, notice: 'Leave request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @leave_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67143107140aad8fad681c31003b62f1",
"score": "0.5593568",
"text": "def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67143107140aad8fad681c31003b62f1",
"score": "0.5593568",
"text": "def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
9adf3e92ae3251a607ccf48b2700dee3
|
A convenience method to return the center x coordinate of this widget
|
[
{
"docid": "36fe198548e5a008c6979b3d221d9fca",
"score": "0.77814937",
"text": "def center_x\n @x + ((right_edge - @x) / 2)\n end",
"title": ""
}
] |
[
{
"docid": "30a85364cba8cf7567e20b484ad2dc50",
"score": "0.85798144",
"text": "def center_x\n @center[0]\n end",
"title": ""
},
{
"docid": "754c43f15e38bed4d09d5b307d78f576",
"score": "0.83168864",
"text": "def centre_x\n (width / 2) + x\n end",
"title": ""
},
{
"docid": "754c43f15e38bed4d09d5b307d78f576",
"score": "0.83168864",
"text": "def centre_x\n (width / 2) + x\n end",
"title": ""
},
{
"docid": "811322ebcc404e7b7184a608f4b50152",
"score": "0.8296345",
"text": "def center_x\n width / 2\n end",
"title": ""
},
{
"docid": "d54b0087980f39dfdd48b3fde855b84d",
"score": "0.8221143",
"text": "def center_x\r\n (Graphics.width / 32 - 1) / 2.0\r\n end",
"title": ""
},
{
"docid": "87c13b51b5338d191654efa89a96b07b",
"score": "0.8175248",
"text": "def center_x\n (Graphics.width / 32 - 1) / 2.0\n end",
"title": ""
},
{
"docid": "fcc51bf8677a5834a787a76459cfc414",
"score": "0.81443375",
"text": "def center_x\n @center_obj.nil? ? @ox : @center_obj.x\n end",
"title": ""
},
{
"docid": "fcc51bf8677a5834a787a76459cfc414",
"score": "0.81443375",
"text": "def center_x\n @center_obj.nil? ? @ox : @center_obj.x\n end",
"title": ""
},
{
"docid": "beee51089969885de70e1f049e1dedae",
"score": "0.8133129",
"text": "def center_x\n @x = @@screen.width/2-@width/2\n end",
"title": ""
},
{
"docid": "ab740465a28bd88b2b5099e2501a3116",
"score": "0.80228233",
"text": "def cx\n return self.center.x\n end",
"title": ""
},
{
"docid": "6cd7e462199e2cb993e89d7e6add0232",
"score": "0.79970396",
"text": "def GetCenterX(x)\n centerX=(x+0)/2\n end",
"title": ""
},
{
"docid": "002f460e3e529466c59be30085bc8983",
"score": "0.7988129",
"text": "def center_x\n @max_x ? (@max_x + @min_x) * 0.5 : nil\n end",
"title": ""
},
{
"docid": "002f460e3e529466c59be30085bc8983",
"score": "0.7988129",
"text": "def center_x\n @max_x ? (@max_x + @min_x) * 0.5 : nil\n end",
"title": ""
},
{
"docid": "f89ee3e1fd844ed1e62a9245d5d1a754",
"score": "0.78781444",
"text": "def centerX\n x + width * 0.5\n end",
"title": ""
},
{
"docid": "351bf69749566c04e3c6829770323890",
"score": "0.7811613",
"text": "def center_x_diff\n x = @@screen.width/2-@width/2\n return x-@x\n end",
"title": ""
},
{
"docid": "67734d3458b98e1a621dbff257395519",
"score": "0.7699357",
"text": "def center\n center_x\n center_y\n end",
"title": ""
},
{
"docid": "80b18105f333c410d19794f797554f13",
"score": "0.75976264",
"text": "def x\n\t\t(@pos[0] * @scale) + @center_x\n\tend",
"title": ""
},
{
"docid": "56d9ab6e3709619974caab6b78c4afc5",
"score": "0.74770904",
"text": "def x\r\n @ax - @centerx\r\n end",
"title": ""
},
{
"docid": "8a0db289b9c466d4a09f6aec05a51e73",
"score": "0.74688095",
"text": "def center_x=(val)\n type_check(val, Numeric)\n @center[0] = val\n @center_is_dirty = @is_dirty = true\n end",
"title": ""
},
{
"docid": "7db6a509fe2a630cd57c74c123f0dc2e",
"score": "0.74625623",
"text": "def GetCenterX(x)\n centerX=(x+0)/2\nend",
"title": ""
},
{
"docid": "0b850eddfee22503e1138111af813c7c",
"score": "0.7440457",
"text": "def centerx\n @buggy.chassis.body.p.x\n end",
"title": ""
},
{
"docid": "7b0c2e9b2839706f9e71226aa5119029",
"score": "0.72964156",
"text": "def center\n CGPointMake(centerX, centerY)\n end",
"title": ""
},
{
"docid": "daa86284d1e6e08f19ace4fd24c8847b",
"score": "0.72148407",
"text": "def center\n Core::Point.new(\n absolute_position.x + width / 2,\n absolute_position.y + height / 2\n )\n end",
"title": ""
},
{
"docid": "e3962b23d8de95c3f498a97f0a8d59a3",
"score": "0.7210937",
"text": "def actual_x_position\n return @actual_x + set_adjust[0]\n end",
"title": ""
},
{
"docid": "378f0f8b07a15793a2233ec0bddd7bdb",
"score": "0.7110417",
"text": "def center\n x = (@size_x - 1)/2\n y = (@size_y - 1)/2\n return x,y\n end",
"title": ""
},
{
"docid": "40ec9510013a6b0254bf17a5177e50f9",
"score": "0.7108775",
"text": "def centerLeft\n CGPointMake(left, centerY)\n end",
"title": ""
},
{
"docid": "a1dee77e49079d9fbf6861eba3379fac",
"score": "0.7026398",
"text": "def center\n @center\n end",
"title": ""
},
{
"docid": "41234a4191dc68b24f3411c9356191b5",
"score": "0.70058084",
"text": "def center\n offset = @scale.idiv(2)\n [@x + offset, @y + offset]\n end",
"title": ""
},
{
"docid": "5f7eabfe525f045f2dd0ef745ab2c682",
"score": "0.7002077",
"text": "def center\n\t\t\t\t@x = window.center.x - length\n\t\t\t\t@y = window.center.y\n\t\t\tend",
"title": ""
},
{
"docid": "fc80f40626854e7a0cfd89d121843094",
"score": "0.69823",
"text": "def findCenter() \n centerX = (@x * 80)\n centerY = (@y * 80)\n \n [centerX, centerY]\n end",
"title": ""
},
{
"docid": "d4c0c8d3fb39b178b63c717692f22376",
"score": "0.6968739",
"text": "def center\n x = @rect.x + (@rect.width / 2)\n y = @rect.y + (@rect.height / 2)\n\n Point.new(x, y)\n end",
"title": ""
},
{
"docid": "b0a34fe6baa35a259227a2bfa3862b51",
"score": "0.6944714",
"text": "def x\n if (@@x.nil?)\n raise \"Cannot determine X coordinate\"\n end\n return @@x\n end",
"title": ""
},
{
"docid": "b0a34fe6baa35a259227a2bfa3862b51",
"score": "0.6944714",
"text": "def x\n if (@@x.nil?)\n raise \"Cannot determine X coordinate\"\n end\n return @@x\n end",
"title": ""
},
{
"docid": "97a540d26eaf78e59655d681148c32ad",
"score": "0.6939043",
"text": "def x\n self.position_x * $GRID_SIZE\n end",
"title": ""
},
{
"docid": "811f856bd2c92a90b9900928c312c97d",
"score": "0.69389963",
"text": "def cx\n self.x + width / 2\n end",
"title": ""
},
{
"docid": "042dc73023e21790cd06ac0b02aa7dc9",
"score": "0.6923952",
"text": "def center_xy\n y_ = (@y_min + @y_max) * 0.5\n if @x_min > @x_max\n x_ = @x_min + x_span * 0.5\n limits_ = @factory.projection_limits_window\n x_ -= limits_.x_span if x_ >= limits_.x_max\n else\n x_ = (@x_min + @x_max) * 0.5\n end\n [x_, y_]\n end",
"title": ""
},
{
"docid": "3d30e5f2e98490690da508230ef3486d",
"score": "0.6907754",
"text": "def document_x\n\t\tcursor.x - self.margin_left_width\n\tend",
"title": ""
},
{
"docid": "1ab26e71641f5a112d9b9a361fa1b7f8",
"score": "0.68951917",
"text": "def center_x\n name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name\n if Pose_Sprite[name] != nil and Pose_Sprite[name]['Center'] != nil\n pose = Pose_Sprite[name]['Center'].dup\n return pose[@battler.pose_id][0] if pose[@battler.pose_id] != nil\n return pose['Base'][0] if pose['Base'] != nil\n end\n return @frame_width / 2\n end",
"title": ""
},
{
"docid": "75805c08d186661e70065a58344f40bf",
"score": "0.6893484",
"text": "def sprite_center_x\n self.x - self.ox + self.width / 2\n end",
"title": ""
},
{
"docid": "9701ec5a6e079c90f4ee5a3f913591a9",
"score": "0.6885853",
"text": "def center\n @center || @override_center\n end",
"title": ""
},
{
"docid": "30b6f84577bb36f278fb1e58b5338f7d",
"score": "0.6882877",
"text": "def centre\n location = element.wd.location\n size = element.wd.size\n {'y' => (location['y'] + (size['height']/2)), 'x' => (location['x'] + (size['width']/2))}\n end",
"title": ""
},
{
"docid": "72ed44418fe24368761311c9bc71e810",
"score": "0.68731946",
"text": "def center_window\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "72ed44418fe24368761311c9bc71e810",
"score": "0.68731946",
"text": "def center_window\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "559bf3b3d3ae25e2bbff70943e8eb45d",
"score": "0.6862891",
"text": "def center\n point = location\n dimensions = size\n Selenium::WebDriver::Point.new(point.x + (dimensions['width'] / 2),\n point.y + (dimensions['height'] / 2))\n end",
"title": ""
},
{
"docid": "154cfc8fff38d2a0adca2029d845da7a",
"score": "0.6862033",
"text": "def range_x\n @obj.x - center_x\n end",
"title": ""
},
{
"docid": "154cfc8fff38d2a0adca2029d845da7a",
"score": "0.6862033",
"text": "def range_x\n @obj.x - center_x\n end",
"title": ""
},
{
"docid": "98023278655d1b5f81ac7bc5ca8dd9b2",
"score": "0.68604946",
"text": "def central_region_x\n @coordinates[:x] / 8\n end",
"title": ""
},
{
"docid": "3eb458ad6f9e254c11e546f41db186cb",
"score": "0.68489546",
"text": "def center\n [@left + width / 2, @bottom + height / 2]\n end",
"title": ""
},
{
"docid": "e624b81fbeaf2317f6a9aadd512d0ec8",
"score": "0.6845814",
"text": "def center\n x = (@grid.length.to_f / 2).floor # Keep in mind off-by-one\n Coordinate.new(x, x)\n end",
"title": ""
},
{
"docid": "4f09ba8427e8a0b58c91c06dc7f0960b",
"score": "0.6832981",
"text": "def center\n if parent!=nil\n @x, @y = parent.x+parent.sx/2-@sx/2, parent.y+parent.sy/2-@sy/2\n else\n @x, @y = 0.5 - @sx/2, 0.5 - @sy/2\n\tend\n end",
"title": ""
},
{
"docid": "381ce89e685f2faf9dab6c0c75f5de57",
"score": "0.6799071",
"text": "def center\n @center||calculate_center\n end",
"title": ""
},
{
"docid": "fac1dc4523256c2d1a9ad0606c3aa2e1",
"score": "0.67953146",
"text": "def x\n position.x if position?\n end",
"title": ""
},
{
"docid": "8ce3eb48113f54fb3a7ff8604e581165",
"score": "0.67599005",
"text": "def window_x\n Graphics.width - window_width - 2\n end",
"title": ""
},
{
"docid": "2692640b577866efdd43c347eb7af1f2",
"score": "0.6753445",
"text": "def x\r\n return $window.mouse_x\r\n end",
"title": ""
},
{
"docid": "f000dd66a7e9fab30bd348b21c09ae8a",
"score": "0.67334676",
"text": "def x\n @position.x\n end",
"title": ""
},
{
"docid": "dc9c2fbbb746dc6df53091914ecdbe18",
"score": "0.672307",
"text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end",
"title": ""
},
{
"docid": "dc9c2fbbb746dc6df53091914ecdbe18",
"score": "0.672307",
"text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end",
"title": ""
},
{
"docid": "b2b7fbb0398263e0598f8dfd4a7150d3",
"score": "0.67214143",
"text": "def x\n x_value = bounds.x\n x_value -= parent.absolute_x if parent.is_a?(Shape)\n x_value\n end",
"title": ""
},
{
"docid": "85e4b01aec26e3398c9ffab2c7d3b96d",
"score": "0.672046",
"text": "def center\n @sw.midpoint_to(@ne)\n end",
"title": ""
},
{
"docid": "85e4b01aec26e3398c9ffab2c7d3b96d",
"score": "0.672046",
"text": "def center\n @sw.midpoint_to(@ne)\n end",
"title": ""
},
{
"docid": "fc4e7aa50d3aa45a161ff2024547e9dd",
"score": "0.67124826",
"text": "def left\n if centred\n Terminal.centre_x - (width / 2)\n\n else\n x\n\n end\n end",
"title": ""
},
{
"docid": "24408926eaae1e09f522bbc3f676bcac",
"score": "0.6711549",
"text": "def center_horizontally\n @hcenter = 1\n end",
"title": ""
},
{
"docid": "2c519bdcce517a6bfcd44310dc8ec3de",
"score": "0.6693035",
"text": "def x\n @position.x\n end",
"title": ""
},
{
"docid": "fbd55efcbaaa9d385a5847fe44dcb40d",
"score": "0.66761893",
"text": "def cursor_x\r\n contents_width - cursor_width - 4\r\n end",
"title": ""
},
{
"docid": "6891c74da797301209d8a791cc3298a6",
"score": "0.66658103",
"text": "def get_x\n if DEBUG_COORDS\n logger.debug \"get_x(), %s %s ## %s\" % [get_class(), get_id(), get_unique_id()]\n end\n x = 0\n if @use_uiautomator\n x = @attributes['bounds'][0][0]\n else\n begin\n if @attributes.has_key?(GET_VISIBILITY_PROPERTY) and @attributes[GET_VISIBILITY_PROPERTY] == 'VISIBLIE'\n left = @attributes[@left_property].to_i\n x += left\n if DEBUG_COORDS\n logger.debug \"get_x(), VISIBLE adding #{left}\"\n end\n end\n end\n end\n if DEBUG_COORDS\n logger.debug \"get_x() return #{x}\"\n end\n return x\n end",
"title": ""
},
{
"docid": "e47274cd1c73b34e689e0e9fbc2c6076",
"score": "0.6662191",
"text": "def x\n x_value = bounds.x\n x_value -= parent.absolute_x if parent.is_a?(Shape) && parent.class != Shape\n x_value\n end",
"title": ""
},
{
"docid": "e81d151d975ff6f5a11afa480b3aa2c7",
"score": "0.6660265",
"text": "def x\n self.position.x\n end",
"title": ""
},
{
"docid": "7e71b924b00fa2e65ae6e6632c17647d",
"score": "0.6645077",
"text": "def center\n move(min_position + position_range/2)\n end",
"title": ""
},
{
"docid": "2c8393296c57990316da7c16c6e6bb2e",
"score": "0.664003",
"text": "def center(x,y)\n a = $s.size\n $s.position(x-(a/2), y-(a/2))\nend",
"title": ""
},
{
"docid": "2904825854abe315a69d9e2232b1b737",
"score": "0.66333985",
"text": "def center\n [width / 2.0, height / 2.0]\n end",
"title": ""
},
{
"docid": "b7b1ff8b581ac4fceaeafd4354e21d4d",
"score": "0.66272354",
"text": "def centre\n [centre_y, centre_x]\n end",
"title": ""
},
{
"docid": "b7b1ff8b581ac4fceaeafd4354e21d4d",
"score": "0.66272354",
"text": "def centre\n [centre_y, centre_x]\n end",
"title": ""
},
{
"docid": "ada723bb4a6a94d8ade036f425cd4853",
"score": "0.6625763",
"text": "def center_point\n @center ||= @factory.unproject(@factory.projection_factory.point(*center_xy))\n end",
"title": ""
},
{
"docid": "892fa728d3ff5942ac88b3ef4ff6bd21",
"score": "0.6613691",
"text": "def xmin\n @pos.x - @kx/@scale\n end",
"title": ""
},
{
"docid": "62a8bd6f56c5e00819466f86f2b55f88",
"score": "0.6592065",
"text": "def x\r\n @position.x\r\n end",
"title": ""
},
{
"docid": "ef5e93199f6bbb337a7a788cfd4f99a7",
"score": "0.6583561",
"text": "def get_x_start\n (SCREEN_WIDTH - ((CARD_WIDTH + @@x_buf) * (@cards.count / 3) - @@x_buf)) / 2\n end",
"title": ""
},
{
"docid": "eb8867b439fab7efb5fba51c110b2917",
"score": "0.65827864",
"text": "def center(x, y, rtrn_coords = false)\n $game_player.center(x,y)\n if rtrn_coords\n return $game_map.display_x, $game_map.display_y\n end\n end",
"title": ""
},
{
"docid": "707f5f1eb4f7af129bda690f32cdfa3b",
"score": "0.6580021",
"text": "def center_point\n @center_point ||= [52.508283, 13.329657].freeze\n end",
"title": ""
},
{
"docid": "9ae5f166d447a5614f96b00038582579",
"score": "0.6576307",
"text": "def x\n mm_to_pt(@padding_left + @mm_x)\n end",
"title": ""
},
{
"docid": "fa50135e775093173ee83fd33b0d29e9",
"score": "0.65745854",
"text": "def rel_x\n return x - Graphics.width/2\n end",
"title": ""
},
{
"docid": "cb61d4e8299301aa7370342bdd8e809e",
"score": "0.6520432",
"text": "def center\n\t\t@sub_cursor = SUB_NONE\n\tend",
"title": ""
},
{
"docid": "5f34f5151e0caf4e7f7f48946958056c",
"score": "0.6509312",
"text": "def centre\n Point.new(@x + (@sprite.width / 2), @y + (@sprite.height / 2))\n end",
"title": ""
},
{
"docid": "4d7b04c6dc1f91ec4eda4dfbba3a6b5d",
"score": "0.6506096",
"text": "def center(x, y)\n $game_map.set_display_pos(x - center_x, y - center_y)\n end",
"title": ""
},
{
"docid": "995d21adcbf9772d9a37db86be94bacd",
"score": "0.6505225",
"text": "def center_window\n desktop = Qt::DesktopWidget.new\n x = (desktop.width - WINDOW_WIDTH) / 2\n y = (desktop.height - WINDOW_HEIGHT) / 2\n @window.move x, y\n end",
"title": ""
},
{
"docid": "3ca73bb92d6c0b91c511a49178183daa",
"score": "0.6501698",
"text": "def cursor_x\n contents_width - 100\n end",
"title": ""
},
{
"docid": "dea130be96d7a73881998aeae6fd39aa",
"score": "0.6490172",
"text": "def center(x, y)\r\n $game_map.set_display_pos(x - center_x, y - center_y)\r\n end",
"title": ""
},
{
"docid": "dca21f1cb0b5ace8e59bd47e69b2f695",
"score": "0.6479941",
"text": "def client_x\n `#{@event}.clientX`\n end",
"title": ""
},
{
"docid": "abff3a8fde664a9e3770c4d985a6094a",
"score": "0.6463419",
"text": "def center \n\t\t\tPosition.new maxx - cols / 2, maxy - lines / 2\n\t\tend",
"title": ""
},
{
"docid": "ab585e78b368e87762d70772cf88f40b",
"score": "0.6462305",
"text": "def x_min\n\t\t@axis_min_x\n\tend",
"title": ""
},
{
"docid": "90b2af0c6585b29c6d3712c8935a1e60",
"score": "0.6450484",
"text": "def inner_x\n @side == :left ? @x+width : @x-width\n end",
"title": ""
},
{
"docid": "801e372c0d1afb1a2cb33f8caba06347",
"score": "0.6434566",
"text": "def x\n self.frame.origin.x\n end",
"title": ""
},
{
"docid": "e652bc0b37c426a5094df9fab616c676",
"score": "0.6430769",
"text": "def set_center\n xpos = @x * CELL_SIZE + (CELL_SIZE / 2)\n ypos = @y * CELL_SIZE + (CELL_SIZE / 2)\n @rect.center = [xpos, ypos]\n end",
"title": ""
},
{
"docid": "331e8b2c5ce0d438f4c0c31d3d846920",
"score": "0.6426379",
"text": "def centre\n [(height / 2), (width / 2)]\n end",
"title": ""
},
{
"docid": "331e8b2c5ce0d438f4c0c31d3d846920",
"score": "0.6426379",
"text": "def centre\n [(height / 2), (width / 2)]\n end",
"title": ""
},
{
"docid": "331e8b2c5ce0d438f4c0c31d3d846920",
"score": "0.6426379",
"text": "def centre\n [(height / 2), (width / 2)]\n end",
"title": ""
},
{
"docid": "04db877821968fe6a58a39e5e1815c02",
"score": "0.6422878",
"text": "def set_Center(value)\n set_input(\"Center\", value)\n end",
"title": ""
},
{
"docid": "4d75b43286c7b8142f80880a6da18286",
"score": "0.6400903",
"text": "def center\n end",
"title": ""
},
{
"docid": "4d75b43286c7b8142f80880a6da18286",
"score": "0.6400903",
"text": "def center\n end",
"title": ""
},
{
"docid": "1bb342ae688c434b3a4239b9652276bd",
"score": "0.63915396",
"text": "def center\n move_to ((@range.min + @range.max) / 2).abs\n end",
"title": ""
},
{
"docid": "657f4dde2b88c40073aa042e0413db05",
"score": "0.6387763",
"text": "def x_offset() @x_offset || 0.5; end",
"title": ""
}
] |
be29630feff4a59c519fdc3ffe7c7356
|
Get a value by its key
|
[
{
"docid": "7a63ee0a9d1ba0c18a1944401b987233",
"score": "0.0",
"text": "def get key\n @key = key\n url = [\"/v1/kv/#{@key}\"]\n url += check_acl_token unless check_acl_token.nil?\n @raw = @conn.get concat_url url\n parse_body\n return_value\n end",
"title": ""
}
] |
[
{
"docid": "6e0764fd23cdcf8d6b190ff54cae7a57",
"score": "0.82551694",
"text": "def getValue(key)\n return @values[key]\n end",
"title": ""
},
{
"docid": "a9068e3f0aaa5cdb7768a3e88142bf4d",
"score": "0.8214528",
"text": "def get(key)\n find_by_keys([key]).first\n end",
"title": ""
},
{
"docid": "a9068e3f0aaa5cdb7768a3e88142bf4d",
"score": "0.8214528",
"text": "def get(key)\n find_by_keys([key]).first\n end",
"title": ""
},
{
"docid": "029366622e3d38c0e6c1caff5f2e3633",
"score": "0.8104708",
"text": "def get(key)\n @hash[key]\n end",
"title": ""
},
{
"docid": "d6e21695bf15aaa4b4920f93ebebf34b",
"score": "0.80957836",
"text": "def get(key)\n data[key.to_s]\n end",
"title": ""
},
{
"docid": "29bb198fea64998fe4a19d6fa4547f96",
"score": "0.8044127",
"text": "def [](key)\n _, value = get(key)\n value\n end",
"title": ""
},
{
"docid": "9a20da81783f5b121055bafc62cecea0",
"score": "0.8037338",
"text": "def get(key)\n index = @key.index(key)\n return -1 unless index\n @val[index]\n end",
"title": ""
},
{
"docid": "7f55c69f1ba45d28dcbec301ed7b9117",
"score": "0.80221415",
"text": "def get(key)\n index = key_index(key)\n if( index )\n self.values.get(index)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.8012454",
"text": "def get(key); end",
"title": ""
},
{
"docid": "80a5d6147c4f79b4f57026875e87d06d",
"score": "0.8007564",
"text": "def fetch(key)\n return @keys[key] ? @keys[key] : \"value not found\"\n end",
"title": ""
},
{
"docid": "ded0d6c4c32b927385fe95b8413d6a97",
"score": "0.7959046",
"text": "def get(key)\n self[key]\n end",
"title": ""
},
{
"docid": "b2d3f3e5d7cd24412fa021d9aacfb02a",
"score": "0.7928424",
"text": "def [](key)\n get_value(key)\n end",
"title": ""
},
{
"docid": "1cc09ba66f60ba6c8e5ee876285607f5",
"score": "0.7898217",
"text": "def value(key)\n return @values[key]\n end",
"title": ""
},
{
"docid": "cfaef039c0cd61e09b0df93eb8cf621e",
"score": "0.78821796",
"text": "def get(key)\n item = get_item(key)\n if item.nil?\n nil\n else\n item.value\n end\n end",
"title": ""
},
{
"docid": "4cc32771a2bf382a20c160b32c090481",
"score": "0.7856139",
"text": "def get(key)\n @data[key]\n end",
"title": ""
},
{
"docid": "674ebea7d83c6deaa7c578d80739aa1d",
"score": "0.7854865",
"text": "def get(key)\n node = @table[key_index(key)]\n value = nil\n\n while node do\n if node.data[:key] == key\n value = node.data[:value]\n break\n end\n\n node = node.next_node\n end\n\n value\n end",
"title": ""
},
{
"docid": "ecf0b8fb951f5f01a1edacae27a305ab",
"score": "0.7830516",
"text": "def [](key)\n entry = @data.find { |d| d[:key] == key }\n return entry[:value] if entry\n\n nil\n end",
"title": ""
},
{
"docid": "904b350a10d4ff4d2538d65d906b5bc0",
"score": "0.78239816",
"text": "def get(key)\n @data[key]\n end",
"title": ""
},
{
"docid": "6d671308c30d1a36a8d95497942ab489",
"score": "0.7808589",
"text": "def get(key_name)\n val = get_or_default(key_name, \"\")\n end",
"title": ""
},
{
"docid": "2541782620e38615accfee2d934ce970",
"score": "0.78062606",
"text": "def value(key)\n @entries[key]\n end",
"title": ""
},
{
"docid": "2541782620e38615accfee2d934ce970",
"score": "0.78062606",
"text": "def value(key)\n @entries[key]\n end",
"title": ""
},
{
"docid": "6942d235fd0298adfee4fbf877e2010c",
"score": "0.77846044",
"text": "def value_of(key)\n @cache.hget(@@hash_name, key)\n end",
"title": ""
},
{
"docid": "9ae573c263a29ab0d7866c4f179e6c4d",
"score": "0.7783524",
"text": "def retrieve_value(key)\n return @store[key]\n end",
"title": ""
},
{
"docid": "0b3bf4dc7e3c8d4dea66729eba5107d3",
"score": "0.777652",
"text": "def get(key)\n return -1 unless @keys.include?(key)\n\n @values[@keys.index(key)]\n end",
"title": ""
},
{
"docid": "68a9125f19ef0a9852df36fe28186e1e",
"score": "0.7760067",
"text": "def [](key)\n @value[key]\n end",
"title": ""
},
{
"docid": "d12a44d0806c1fb6b15ef4bcae16b405",
"score": "0.7735633",
"text": "def find(key)\n values[key]\n end",
"title": ""
},
{
"docid": "58863a6e25c04653699a7278bff8e82a",
"score": "0.77149403",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "3a7b7c80ca6310474a5e7b8190025f2d",
"score": "0.77142566",
"text": "def get_value(key)\n @values.select{|emit_key| emit_key.key.eql?(key)}.first\n end",
"title": ""
},
{
"docid": "66f610b84ca28da5346e44a5074b81cd",
"score": "0.7712431",
"text": "def [](key)\n index = @keys.search(key)\n value = @values[index] if index\n end",
"title": ""
},
{
"docid": "e456d10ab93aa95b22b8ed2ca454bf98",
"score": "0.76996946",
"text": "def [](key)\n value[key]\n end",
"title": ""
},
{
"docid": "f6fafe6b793ea35300da50d5d1fc18e3",
"score": "0.76824856",
"text": "def [](key)\n fetch(key)\n rescue KeyError\n end",
"title": ""
},
{
"docid": "67a5001342969671dbbf595ae38c98b6",
"score": "0.7674623",
"text": "def get(key)\n return @map[key]\n end",
"title": ""
},
{
"docid": "83db67406fd9372a9354bf4360e246db",
"score": "0.7665529",
"text": "def value(key)\n data(key).get(:value)\n end",
"title": ""
},
{
"docid": "9ad07f4403f14a42b250a05dc9a00a35",
"score": "0.7641404",
"text": "def [](key)\n @lookup[key].value\n end",
"title": ""
},
{
"docid": "a6306787646164f1fd5aee114eac747d",
"score": "0.7631992",
"text": "def [](key)\n @key == key ? @value : nil\n end",
"title": ""
},
{
"docid": "eb423da559ae99b40cc255657ac914fa",
"score": "0.76199836",
"text": "def get(key)\n if self.has_key?(key)\n return self[key]\n elsif self.has_key?(key.to_sym)\n return self[key.to_sym]\n elsif self.has_key?(key.to_s)\n return self[key.to_s]\n end\n end",
"title": ""
},
{
"docid": "5b0df0c56ce7af9d83b92ae2cf61b024",
"score": "0.76193774",
"text": "def get(key)\n return case key.class.to_s\n when 'String'; get_string_key(key)\n when 'Fixnum'; get_integer_key(key)\n else; get_object_key(key)\n end\n end",
"title": ""
},
{
"docid": "a7962aee23bc96f7e0a6d7fabdfdd424",
"score": "0.76114666",
"text": "def [](key)\r\n return fetch(key)\r\n end",
"title": ""
},
{
"docid": "504852e3f5c4fb766148310c26812056",
"score": "0.76087165",
"text": "def get_value_from_key(key)\n fail 'key must be specified in the method get_value_from_key' if key.nil?\n\n value = @platform_info_hash[key]\n fail \"no value exists for the key #{key}\" if value.nil?\n\n value\n end",
"title": ""
},
{
"docid": "dc236c345ce6d48167a678173f143868",
"score": "0.7604007",
"text": "def get(key)\n data = request_data(:get, key_uri(key))\n return nil unless data\n if data.is_a?(Array)\n data.each_with_object({}) do |e, acc|\n acc[e[S_KEY]] = e[S_VALUE]\n end\n else\n data[S_VALUE]\n end\n end",
"title": ""
},
{
"docid": "747f00e12fc240ca09b8d4310176f346",
"score": "0.76039654",
"text": "def get(key)\n\t\t@dict[key]\n\tend",
"title": ""
},
{
"docid": "ad9a20999c399b0355fda30caae414b3",
"score": "0.76038426",
"text": "def lookup_value(id, key)\n lookup(id).try(:[], key)\n end",
"title": ""
},
{
"docid": "7f1a06632ce721a75b70f8107f3dcc82",
"score": "0.75904083",
"text": "def get(key)\n return self.map.get(key)\n end",
"title": ""
},
{
"docid": "c2fa704abdbcec3a02b87b3c5806cefe",
"score": "0.7588976",
"text": "def get(key)\n\n end",
"title": ""
},
{
"docid": "9082d6e650a44543df4af1d3bb6c6cfa",
"score": "0.75882995",
"text": "def get(k)\n obj = KeyValueHash.new(StringHash.new(k),nil)\n n = @hashTable.get(obj)\n return n.value\n end",
"title": ""
},
{
"docid": "9082d6e650a44543df4af1d3bb6c6cfa",
"score": "0.75882995",
"text": "def get(k)\n obj = KeyValueHash.new(StringHash.new(k),nil)\n n = @hashTable.get(obj)\n return n.value\n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.7576953",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.7576953",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.7576953",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.7576953",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "4c5d3ead7b0fb9122d457094e2690ba3",
"score": "0.7563402",
"text": "def get(key)\n if hash[key]\n self.put(key, hash[key].val)\n\n hash[key].val\n else\n -1\n end\n end",
"title": ""
},
{
"docid": "27c69623e10f3329c6cee618310847da",
"score": "0.75568223",
"text": "def [](key)\n __getobj__.get(key.to_s)\n end",
"title": ""
},
{
"docid": "e8715e7da5bf99ca2bb46051034fa361",
"score": "0.7552974",
"text": "def fetch\n value_of @key\n end",
"title": ""
},
{
"docid": "7c1292f9bae7565b0002dbe9957dea0f",
"score": "0.7550682",
"text": "def [](key)\n each do |oid,value,type|\n return value if oid == key\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "64cbb511a19889895bc124950470b2e5",
"score": "0.7542381",
"text": "def value(key)\n @data[key]\n end",
"title": ""
},
{
"docid": "1fa36f2f51468c74b230141bcdbac5ee",
"score": "0.75380075",
"text": "def get(key)\r\n @map.each { |pair| return pair[1] if pair[0] == key }\r\n nil\r\n end",
"title": ""
},
{
"docid": "77f72d11cdad1e9c8dd9794261ce4dd6",
"score": "0.7537419",
"text": "def get(k)\n lo, = find(k)\n return(@data[lo][1])\n end",
"title": ""
},
{
"docid": "7b6780807fb964ffa70de9593317b953",
"score": "0.7517602",
"text": "def value(key)\n return self[key][0]\n end",
"title": ""
},
{
"docid": "7d8be787cee3eede10bb04b766c1cdcc",
"score": "0.75146866",
"text": "def get(key)\n begin\n send(key)\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "669d1a7b8c679e2fdf14381cf1e194c4",
"score": "0.75142163",
"text": "def [](key)\n @monitor.synchronize do\n _, value = get(key)\n value\n end\n end",
"title": ""
},
{
"docid": "24e5706a1859ca644274843a99b97aa7",
"score": "0.7513741",
"text": "def get(key)\n validate_key(key)\n\n mget([key]).map { |values| values[0] }\n end",
"title": ""
},
{
"docid": "24e5706a1859ca644274843a99b97aa7",
"score": "0.7513741",
"text": "def get(key)\n validate_key(key)\n\n mget([key]).map { |values| values[0] }\n end",
"title": ""
},
{
"docid": "3cd6a3a87a7f45cae85fb2b31b0fc1f0",
"score": "0.749108",
"text": "def get(k)\r\n if @hashtable.contains?(k)\r\n return @hashtable.get(k).value # return value v\r\n else # raise an error\r\n raise \"Error, key not found in dictionary\"\r\n end\r\n end",
"title": ""
},
{
"docid": "6d97dc11c8ef42ed189ef6b2d0893133",
"score": "0.7487492",
"text": "def value_get key\n return nil if @params.nil?\n @params[key.to_sym]\n end",
"title": ""
},
{
"docid": "b0b70288fb31538bd894cf6fa398159c",
"score": "0.7485136",
"text": "def get(key)\n @collection.find(:_id => key).first.try(:[], 'value')\n end",
"title": ""
},
{
"docid": "3764f21324e8ec151b5d9f345ad11172",
"score": "0.74651563",
"text": "def get key\n clean_cache!\n @hash[key][1]\n end",
"title": ""
},
{
"docid": "a7f003236a7467d4ea188746da3f67b7",
"score": "0.7444942",
"text": "def find_value(key)\n type = @driver.get_type key\n return @driver.get_hash key if type == 'hash'\n if type == 'list'\n length = @driver.list_length key\n return @driver.list_range key, 0, length-1 if length > 0\n return nil\n end\n return @driver.get_string key if type == \"string\"\n # We don't use set or sorted set, so return nil\n nil\n end",
"title": ""
},
{
"docid": "5a90984176049e08fe3ba921ed12f95a",
"score": "0.74440765",
"text": "def getValue(key)\n return @table[key] ;\n end",
"title": ""
},
{
"docid": "96de06af4c634acd6b75fe647428060d",
"score": "0.743494",
"text": "def get(key)\n x = search(@root, key)\n return x.value if x\n return nil\n end",
"title": ""
},
{
"docid": "0f56e0fa6234db2b5f00c42cec0053ca",
"score": "0.742885",
"text": "def [](key)\r\n get key\r\n end",
"title": ""
},
{
"docid": "ef3b4d3f4ee920b03997439b4a91ba3f",
"score": "0.7418659",
"text": "def get(key)\n @data_map[key]\n end",
"title": ""
},
{
"docid": "714e097a66e0221c808f2909074b1a6d",
"score": "0.74176145",
"text": "def get key\n content = nil\n begin\n content = @fast.get(key) \n rescue Exception\n end\n\n return content unless content.nil?\n\n begin\n content = @slow.get(key) \n rescue Exception\n end\n return content\n end",
"title": ""
},
{
"docid": "5754ce4f94a446febbf26bd947e4b0d9",
"score": "0.7416802",
"text": "def value_of(key)\n if @table.has_key?(key)\n @table[key][:value]\n end\n end",
"title": ""
},
{
"docid": "e77b76855523386accea175dbb2753a3",
"score": "0.74118173",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "e77b76855523386accea175dbb2753a3",
"score": "0.74118173",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "e77b76855523386accea175dbb2753a3",
"score": "0.74118173",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "e77b76855523386accea175dbb2753a3",
"score": "0.74118173",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "e77b76855523386accea175dbb2753a3",
"score": "0.74118173",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "c6b1001c4123697beba44f73ad6db4cb",
"score": "0.74048114",
"text": "def get(key)\n res = @data[key]\n\n return -1 if res.nil?\n\n put(key, res)\n\n res\n end",
"title": ""
},
{
"docid": "c944496c0a2633d775c42a80b81e9c83",
"score": "0.74009156",
"text": "def [](key)\n key = key.to_sym if key.respond_to?(:to_sym)\n return @hash[key]\n end",
"title": ""
},
{
"docid": "a756bb22e16588c3ebb3d97296858715",
"score": "0.73852557",
"text": "def get(key)\n value = @map.fetch(key, @head).value\n if value != -1\n put(key, value)\n end\n value\n end",
"title": ""
},
{
"docid": "755eb60d954d9a22f181acd6978e0bff",
"score": "0.7382877",
"text": "def [](key)\n get(key)\n end",
"title": ""
},
{
"docid": "1b1b2f0a6049699181ba5bafc83a6557",
"score": "0.738138",
"text": "def [](key)\n (0...size).each do |i|\n if @items[i] != nil && @items[i].key == key\n return @items[i].value\n end\n end\n end",
"title": ""
},
{
"docid": "3a604d0d0a210c03c98112d6fe7476f7",
"score": "0.73771125",
"text": "def get_value_of(key)\n JSON.parse(@response)[key]\n end",
"title": ""
},
{
"docid": "a6c8e56c26e1b6965276490cd9a00272",
"score": "0.7371926",
"text": "def get(key)\n index = @entries_index[key.to_i]\n if index\n case index\n when Array\n return @entries.values_at(*index)\n else\n return @entries[index]\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e60d0a5b14999467a7c8a3889e90fcb0",
"score": "0.734938",
"text": "def [](key)\n @values[key.to_s]\n end",
"title": ""
},
{
"docid": "22ea03998d409e5cdbb7211db6a5aec6",
"score": "0.7343498",
"text": "def [](key)\n _get(key)\n end",
"title": ""
}
] |
32cd9ee5d16d999a1627a600fa56fbd3
|
skip_before_action :authorized, only: [:new, :create] or whatever onlys we will need
|
[
{
"docid": "858164c5cec46cd3b5f66a05b5598802",
"score": "0.0",
"text": "def new\n # Don't need to have form_for in Stylist show page\n # Maybe just need a form_tag\n\n # Coming from Barber show page\n if params[\"stylist_service\"]\n stylist_service_id = params[\"stylist_service\"][\"stylist_service_id\"].to_i\n @appointment = Appointment.new(stylist_service_id: stylist_service_id, client_id: current_user.id)\n elsif flash[:errors]\n # Date not available\n stylist_service_id = flash[:stylist_service_id].to_i\n @appointment = Appointment.new(stylist_service_id: stylist_service_id, client_id: current_user.id)\n elsif flash[:available_times] == []\n # raise params.inspect\n flash[:errors] = \"No times available for this day. Please select another day.\"\n stylist_service_id = flash[:stylist_service_id].to_i\n @appointment = Appointment.new(stylist_service_id: stylist_service_id, client_id: current_user.id)\n elsif flash[:date] == nil\n # raise params.inspect\n stylist_service_id = flash[:stylist_service_id].to_i\n @appointment = Appointment.new(stylist_service_id: stylist_service_id, client_id: current_user.id)\n else\n # Coming from create page\n stylist_service_id = flash[:stylist_service_id].to_i\n date = DateTime.parse(flash[:date])\n @selected_block_tables = BlockTable.select do |block_table|\n flash[:available_times].include? block_table.id\n end\n @appointment = Appointment.new(stylist_service_id: stylist_service_id, client_id: current_user.id, date: date)\n end\n end",
"title": ""
}
] |
[
{
"docid": "defb5f2df80d2d9ee9b3196ab243bc97",
"score": "0.7946808",
"text": "def skip_authorization_check(*args)\n self.before_action(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end",
"title": ""
},
{
"docid": "76963bf10c7e1f00c884714138397857",
"score": "0.79447937",
"text": "def skip_authorization_check(*args)\n before_action(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end",
"title": ""
},
{
"docid": "bbf10addf74997baf94118c877e6685f",
"score": "0.7466742",
"text": "def skip_authorization_check(*args)\n self.before_filter(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end",
"title": ""
},
{
"docid": "bbf10addf74997baf94118c877e6685f",
"score": "0.7466742",
"text": "def skip_authorization_check(*args)\n self.before_filter(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end",
"title": ""
},
{
"docid": "f43ef08358edf73f9ed19d6f28493b0b",
"score": "0.7436669",
"text": "def skip_authorize(*names)\n skip_before_action(*names)\n skip_after_action(*names)\n skip_around_action(*names)\n end",
"title": ""
},
{
"docid": "dea7b19c1d9e65347a87e842a3f60d77",
"score": "0.7391524",
"text": "def skip_authorization\n end",
"title": ""
},
{
"docid": "a616683de1387d84ce039a4f664fc4cf",
"score": "0.7294882",
"text": "def skip_verify_authorized(**options)\n skip_after_action :verify_authorized, options\n end",
"title": ""
},
{
"docid": "ad15fd275012c18ffe19b7327dc268f8",
"score": "0.7229919",
"text": "def skip_authorization\n @_policy_authorized = true\n end",
"title": ""
},
{
"docid": "af02b3f5e266e1addbeea9be4fedec0a",
"score": "0.70478344",
"text": "def can_skip_auth\n self.class.can_skip_auth(params[:action].to_sym)\n end",
"title": ""
},
{
"docid": "a75484d2c1b437bcc31e1fdcb3361711",
"score": "0.6986556",
"text": "def skip_controller_authorization(opts = {})\n opts = { raise: false }.merge(opts) if Rails::VERSION::MAJOR >= 5\n skip_before_action :check_authorization, opts\n end",
"title": ""
},
{
"docid": "44eb28e976b087a7635a9adc582d283a",
"score": "0.6975947",
"text": "def skip_check_permissions(*args)\n prepend_before_action(*args) do |controller|\n controller.instance_variable_set(:@_permitted, true)\n end\n end",
"title": ""
},
{
"docid": "09f3b7b942e483dfe92bd1ecebff3e5c",
"score": "0.6947666",
"text": "def skip_authorization\n @_pundit_policy_authorized = :skipped\n end",
"title": ""
},
{
"docid": "403954c204b1c226de1ea5056011a570",
"score": "0.68677795",
"text": "def skip_authorization\n @_pundit_policy_authorized = true\n end",
"title": ""
},
{
"docid": "408002c81eb53cc78710bc1fb839a685",
"score": "0.6836136",
"text": "def skip_load_and_authorize_resource(*args)\n skip_load_resource(*args)\n skip_authorize_resource(*args)\n end",
"title": ""
},
{
"docid": "5b58675a8d5c35b9bd167c9ea955c2d1",
"score": "0.68293935",
"text": "def skip_all_authorization(opts = {})\n skip_controller_authorization opts\n around_action :disable_authorization, opts\n end",
"title": ""
},
{
"docid": "845ebf6b1ca6bb5bf145947626413c55",
"score": "0.6825322",
"text": "def skip_for_it_action\n current_action = params[:action]\n current_action == 'new' || current_action == 'edit' || current_action == 'create'\n end",
"title": ""
},
{
"docid": "011356b7a219632af683345081b36912",
"score": "0.6805873",
"text": "def unauthorized\n end",
"title": ""
},
{
"docid": "295da19e48fe139f59748b8d1a1976e7",
"score": "0.6770443",
"text": "def login_required\n # skip login check if action is not protected\n return true unless protect?(action_name)\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n # check if user is logged in and authorized\n return true if logged_in? and authorized?(current_user)\n \n # call overwriteable reaction to unauthorized access\n access_denied and return false \n end",
"title": ""
},
{
"docid": "6e867b80a563fe7c94e95029f86c3038",
"score": "0.6763476",
"text": "def show\n skip_authorization\n end",
"title": ""
},
{
"docid": "6e867b80a563fe7c94e95029f86c3038",
"score": "0.6763476",
"text": "def show\n skip_authorization\n end",
"title": ""
},
{
"docid": "6e867b80a563fe7c94e95029f86c3038",
"score": "0.6763476",
"text": "def show\n skip_authorization\n end",
"title": ""
},
{
"docid": "6e867b80a563fe7c94e95029f86c3038",
"score": "0.6763476",
"text": "def show\n skip_authorization\n end",
"title": ""
},
{
"docid": "6ca042171f2f3b727aaf1246fa5ee0a9",
"score": "0.6733156",
"text": "def authorize \n redirect_to :controller => 'admin', :action => 'login' unless logged_in?\n end",
"title": ""
},
{
"docid": "1b9d268bef058f00a77ef4d68404fa54",
"score": "0.67276365",
"text": "def unauthorized; end",
"title": ""
},
{
"docid": "784e0a7f824dfb479f7ad9327203308f",
"score": "0.6722967",
"text": "def needs_authenticate_user?\n except_actions = %w[index]\n !except_actions.include?(action_name)\n end",
"title": ""
},
{
"docid": "1368bac47b81338d579e8590a0191adb",
"score": "0.6697514",
"text": "def protect_action(*actions)\n before_filter :authenticate_url, :only => actions\n end",
"title": ""
},
{
"docid": "81b3b3c2a99f124c391d56d6e206fc50",
"score": "0.669744",
"text": "def process_action_authorize\n if skipped_authorize_action?\n access_denied(current_record, \"Do not have ability to #{action.inspect} [#{current_record.class.name}].\") unless can?(action, current_record)\n debug_message('<authorize action', \"authorizing skipped action #{action.inspect} on [#{current_record.class.name} id=#{current_record.id.inspect}].\") if debug?\n end\n end",
"title": ""
},
{
"docid": "b8173179ceeb5e80e9b784f7b0810920",
"score": "0.66907996",
"text": "def authorize\n return_unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "c3bf1ec4dcb2fce63d3548627187c7e6",
"score": "0.66820514",
"text": "def controller_actions_should_fail_if_not_logged_in(controller, opts={})\n except= opts[:except] || []\n actions_to_test= get_all_actions(controller).reject{ |a| except.include?(a) }\n actions_to_test += opts[:include] if opts[:include]\n actions_to_test.each do |a|\n get a\n response.should_not be_success\n response.should redirect_to(login_path)\n end\n end",
"title": ""
},
{
"docid": "fc8f2a675eda293ff27b3cc4b516cd05",
"score": "0.6676863",
"text": "def authorize\n redirect_to login_path unless current_user\n end",
"title": ""
},
{
"docid": "d1fbca429e939bec049f9aafb1a6b55f",
"score": "0.6653043",
"text": "def authorized\n redirect_to login_path unless logged_in?\n end",
"title": ""
},
{
"docid": "d1fbca429e939bec049f9aafb1a6b55f",
"score": "0.6653043",
"text": "def authorized\n redirect_to login_path unless logged_in?\n end",
"title": ""
},
{
"docid": "90bdbbdc4defcb4a4770605c28d8a43d",
"score": "0.6645286",
"text": "def authorize\nredirect_to '/login' unless current_user\nend",
"title": ""
},
{
"docid": "53c5b220c74a56c85b384ac7632c0802",
"score": "0.6641832",
"text": "def before_call\n authorize\n end",
"title": ""
},
{
"docid": "730477116dadc54961b853874293b623",
"score": "0.6623692",
"text": "def authorize\n redirect_to \"/login\" unless current_user\n end",
"title": ""
},
{
"docid": "730477116dadc54961b853874293b623",
"score": "0.6623692",
"text": "def authorize\n redirect_to \"/login\" unless current_user\n end",
"title": ""
},
{
"docid": "e758a10703a5385ccc7d357e77957e6e",
"score": "0.6623303",
"text": "def action_authorize!(space=record_authable)\n # Do not do any additional authorization if superuser.\n return\n return if current_user.superuser?\n end",
"title": ""
},
{
"docid": "1c6848f20c62bb6df2c2e1d831f7d875",
"score": "0.6606685",
"text": "def ignore_request_unless_permitted\n return if Article.can_edit?(@user)\n\n flash_notice(:permission_denied.t)\n redirect_to(articles_path)\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.6603611",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.6603611",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.6603611",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "50649a21ee062c3ed98f9f7a7cf3a3da",
"score": "0.65885985",
"text": "def authorize\n redirect_to '/login' unless current_user\n end",
"title": ""
},
{
"docid": "bc04eeef7215bf6d695b63e04fb8ac4a",
"score": "0.65679854",
"text": "def skipped_authorize_action?\n return true unless controller.class.respond_to?(:cancan_skipper) # authorize the action if does not have cancan skipper\n cancan_skipper = controller.class.cancan_skipper[:authorize]\n cancan_skipper.each do |key, values|\n return true if values.has_key?(:only) && [values[:only]].flatten.include?(action)\n return true if values.has_key?(:except) && ![values[:except]].flatten.include?(action)\n end\n false\n end",
"title": ""
},
{
"docid": "b2e8a26aaa4f36312fc4bfec01e2da20",
"score": "0.6551691",
"text": "def redirect_unauthorized!\n redirect_to not_authorized_path\n end",
"title": ""
},
{
"docid": "9e9dd29ae31a964bd107932f8fcce144",
"score": "0.6549971",
"text": "def action_allowed\n true\n end",
"title": ""
},
{
"docid": "7213c52acfcbda45cd5928bbdd181a8e",
"score": "0.6549254",
"text": "def require_no_authentication\n super unless params[:action] == 'edit'\n end",
"title": ""
},
{
"docid": "ab0e485f9467eacb64b905abfa26c648",
"score": "0.6544981",
"text": "def action_not_authorized\n flash[:alert] = 'You are not authorized to perform this action.'\n redirect_to(request.referrer || root_path)\n end",
"title": ""
},
{
"docid": "7a9e8ff10a817b9b6f94a7813b0f7b86",
"score": "0.6540228",
"text": "def authorized?\n unless logged_in? && current_account.admin == true\n render :action => 'unauthorized'\n end\n end",
"title": ""
},
{
"docid": "8350515a5bb1e700ea36e0c0d2ff7939",
"score": "0.6533582",
"text": "def authorize!(action, *args)\n authorize_only!(action, *args)\n authorize_called!\n end",
"title": ""
},
{
"docid": "9b9ffee8fad7595b58a12c18beaa4c3a",
"score": "0.6526808",
"text": "def authorize\n redirect_to root_path unless current_user\n end",
"title": ""
},
{
"docid": "9b9ffee8fad7595b58a12c18beaa4c3a",
"score": "0.6526808",
"text": "def authorize\n redirect_to root_path unless current_user\n end",
"title": ""
},
{
"docid": "e1666e52ac3bea743307f81f06886bf4",
"score": "0.6522416",
"text": "def authorize\n \tredirect_to login_path unless current_user\n end",
"title": ""
},
{
"docid": "58d30af2eb8f812ab322d9dc48774136",
"score": "0.6519331",
"text": "def before(action)\n\n resource = case action\n when :index, :new, :create\n model\n else object\n end\n\n if resource.respond_to? :token\n authorize! action, resource, session[:access_token]\n else\n authorize! action, resource\n end\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "144c9f191f0687ef9a2413fd032709a5",
"score": "0.6504717",
"text": "def authorized_user\n redirect_to root_path unless has_privilege?\n end",
"title": ""
},
{
"docid": "a6a0ff366092b1d14d3f54f6e4b06a9e",
"score": "0.65001065",
"text": "def create_authorized?\n false\n end",
"title": ""
},
{
"docid": "040db6f85e34fedd82b54dc22f454146",
"score": "0.64988256",
"text": "def unauthorized\n load_user\n end",
"title": ""
},
{
"docid": "ffe5a099a6cad4252e2858405f4e52d4",
"score": "0.6491536",
"text": "def authorization_filter!\n # this isn't a very good guess. Can we do better?\n resource_guess = self.class\n decision = get_authorization_with_args :for => current_user,\n :to => params[:action],\n :on => resource_guess,\n :context => params\n raise(decision||AccessDenied) if is_denial?(decision)\n decision\n end",
"title": ""
},
{
"docid": "af53892ee926f63ef97108be025963f4",
"score": "0.6487083",
"text": "def authorize\n redirect_to '/login' unless logged_in\n end",
"title": ""
},
{
"docid": "1e90b80bc659e987a1c3b0b4089ae231",
"score": "0.64836043",
"text": "def authorized\n render_status :unauthorized unless logged_in?\n end",
"title": ""
},
{
"docid": "40a427519caf99649b87d0322f101d72",
"score": "0.64800745",
"text": "def unauthorized\n end",
"title": ""
},
{
"docid": "c48fb14d9ef26c3558d37371bab3a58f",
"score": "0.64796925",
"text": "def authorize_destroy\n redirect_to index_url unless authorized_to_destroy?\n end",
"title": ""
},
{
"docid": "d060f836bef1dfd921fd3e4aa305b985",
"score": "0.6473722",
"text": "def login_required\n # skip login check if action is not protected\n return true unless protect?(action_name)\n\n # check if user is logged in and authorized\n return true if logged_in? and authorized?(current_user)\n \n # store current location so that we can \n # come back after the user logged in\n store_location\n \n # call overwriteable reaction to unauthorized access\n access_denied and return false\n end",
"title": ""
},
{
"docid": "2cc27e5a1546e50fd38496f41e950372",
"score": "0.64650047",
"text": "def login_required\n # skip login check if action is not protected\n return true unless protect?(action_name)\n\n # check if user is logged in and authorized\n return true if logged_in? and authorized?(current_user)\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n\n # call overwriteable reaction to unauthorized access\n access_denied and return false\n end",
"title": ""
},
{
"docid": "66e7084896028002eab6c19c73e9fea2",
"score": "0.6452109",
"text": "def proceed_to_action?\n\t\t@attributes_to_exclude = []\n\t\tif @action_permissions[\"requires_authentication\"] == \"no\"\n\t\t\tauthorize\n\t\telse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "595883c29ff4f46b0428fc1344263557",
"score": "0.6451663",
"text": "def authorize\n redirect_to root_path unless logged_in?\n end",
"title": ""
},
{
"docid": "72f55a927a4f186ddf47d1a90664a605",
"score": "0.6449192",
"text": "def authorized\n redirect_to \"/login\" unless logged_in?\n end",
"title": ""
},
{
"docid": "ebe4b88463578c105aa289640d2c163c",
"score": "0.6431562",
"text": "def require_user\n render_unauthorized unless signed_in?\n end",
"title": ""
},
{
"docid": "a8b476def9d0683a13b9e507298750e0",
"score": "0.64263594",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "a8b476def9d0683a13b9e507298750e0",
"score": "0.64263594",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "a8b476def9d0683a13b9e507298750e0",
"score": "0.64263594",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "a8b476def9d0683a13b9e507298750e0",
"score": "0.64263594",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "a8b476def9d0683a13b9e507298750e0",
"score": "0.64263594",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "1fcbaaad02bb955509ea4cfbcab83133",
"score": "0.6422174",
"text": "def authorize\n redirect_to login_url, alert: \"Not authorized\" if current_user.nil?\n end",
"title": ""
},
{
"docid": "1fcbaaad02bb955509ea4cfbcab83133",
"score": "0.6422174",
"text": "def authorize\n redirect_to login_url, alert: \"Not authorized\" if current_user.nil?\n end",
"title": ""
},
{
"docid": "fe8f483da6f442833d623e8cb416b822",
"score": "0.64217204",
"text": "def login_required\n \n if not protect?(action_name)\n return true \n end\n\n if user? and authorize?(session[:user])\n return true\n end\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n \n # call overwriteable reaction to unauthorized access\n access_denied #reason\n return false \n end",
"title": ""
},
{
"docid": "9b23f45bd4d9b4688f2c0aa20a91920d",
"score": "0.6415849",
"text": "def protected! ; halt 401 unless admin? ; end",
"title": ""
},
{
"docid": "36ced52e6cff9592291e38078da75768",
"score": "0.64151055",
"text": "def only_authorized; raise ParkPlace::AccessDenied unless @user end",
"title": ""
},
{
"docid": "e5204c35f3c5950773c84b789cffc089",
"score": "0.6404783",
"text": "def authorized\n render status: :unauthorized unless logged_in?\n end",
"title": ""
},
{
"docid": "2a79367a31cdf6190f535a370a3d822f",
"score": "0.6402962",
"text": "def protect?(action)\n true\n end",
"title": ""
},
{
"docid": "8381a422dab9a1e961f70c7078f06fe8",
"score": "0.6402927",
"text": "def authorize\n redirect_to new_session_path, alert: \"Not authorized. Kindly login to perform action.\" if current_user.nil?\n end",
"title": ""
},
{
"docid": "1a2de8d4205cc03b185bebe900f6cab7",
"score": "0.63932645",
"text": "def authorize_admin\n fake_object = false\n begin\n record = model_class.new\n rescue\n fake_object = true\n record = Object.new\n end\n unless params[:action].to_sym == :users && fake_object && can?(:manage, Spree::Order)\n authorize! params[:action].to_sym, record\n end\n end",
"title": ""
},
{
"docid": "c99f6a4ace4682a2aa1c36f06e4e0df3",
"score": "0.6379472",
"text": "def authorize\n super(parent[:controller], :back)\n end",
"title": ""
},
{
"docid": "c99f6a4ace4682a2aa1c36f06e4e0df3",
"score": "0.6379472",
"text": "def authorize\n super(parent[:controller], :back)\n end",
"title": ""
},
{
"docid": "c99f6a4ace4682a2aa1c36f06e4e0df3",
"score": "0.6379472",
"text": "def authorize\n super(parent[:controller], :back)\n end",
"title": ""
},
{
"docid": "31b79f54586c3184449233576aeae7a5",
"score": "0.6374106",
"text": "def kick_out_unauthorized?\n @unauthorized_allowed_actions = ['signup', 'login']\n \n if @unauthorized_allowed_actions.include?(params[:action]) then\n return\n end\n\n\n if not session.has_key?(\"admin_id\") then\n redirect_to :controller => 'admin', :action => 'login'\n end\n end",
"title": ""
},
{
"docid": "37c6ab02f9ab0c6c6aafb3c6396b0da3",
"score": "0.6370293",
"text": "def authorize!\n unless current_user\n redirect_to login_path\n end\n end",
"title": ""
},
{
"docid": "cfdc9de1c95d3abb32a31a7ac37aa220",
"score": "0.6367112",
"text": "def authorize_superficially(action)\n logger.debug 'ZeroAuthorizationMode: superficial. By passing authorization.'\n return true\n end",
"title": ""
},
{
"docid": "0d8b082fb9826e1452608be841a34501",
"score": "0.6364574",
"text": "def login_required\n access_denied unless logged_in?\n end",
"title": ""
},
{
"docid": "0d8b082fb9826e1452608be841a34501",
"score": "0.6364574",
"text": "def login_required\n access_denied unless logged_in?\n end",
"title": ""
},
{
"docid": "ac63e9780f5ce691545f8d6f633fcb20",
"score": "0.63485223",
"text": "def authorize_resource!\n unauthorized! unless can?(resource_action, controller_name.to_sym)\n end",
"title": ""
},
{
"docid": "6fc66e33c4fa3df2443a99dc75fd5909",
"score": "0.6348274",
"text": "def before_action(controller, context)\n end",
"title": ""
},
{
"docid": "d969f2512ce04357988694cdacc1e0e3",
"score": "0.63459784",
"text": "def authorize\n unless current_user\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "df6cfd57cd6edfc4e36ca12d01c8b006",
"score": "0.63453496",
"text": "def create\n authorize! :manage, :all\n end",
"title": ""
},
{
"docid": "401ec9e3a19a2a1a63ae6cd3f83d2a86",
"score": "0.63394",
"text": "def ensure_authorization_performed(options = {})\n after_filter(options.slice(:only, :except)) do |controller_instance|\n controller_instance.ensure_authorization_performed(options)\n end\n end",
"title": ""
},
{
"docid": "e9c3b375cab38bae37b96259f8da9ef0",
"score": "0.63366187",
"text": "def authorize\n \tredirect_to login_url, alert: \"Not authorized\" if current_user.nil?\n end",
"title": ""
}
] |
0e7543aa5712a98ab5df45cecbf60c17
|
Parses context and event info from JSON input
|
[
{
"docid": "fec8435b32df203ece7cb512874285d4",
"score": "0.75496304",
"text": "def parse_json_body(json)\n logger.info(\"Received:\\n#{json.to_s}\")\n data = JSON.parse(json)\n #Create Context\n context = context_from_json(data)\n #Create events\n events = events_from_json(data, context)\n logger.info(\"Structure (before):\\n#{context.print_structure}\")\n logger.info(\"Events: #{events.map { |e| e.type }.join(', ')}\")\n return context, events\n end",
"title": ""
}
] |
[
{
"docid": "7ea6fc8856f49c2effd786f7c8c31f2a",
"score": "0.7298893",
"text": "def parse_json_body(json)\n LOGGER.info(\"Parsing JSON:\")\n LOGGER.info(json.to_s)\n data = JSON.parse(json)\n #Create Context\n context = context_from_json(data)\n #Create events\n events = events_from_json(data)\n return context, events\n end",
"title": ""
},
{
"docid": "4f080b63f717795236049351142214fe",
"score": "0.6667821",
"text": "def parse(json)\n raw_context = super(json)\n @context.name = raw_context[\"name\"]\n @context.body = raw_context[\"body\"]\n @context.body_show = raw_context[\"body_show\"]\n @context.icon = raw_context[\"icon\"]\n @context\n end",
"title": ""
},
{
"docid": "8a6a2fc51749aa7d37d7c82556333fad",
"score": "0.6581312",
"text": "def parse(json)\n contexts = super(json)\n contexts.collect do |raw_context|\n context = Context.new\n context.id = raw_context[\"id\"]\n context.name = raw_context[\"name\"]\n context.count = raw_context[\"count\"]\n context.count = raw_context[\"icon\"]\n context\n end\n end",
"title": ""
},
{
"docid": "0c3e5989c460036cefe9ce8453ee6fa0",
"score": "0.6319293",
"text": "def extract_event\n if params[:event].class == ActiveSupport::HashWithIndifferentAccess\n params[:event]\n else\n _rc = {}\n JSON.parse(params[:event].to_s).each do |key, value|\n _rc[key.to_sym] = value\n end\n _rc\n end\n end",
"title": ""
},
{
"docid": "99731cfd4776232f4bcc8cc4495d0fd6",
"score": "0.6182954",
"text": "def from_json_parse(json, &block)\n # from_json will always return an array of item.\n # in the context of gelf, the payload should be an array of 1\n LogStash::Event.from_json(json).each { |event| decode_gelf(event, &block) }\n #LogStash::Event.from_json(json).each { |event| event }\n rescue LogStash::Json::ParserError => e\n logger.warn(PARSE_FAILURE_LOG_MESSAGE, :error => e, :data => json)\n end",
"title": ""
},
{
"docid": "65637c7ef3fb17b4207b0781e5725021",
"score": "0.6153768",
"text": "def cli_main(_args)\n log.info('Reading JSON event from STDIN...')\n event = JSON.parse(STDIN.read)\n process_event(event)\n end",
"title": ""
},
{
"docid": "65637c7ef3fb17b4207b0781e5725021",
"score": "0.6150535",
"text": "def cli_main(_args)\n log.info('Reading JSON event from STDIN...')\n event = JSON.parse(STDIN.read)\n process_event(event)\n end",
"title": ""
},
{
"docid": "3a1cb48c74d1ec56f6188a05e677991a",
"score": "0.61256415",
"text": "def parse(js)\n\t\t\tactor = js['actor_attributes']\n\t\t\treturn unless actor\n\n\t\t\tloc = actor['location']\n\t\t\treturn unless loc\n\t\t\tavatar = actor['gravatar_id']\n\t\t\treturn unless avatar\n\n\t\t\ttype = js['type']\n\t\t\tc = nil\n\t\t\tcase type\n\t\t\twhen 'CommitCommentEvent'\n\t\t\t\tbegin\n\t\t\t\t\tc = GitHubApi::SingleCommitComment.new(js['repository']['owner'], js['repository']['name'], js['payload']['comment_id'], auth: @auth)\n\t\t\t\trescue NoMethodError => e\t# undefined method `[]' for nil:NilClass\n\t\t\t\t\traise EventParseIgnorableError.new(e.message)\n\t\t\t\tend\n\t\t\t\tc.location = loc\n\t\t\t\tc.type = type\n\t\t\t\tc.avatar = avatar\n\t\t\t\t@api_queries << c\n\t\t\t\treturn\n\t\t\twhen 'CreateEvent'\n\t\t\t\tcomment = js['payload']['description']\n\t\t\t\ttimestamp = Time.parse(js['created_at'])\n\t\t\t\turl = js['url']\n\t\t\t\tyield Event.new(timestamp, comment, loc, url, type, avatar)\n\t\t\t\treturn\n\t\t\twhen 'DeleteEvent'\n\t\t\t\treturn\t# nothing interesting\n\t\t\twhen 'DownloadEvent'\n\t\t\t\tc = GitHubApi::Download.new(js['repository']['owner'], js['repository']['name'], js['payload']['id'], auth: @auth)\n\t\t\t\tc.location = loc\n\t\t\t\tc.type = type\n\t\t\t\tc.avatar = avatar\n\t\t\t\t@api_queries << c\n\t\t\t\treturn\n\t\t\twhen 'FollowEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'ForkEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'ForkApplyEvent'\n\t\t\t\treturn\t# no example found for now. I will come back later\n\t\t\twhen 'GistEvent'\n\t\t\t\tc = GitHubApi::Gist.new(js['payload']['id'], auth: @auth)\n\t\t\t\tc.timestamp = Time.parse(js['created_at'])\t# Some Gitsts don't have created_at property\n\t\t\t\tc.location = loc\n\t\t\t\tc.type = type\n\t\t\t\tc.avatar = avatar\n\t\t\t\t@api_queries << c\n\t\t\t\treturn\n\t\t\twhen 'GollumEvent'\n\t\t\t\treturn\t# ignore for now\n\t\t\twhen 'IssueCommentEvent'\n\t\t\t\treturn\t# could not find endpoint URL\n\t\t\twhen 'IssuesEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'MemberEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'PublicEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'PullRequestEvent'\n\t\t\t\tbegin\n\t\t\t\t\tc = GitHubApi::SinglePullRequest.new(js['repository']['owner'], js['repository']['name'], js['payload']['number'], auth: @auth)\n\t\t\t\trescue NoMethodError => e\t# undefined method `[]' for nil:NilClass\n\t\t\t\t\traise EventParseIgnorableError.new(e.message)\n\t\t\t\tend\n\t\t\t\tc.timestamp = Time.parse(js['created_at'])\t# Some PullRequests don't have created_at property\n\t\t\t\tc.location = loc\n\t\t\t\tc.type = type\n\t\t\t\tc.avatar = avatar\n\t\t\t\t@api_queries << c\n\t\t\t\treturn\n\t\t\twhen 'PullRequestReviewCommentEvent'\n\t\t\t\tcomment = js['payload']['comment']['body']\n\t\t\t\ttimestamp = Time.parse(js['created_at'])\n\t\t\t\turl = js['payload']['comment']['html_url']\n\t\t\t\tyield Event.new(timestamp, comment, loc, url, type, avatar)\n\t\t\t\treturn\n\t\t\twhen 'PushEvent'\n\t\t\t\treturn unless js['repository']\n\t\t\t\tjs['payload']['shas'].each do |sha, email, message, name, distinct|\n\t\t\t\t\tc = GitHubApi::Commit.new(js['repository']['owner'], js['repository']['name'], sha, auth: @auth)\n\t\t\t\t\tc.location = loc\n\t\t\t\t\tc.type = type\n\t\t\t\t\tc.avatar = avatar\n\t\t\t\t\t@api_queries << c\n\t\t\t\tend\n\t\t\t\treturn\n\t\t\twhen 'TeamAddEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\twhen 'WatchEvent'\n\t\t\t\treturn\t# emotions, if there are, are not from the event\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "a1c6d918e3690168fa3e73ac8fc4ad24",
"score": "0.60908353",
"text": "def process *args\n # context, scraped_at, identifier, page, moreinfo, json_str = args\n context, priority, identifier, page, moreinfo, url, scraped_at, *_ = args\n json_str = args.last\n return if context =~ /^bogus-/\n unless PARSER_FOR_CONTEXT[context]\n raise [args].flatten.join(\"\\t\")\n end\n parsed = PARSER_FOR_CONTEXT[context].new_from_json(json_str, context, scraped_at, identifier, page, moreinfo)\n unless parsed && parsed.healthy?\n bad_record!(context, scraped_at, identifier, page, moreinfo, json_str); return ;\n end\n #\n # output\n #\n parsed.each do |obj|\n puts obj.output_form\n end\n end",
"title": ""
},
{
"docid": "4999a92537ad56ac1e1aaea4d3080de4",
"score": "0.60857594",
"text": "def legacy_parse(json, &block)\n # ignore empty/blank lines which LogStash::Json#load returns as nil\n o = LogStash::Json.load(json)\n yield(LogStash::Event.new(o)) if o\n rescue LogStash::Json::ParserError\n yield LogStash::Event.new(\"message\" => json, \"tags\" => [\"_jsonparsefailure\"])\n end",
"title": ""
},
{
"docid": "a269fc23c5f5596985131c9eaf00b4ce",
"score": "0.6039567",
"text": "def legacy_parse(json, &block)\n # ignore empty/blank lines which LogStash::Json#load returns as nil\n o = LogStash::Json.load(json)\n decode_gelf(LogStash::Event.new(o), &block) if o\n rescue LogStash::Json::ParserError => e\n logger.warn(PARSE_FAILURE_LOG_MESSAGE, :error => e, :data => json)\n end",
"title": ""
},
{
"docid": "f4332c97c438c460e568230954dfc0a6",
"score": "0.6020844",
"text": "def from_json_parse(json, &block)\n LogStash::Event.from_json(json).each { |event| yield event }\n rescue LogStash::Json::ParserError\n yield LogStash::Event.new(\"message\" => json, \"tags\" => [\"_jsonparsefailure\"])\n end",
"title": ""
},
{
"docid": "73e9a97f5a57cde98f225224f22f7c34",
"score": "0.5994139",
"text": "def parse_event(event)\n name = @entity_coder.decode(event.search('title').text)\n meta = @entity_coder.decode(event.search('summary').text)\n time = get_time(meta)\n location = get_location(meta)\n \n return {:name => name, \n :start_time => time[0], \n :end_time => time[1],\n :location => location\n }\n end",
"title": ""
},
{
"docid": "4560a5e12e8400c3ab69b7328a1f55fc",
"score": "0.5976166",
"text": "def parse_events_from(request_body)\n json = JSON.parse(request_body)\n\n json['events'].map do |item|\n begin\n klass = Event.const_get(Util.camelize(item['type']))\n klass.new(item)\n rescue NameError\n Event::Base.new(item)\n end\n end\n end",
"title": ""
},
{
"docid": "3e90ea81d795c7057d2fc53abe89b089",
"score": "0.59218836",
"text": "def main(event, context)\n queryparams = event[\"query\"]\n body = event[\"body\"]\n\n {\n :statusCode => 200,\n :body => '{\"hello\":\"from Ruby2.4.1 function\"}'\n }\nend",
"title": ""
},
{
"docid": "ae21612f8189c23e6d17afdc9c3e6432",
"score": "0.59112626",
"text": "def extract(json)\n # Determine actor id.\n actor_id = nil\n if !json['actor'].nil?\n if !$actors.has_key?(json['actor'])\n $current_actor_id += 1\n $actors[json['actor']] = $current_actor_id\n end\n actor_id = $actors[json['actor']]\n end\n \n #payload = json.has_key?('payload') ? json['payload'] : nil\n #case json['type']\n #when 'CommitCommentEvent' then puts json; return nil #return [payload['user']['id'], {}]\n #end\n \n return [json['actor'], actor_id, {}]\nend",
"title": ""
},
{
"docid": "00e5b777d80c561baffcfe83beb3a1d4",
"score": "0.59049666",
"text": "def events(json)\n parser = JSON::Stream::Parser.new\n collector = Events.new(parser)\n begin\n json.each_char {|ch| parser << ch }\n rescue JSON::Stream::ParserError => e\n collector.error\n end\n collector.events\n end",
"title": ""
},
{
"docid": "6dd71000fc8d61e35200487a78259b75",
"score": "0.5878105",
"text": "def parse_json! json\n @start_time = Time.at(json['start']).to_datetime\n @stop_time = Time.at(json['stop']).to_datetime\n @url = json['url'] if json.key?('url')\n @channel_id = json['channelId'] if json.key?('channelId')\n @category = json['category'] if json.key?('category')\n @description = json['desc'] if json.key?('desc')\n @production_year = json['prodYear'] if json.key?('prodYear')\n @production_country = json['prodCountry'] if json.key?('prodCountry')\n @teaser = json['teaser'] if json.key?('teaser')\n @series_id = json['series_id'] if json.key?('seriesId')\n @series_info = json['series'] if json.key?('series')\n end",
"title": ""
},
{
"docid": "5a2668343837c90e3cd00a2491cb1ba0",
"score": "0.5754121",
"text": "def event_params\n JSON.parse(params['_json'])\n end",
"title": ""
},
{
"docid": "4fd4ab802bf9dd3c4f644665ac74dc17",
"score": "0.57112014",
"text": "def parse_event_info(ctx, node_td)\n if node_td.nil? then\n return nil\n end\n\n event_info = {}\n\n lines = node_td.children()\n lines.shift # skip first line\n\n title = node_td.xpath('./font[1]').text\n title = title.gsub(/\\r|\\n/, '')\n event_info['TITLE'] = title.strip\n\n lines.each do |l|\n info_line = l.text.strip\n if 0 == info_line.length then\n next\n end\n\n case info_line\n when /#{ctx['REGEX_PLAYERS']}/\n event_info['PLAYERS'] = $1.strip\n when /#{ctx['REGEX_PROGRAM']}/\n event_info['PROGRAM'] = $1.strip\n when /#{ctx['REGEX_CONTACT']}/\n event_info['CONTACT'] = $1.strip\n when /#{ctx['REGEX_FEE']}/\n event_info['FEE'] = $1.strip\n end\n end\n\n event_info['HALL'] = ctx['HALL']\n\n return event_info\nend",
"title": ""
},
{
"docid": "4fd4ab802bf9dd3c4f644665ac74dc17",
"score": "0.57112014",
"text": "def parse_event_info(ctx, node_td)\n if node_td.nil? then\n return nil\n end\n\n event_info = {}\n\n lines = node_td.children()\n lines.shift # skip first line\n\n title = node_td.xpath('./font[1]').text\n title = title.gsub(/\\r|\\n/, '')\n event_info['TITLE'] = title.strip\n\n lines.each do |l|\n info_line = l.text.strip\n if 0 == info_line.length then\n next\n end\n\n case info_line\n when /#{ctx['REGEX_PLAYERS']}/\n event_info['PLAYERS'] = $1.strip\n when /#{ctx['REGEX_PROGRAM']}/\n event_info['PROGRAM'] = $1.strip\n when /#{ctx['REGEX_CONTACT']}/\n event_info['CONTACT'] = $1.strip\n when /#{ctx['REGEX_FEE']}/\n event_info['FEE'] = $1.strip\n end\n end\n\n event_info['HALL'] = ctx['HALL']\n\n return event_info\nend",
"title": ""
},
{
"docid": "f66e44eedacd6d94dfd88a1ffe454276",
"score": "0.56923133",
"text": "def parse_socket_json(json:)\n case json['class']\n when 'DEVICE', 'DEVICES'\n # devices that are found, not needed\n when 'WATCH'\n # gps deamon is ready and will send other packets, not needed yet\n when 'TPV'\n # gps position\n # \"tag\"=>\"RMC\", # \"device\"=>\"/dev/ttyS0\", # \"mode\"=>3,\n # \"time\"=>\"2017-11-28T12:54:54.000Z\", # \"ept\"=>0.005, # \"lat\"=>52.368576667,\n # \"lon\"=>4.901715, # \"alt\"=>-6.2, # \"epx\"=>2.738, # \"epy\"=>3.5,\n # \"epv\"=>5.06, # \"track\"=>198.53, # \"speed\"=>0.19, # \"climb\"=>0.0,\n # \"eps\"=>7.0, # \"epc\"=>10.12\n if json['mode'] > 1\n #we have a 2d or 3d fix\n if is_new_measurement(json: json)\n json['time'] = DateTime.parse(json['time'])\n puts \"lat: #{json['lat']}, lng: #{json['lon']}, alt: #{json['alt']}, speed: #{json['speed']} at #{json['time']}, which is #{(Time.now - json['time'].to_time) * 1000}ms old\" if VERBOSE\n @json_pos_callback.call(json) if @json_pos_callback\n end\n end\n when 'SKY'\n # report on found satellites\n sats = json['satellites']\n if satellites_changed(sats: sats)\n puts \"found #{sats.length} satellites, of which #{sats.count{|sat| sat['used']}} are used\" if VERBOSE\n @json_sat_callback.call(sats) if @json_sat_callback\n end\n else\n puts \"hey...found unknow tag: #{json.inspect}\" if VERBOSE\n end\n @json_raw_callback.call(json) if @json_raw_callback\n end",
"title": ""
},
{
"docid": "7bebceba3421358fa23e7129bca1943b",
"score": "0.56662375",
"text": "def parse(event, request: nil)\n event.name\n end",
"title": ""
},
{
"docid": "d622dac52d9f73fbcef2932383cb1560",
"score": "0.5658684",
"text": "def parse_tapj_output\n @tapj_files.each do |f|\n File.open(f) do |io|\n io.each_line do |line|\n event = JSON.parse(line)\n case event[TAPJ_TYPE]\n when TAPJ_SUITE_TYPE, TAPJ_CASE_TYPE, TAPJ_TEST_TYPE\n yield event\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ae57a21d00c245bfead8019e14393be7",
"score": "0.5655336",
"text": "def parse_input\n @input = JSON.parse(@input)\n end",
"title": ""
},
{
"docid": "e3f5772ef0c8729ae88359b5e7747b3a",
"score": "0.56507456",
"text": "def extract_event_data(event)\n event_data = {\n :timestamp => event.object.lastTimestamp,\n :kind => event.object.involvedObject.kind,\n :name => event.object.involvedObject.name,\n :namespace => event.object.involvedObject.namespace,\n :reason => event.object.reason,\n :message => event.object.message,\n :uid => event.object.involvedObject.uid,\n :event_uid => event.object.metadata.uid,\n }\n\n unless event.object.involvedObject.fieldPath.nil?\n event_data[:fieldpath] = event.object.involvedObject.fieldPath\n end\n\n event_type_prefix = event_data[:kind].upcase\n\n # Handle event data for specific entities\n case event_data[:kind]\n when 'Node'\n event_data[:container_node_name] = event_data[:name]\n # Workaround for missing/useless node UID (#9600, https://github.com/kubernetes/kubernetes/issues/29289)\n if event_data[:uid].nil? || event_data[:uid] == event_data[:name]\n node = ContainerNode.find_by(:ems_id => @ems.id, :name => event_data[:name])\n event_data[:uid] = node.try!(:ems_ref)\n end\n when 'Pod'\n /^spec.containers{(?<container_name>.*)}$/ =~ event_data[:fieldpath]\n unless container_name.nil?\n event_data[:container_name] = container_name\n end\n event_data[:container_group_name] = event_data[:name]\n event_data[:container_namespace] = event_data[:namespace]\n when 'ReplicationController'\n event_type_prefix = \"REPLICATOR\"\n event_data[:container_replicator_name] = event_data[:name]\n event_data[:container_namespace] = event_data[:namespace]\n end\n\n event_data[:event_type] = \"#{event_type_prefix}_#{event_data[:reason].upcase}\"\n\n event_data\n end",
"title": ""
},
{
"docid": "d8a102b965e673ec5affe24b9e7032ef",
"score": "0.5647901",
"text": "def parse(params, event)\n merge_root = params.fetch(\"merge_root\", false)\n\n params.each do |field, parser|\n next if field == \"merge_root\"\n\n value = event.get(field)\n parsed = nil\n\n unless value.is_a?(String)\n @log.warn(\"field value cannot be parsed by #{parser}\") unless value.nil?\n next\n end\n\n value = event.get(field).strip\n\n if value.start_with?('{') and value.end_with?('}')\n parsed = JSON.load(value)\n end\n\n if parsed.nil?\n next\n end\n\n if merge_root\n parsed.each do |k, v|\n event.set(k, v)\n event.delete(field)\n end\n else\n event.set(field, parsed)\n end\n end\n end",
"title": ""
},
{
"docid": "590f3a64572166d769d2b0b4db4f6474",
"score": "0.56419104",
"text": "def json_parse(info)\n begin\n info.gsub!('\"update\"', '\"has_update\"')\n info.gsub!('\"none\"', 'false')\n info.gsub!('\"available\"', 'true')\n info.gsub!('\"security\"', 'true')\n output = JSON.parse(info)\n rescue JSON::ParserError\n say(\"<%= color('[stderr]:', :red) %> Error parsing json in #{current.dir}\")\n output = nil\n end\n end",
"title": ""
},
{
"docid": "92bd1d9d450e6d91399744dfc8c139f4",
"score": "0.5632369",
"text": "def unescape_json_context(context)\n context.each_with_object({}) do |(context_key, context_value) , new_context|\n if context_value =~ REGEXP_FOR_UNESCAPED_JSON\n new_context[context_key] = JSON.load(context_value.gsub('=>', ': '))\n else\n new_context[context_key] = context_value\n end\n new_context\n end\n end",
"title": ""
},
{
"docid": "ac8191a07212667eb116bbe054cb6b2d",
"score": "0.56214684",
"text": "def parse_event_fields(response)\n event_fields = attributes_to_hash(response, \"//customField\", \"id\", \"//listItem\", \"name\")\n end",
"title": ""
},
{
"docid": "96f3dd1bd4c50ae5efa732907a994870",
"score": "0.55805147",
"text": "def event_params\n ActiveModelSerializers::Deserialization.jsonapi_parse(params)\n end",
"title": ""
},
{
"docid": "053353df0bab7525ca8f1782eaee5f7f",
"score": "0.55589277",
"text": "def parse\n parse_event!\n parse_competitors!\n @event\n end",
"title": ""
},
{
"docid": "a953490f040992fbd20ccd11ca66bb4b",
"score": "0.55576456",
"text": "def handle_event(events)\n\n\t\tevents = JSON.parse(events)\n\n\t\tif events.key? ('direct_message_events')\n\n\t\t\tdm_events = events['direct_message_events']\n\n\t\t\tdm_events.each do |dm_event|\n\n\t\t\t\tif dm_event['type'] == 'message_create'\n\n\t\t\t\t\t#Is this a response? Test for the 'quick_reply_response' key.\n\t\t\t\t\tis_response = dm_event['message_create'] && dm_event['message_create']['message_data'] && dm_event['message_create']['message_data']['quick_reply_response']\n\n\t\t\t\t\tif is_response\n\t\t\t\t\t\thandle_quick_reply dm_event\n\t\t\t\t\telse\n\t\t\t\t\t\thandle_command dm_event\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tputs \"A unhandled DM type arrived via Twitter Account Activity API... \"\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tputs \"Hey, a unhandled Account Activity event has been send from the Twitter side... A new follower? A Tweet liked? \"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a90d47023ef9c8b1c73336282414be8d",
"score": "0.55492955",
"text": "def event_from_string(event_string)\n event = JSON.parse(event_string)\n HashWithIndifferentAccess.new(event) # Allow use of symbols or strings as keys\n end",
"title": ""
},
{
"docid": "cba4752ae4b81ac91c62049cd1961cff",
"score": "0.55419457",
"text": "def handle_event(request)\n request.body.rewind\n @manager.handle_event(JSON.parse(request.body.read))\n create_response({})\n end",
"title": ""
},
{
"docid": "690bd6302380fb986d293e045e70ff79",
"score": "0.5528762",
"text": "def _process_event(header, msg)\n hash = ActiveSupport::JSON.decode(msg)\n\n # Sanity check the message.\n if not hash.kind_of?(Hash)\n raise \"Invalid message type: \" + hash.class.to_s\n end\n\n # Decode the key.\n array = header.properties[:routing_key].split('.')\n\n # Figure out if a priority was supplied as the first\n # entry.\n if ((Integer(array[0]) rescue false) == false)\n # No priority found.\n object_name = array[0]\n action = array[1]\n remainder_index = 2\n else\n # Priority found.\n object_name = array[1]\n action = array[2]\n remainder_index = 3\n end\n\n # Sanity check the action.\n if (@@allowed_actions.rindex(action).nil?)\n raise \"Invalid action: \" + action.to_s\n end\n\n args = array.values_at(remainder_index..-1) \n eval(\"_\" + action.to_s + \"(nil, hash, args)\")\n\n # TODO: Delete this, eventually.\n #puts \"Output:\"\n pp hash\n\n return hash\n end",
"title": ""
},
{
"docid": "133b5daa06f7b458aa0b7a03c73a2614",
"score": "0.55225444",
"text": "def parse_event(event)\n fields = event.split(\"\\n\")\n return nil unless fields\n fields.map! { |f| f.split('=') }\n\n # Remove all the empty fields, they'll end up nil anyways\n fields.reject! { |f| f.length != 2 }\n\n # Create a hash, and fill it\n # Field names are all symbols\n result = {}\n fields.each { |f| result[f[0].to_sym] = f[1] }\n\n return result\nend",
"title": ""
},
{
"docid": "950de88d0be68837a52791ccbd829a80",
"score": "0.5513513",
"text": "def parse_json(json, type)\n story_array = []\n\n # Determine which hash in Mashable's JSON response to parse depending on parameter\n case type\n when \"new\"\n story_array = story_to_hash(json[\"new\"])\n when \"rising\"\n story_array = story_to_hash(json[\"rising\"])\n when \"hot\"\n story_array = story_to_hash(json[\"hot\"])\n end\n\n return story_array\n end",
"title": ""
},
{
"docid": "f28b9d62981dfd1fc173409b360837fc",
"score": "0.55023056",
"text": "def handle_raw_data(data)\n # Try convert to a JSON\n begin\n # All data is parsed to a JSON, making a ruby Hash\n data_hash = JSON.parse(data)\n # After parse, if can parse, handle the action method\n handle_actions(data_hash)\n rescue Exception => error\n # if cannot parse the JSON, show the error\n send_line \"What? I cannot understand you, bro!\"\n puts \"Error #{error.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "d042de32ea52d7456344d3bd252fc36a",
"score": "0.5497012",
"text": "def json_handler(key,answer)\n require 'rubygems'\n require 'json'\n JSON.parse(answer)[key]\n end",
"title": ""
},
{
"docid": "d042de32ea52d7456344d3bd252fc36a",
"score": "0.5497012",
"text": "def json_handler(key,answer)\n require 'rubygems'\n require 'json'\n JSON.parse(answer)[key]\n end",
"title": ""
},
{
"docid": "a32466c55469599ef8c31d09d53f5e9a",
"score": "0.5488114",
"text": "def parse_request request\n JSON.parse request.body.read\n end",
"title": ""
},
{
"docid": "f72987b2118884b449fc9171f6e3e307",
"score": "0.54818547",
"text": "def api event:, context:\n return process(event['queryStringParameters']['entry_id'], event['queryStringParameters']['reference_path'], event['queryStringParameters']['tag_path'])\nend",
"title": ""
},
{
"docid": "d90403c82b9471a8647cb950c8a4db25",
"score": "0.5478367",
"text": "def receive\n\t\t\t\tif data = @in.gets\n\t\t\t\t\tbegin\n\t\t\t\t\t\treturn JSON.parse(data, symbolize_names: true)\n\t\t\t\t\trescue\n\t\t\t\t\t\treturn {line: data}\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "175d0647d058e6864bdbfebd72e3a2ab",
"score": "0.5404914",
"text": "def parse_request\n \tputs request.body.read\n @json = JSON.parse(request.body.read)\n end",
"title": ""
},
{
"docid": "175d0647d058e6864bdbfebd72e3a2ab",
"score": "0.5404914",
"text": "def parse_request\n \tputs request.body.read\n @json = JSON.parse(request.body.read)\n end",
"title": ""
},
{
"docid": "65f051359f7811732dd5a8ecd0b5985f",
"score": "0.540143",
"text": "def parse(request)\n JSON.parse(request.body)\n end",
"title": ""
},
{
"docid": "287e5848fa4fd4a989f5455b70f51c46",
"score": "0.5399464",
"text": "def parse_request_body\n parse_json\n @object_hash[:json] = @parsed_json\n @stored_object = check_request\n end",
"title": ""
},
{
"docid": "910751d3903bc1dfc46f6c5a240b43f1",
"score": "0.5381621",
"text": "def parse_payload\n parsed = JSON.parse(@payload)\n @command = parsed['command'].to_s\n @arguments = parsed['arguments']\n rescue JSON::ParserError => e\n raise \"Error on parsing JSON: '#{e}'\"\n end",
"title": ""
},
{
"docid": "304c1da32f9f4efbcedd7b2fec4ad929",
"score": "0.5379262",
"text": "def data_normalized_to_events(data)\n json = JSON.parse(data)\n\n fields = fields_from_json(json)\n\n events = attrs_from_json(json).map{ |a| OpenStruct.new(a) }\n end",
"title": ""
},
{
"docid": "1ed670568021140895d0b8306e9685fe",
"score": "0.5378381",
"text": "def decode_args\n @json = JSON.parse(request.body.read)\n end",
"title": ""
},
{
"docid": "0518f0bfe310808d65d322c50465ac13",
"score": "0.53782594",
"text": "def extract(format, carrier)\n case format\n when OpenTracing::FORMAT_TEXT_MAP\n parse_context(carrier['uber-trace-id'])\n when OpenTracing::FORMAT_RACK\n parse_context(carrier['HTTP_UBER_TRACE_ID'])\n else\n warn \"Jaeger::Client with format #{format} is not supported yet\"\n nil\n end\n end",
"title": ""
},
{
"docid": "b07742246417c0e5f46ab28825ec8766",
"score": "0.53662497",
"text": "def parse(text)\n begin\n hash = JSON.parse(text)\n time = @time_parser.parse(hash[@time_key])\n yield time, hash\n rescue\n yield text\n end\n end",
"title": ""
},
{
"docid": "56aa6cc30dfef4ae5eda86c2b88b5f7a",
"score": "0.53644717",
"text": "def parse_event_data(event_data)\n if ((event_data[:type] == 376) || (event_data[:type] == 422)) && !@connected\n @connected = true\n process_callbacks(:connect, event_data)\n end\n\n process_callbacks(event_data[:type], event_data)\n end",
"title": ""
},
{
"docid": "070f55cdb7f13a21920892145611870c",
"score": "0.5363054",
"text": "def handle_message(event)\n LOGGER.info(\"Received message: #{event.data.inspect}\")\n parsed = JSON.parse(event.data)\n emit(parsed['op'], parsed)\n end",
"title": ""
},
{
"docid": "b42952f4630070d8275e626e51828a44",
"score": "0.5353791",
"text": "def hello(event:, context:)\n logger = Ougai::Logger.new(STDOUT)\n logger.info(\"Lambda invoked\", original_event: event)\n\n\n # Let's see what's in the message\n event['Records'].each do |record|\n encoded_message = record['kinesis']['data']\n decoded_message = Base64.decode64(encoded_message)\n logger.info(\"Raw message string\", message: decoded_message)\n begin\n message_as_json = JSON.parse(decoded_message)\n logger.info(\"Message as JSON\", message: message_as_json)\n rescue Exception => e\n logger.error(\"Invalid JSON string\", message: decoded_message)\n end\n end\nend",
"title": ""
},
{
"docid": "64553fdf95fdbfc6247124d3f00c2e44",
"score": "0.5353732",
"text": "def test_parse_valid_json_returns_hash\n name = \"A name\"\n type = \"A type\"\n json = \"{\\\"name\\\":\\\"#{name}\\\",\\\"type\\\":\\\"#{type}\\\"}\"\n parser = ChainReactor::Parsers::JsonParser.new get_logger\n cause = parser.parse(json,[],false)\n assert_equal name, cause['name']\n assert_equal type, cause['type']\n end",
"title": ""
},
{
"docid": "d82b495886f7a49993360a6bed118db3",
"score": "0.53534776",
"text": "def parse_and_record_events(body)\n events = EventsParser.new( JSON.parse(body) )\n events.record_all()\n end",
"title": ""
},
{
"docid": "cc049d1b0c566113cefc07546a713a15",
"score": "0.5344257",
"text": "def parse(input)\n begin\n output = (input.is_a?(Hash)) ? (input) : (JSON.parse(input))\n t = output['time']\n t = Time.now.strftime(@time_format) if t.nil?\n time = @time_parser.parse(t)\n yield time, output\n rescue\n yield input\n end\n end",
"title": ""
},
{
"docid": "e4ef2c09ebe56770e0ea4eeced5f8d69",
"score": "0.5335151",
"text": "def filter(event)\n # tag if field isn't present\n if event.get(@source_field).nil?\n event.tag(\"#{@source_field}_not_found\")\n return [event]\n end\n \n loadedjson = JSON.parse(event.get(@source_field))\n environment_id = loadedjson[\"logMessage\"][\"environment_id\"]\n app_name = loadedjson[\"logMessage\"][\"app\"][\"name\"]\n loadedjson[\"logMessage\"][\"app.org\"] = loadedjson[\"logMessage\"][\"app\"][\"org\"]\n loadedjson[\"logMessage\"][\"app.guid\"] = loadedjson[\"logMessage\"][\"app\"][\"guid\"]\n loadedjson[\"logMessage\"][\"app.name\"] = loadedjson[\"logMessage\"][\"app\"][\"name\"]\n loadedjson[\"logMessage\"][\"app.space\"] = loadedjson[\"logMessage\"][\"app\"][\"space\"]\n loadedjson[\"logMessage\"].delete(\"app\")\n event.set(\"environment_id\", environment_id)\n event.set(\"app_name\", app_name)\n event.set(\"message\", loadedjson.to_json)\n return [event]\n end",
"title": ""
},
{
"docid": "9fadb9ff14129998d1abdfd6c26e6a31",
"score": "0.532303",
"text": "def process_event(event)\n puts(\"#{event.id} - #{event.description}\")\nend",
"title": ""
},
{
"docid": "5c4512da642440261dc4654e96c98cb0",
"score": "0.5318689",
"text": "def read(obj)\r\n \r\n s, _ = RXFHelper.read(obj)\r\n \r\n h = JSON.parse(s, symbolize_names: true)\r\n \r\n lm = h[:interactionModel][:languageModel]\r\n lm[:invocationName]\r\n\r\n out = []\r\n out << 'invocation: ' + lm[:invocationName] + \"\\n\"\r\n puts lm[:intents].inspect if @debug\r\n \r\n lm[:intents].each do |intent|\r\n\r\n puts ('intent: ' + intent[:name].inspect).debug if @debug\r\n out << intent[:name] + \"\\n\"\r\n \r\n if intent[:samples] then\r\n \r\n intent[:samples].each do |utterance|\r\n puts 'utterance: ' + utterance.inspect if @debug\r\n out << \" \" + utterance\r\n end\r\n\r\n if intent[:slots] and intent[:slots].any? then\r\n\r\n out << \"\\n slots:\"\r\n\r\n intent[:slots].each do |slot|\r\n out << \" %s: %s\" % [slot[:name], slot[:type]]\r\n end\r\n\r\n end\r\n\r\n out << \"\\n\" if intent[:samples].any?\r\n end\r\n\r\n end\r\n\r\n if lm[:types] and lm[:types].any? then\r\n\r\n out << \"types:\"\r\n\r\n lm[:types].each do |type|\r\n \r\n values = type[:values].map do |x| \r\n \r\n synonyms = x[:name][:synonyms]\r\n val = x[:name][:value]\r\n val += ' (' + synonyms.join(', ') + ')' if synonyms and synonyms.any?\r\n val\r\n end\r\n \r\n out << \" %s: %s\" % [type[:name], values.join(', ')]\r\n end\r\n\r\n end\r\n out << \"\\n\"\r\n\r\n @s = out.join(\"\\n\")\r\n #parse(@s)\r\n self\r\n end",
"title": ""
},
{
"docid": "376fbd168de0fd4af7782c0be7068ef1",
"score": "0.5317282",
"text": "def event_param_error_response\n return {\n error: 'Parse error: check spelling, etc. Example:',\n event: {\n name: 'string, required',\n description: 'string, required',\n position: { address_city: 'string, required'},\n tags: [ { name: 'tags is optional' }, { name: 'this property can be omitted' } ]\n }\n }\n end",
"title": ""
},
{
"docid": "a7df33d38b11236bf3f96775fe055f2e",
"score": "0.5315452",
"text": "def parse line\r\n JSON.parse(line)\r\n end",
"title": ""
},
{
"docid": "e9cb90222932e2b466df77121666b396",
"score": "0.53135175",
"text": "def args_from_json\n begin\n return MultiJson.parse(self.args)\n rescue MultiJson::LoadError => ex\n end\n nil\n end",
"title": ""
},
{
"docid": "e9cb90222932e2b466df77121666b396",
"score": "0.53135175",
"text": "def args_from_json\n begin\n return MultiJson.parse(self.args)\n rescue MultiJson::LoadError => ex\n end\n nil\n end",
"title": ""
},
{
"docid": "434ae51dfcb0253d72ef067158e8e3f7",
"score": "0.5309648",
"text": "def parse(json_s)\n hash = JSON.parse(json_s)\n @submitter = hash[:submitter.to_s]\n @period = hash[:period.to_s]\n @random = hash[:random.to_s]\n end",
"title": ""
},
{
"docid": "a7437c100d637ee935b328dccd9026a4",
"score": "0.5308065",
"text": "def jsonToEvent(jsonObject)\r\n\t\t\t\t\r\n\t\t\t\tevent = Event.new\r\n\r\n\t\t\t\tif jsonObject.has_key?(\"id\")\r\n\t\t\t\t\tevent.setId(jsonObject[\"id\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"title\")\r\n\t\t\t\t\tevent.setTitle(jsonObject[\"title\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"location\")\r\n\t\t\t\t\tevent.setLocation(jsonObject[\"location\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"scheduled_on\")\r\n\t\t\t\t\tevent.setScheduledOn(jsonObject[\"scheduled_on\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"scheduled_on_long\")\r\n\t\t\t\t\tevent.setScheduledOnLong(jsonObject[\"scheduled_on_long\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"reminder\")\r\n\t\t\t\t\tevent.setReminder(jsonObject[\"reminder\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"repeat\")\r\n\t\t\t\t\tevent.setRepeat(jsonObject[\"repeat\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"occurrence(s)\")\r\n\t\t\t\t\tevent.setOccurrences(jsonObject[\"occurrence(s)\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"occurred\")\r\n\t\t\t\t\tevent.setOccurred(jsonObject[\"occurred\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"duration_hour\")\r\n\t\t\t\t\tevent.setDurationHours(jsonObject[\"duration_hour\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"duration_minutes\")\r\n\t\t\t\t\tevent.setDurationMinutes(jsonObject[\"duration_minutes\"])\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t\tif jsonObject.has_key?(\"participants\")\r\n\t\t\t\t\tparticipants = jsonObject[\"participants\"]\r\n\t\t\t\t\r\n\t\t\t\t\tparticipantList = Array.new\r\n\r\n\t\t\t\t\tfor j in 0...participants.length\r\n\t\t\t\t\t\tparticipant = participants[j]\r\n\t\t\t\t\t\tparticipantList.push(jsonToParticipant(participant))\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\tevent.setParticipants(participantList)\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t\treturn event\r\n\t\t\tend",
"title": ""
},
{
"docid": "467692ff06ceb01f68b000de9e1dab25",
"score": "0.5303219",
"text": "def parse_event(event, appCore)\n require 'securerandom'\n\n eh = event.attributes.to_h.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}\n \n eh.merge!({:eventuid => SecureRandom.uuid})\n\n new_event = ExecEvent.new(eh)\n \n # cross-verify event networking\n #netHash = appCore.get_network(new_event.network)\n #raise ArgumentError, \"event network label not defined #{new_event.network}\" if netHash.nil? || netHash.empty?\n\n # check for a valid ip address or pool name\n #begin\n # NetAddr.validate_ip_addr(event[:ipaddress])\n # new_event.ipaddress = event[:ipaddress]\n #rescue NetAddr::ValidationError => e\n raise ArgumentError, \"event ip addrress or pool name not valid: #{event[:ipaddress]}\" if !appCore.ipPools.member?(event[:ipaddress])\n new_event.ipaddress = event[:ipaddress]\n #end\n\n # Add scores to event\n event.find('score-atomic').each{ |score|\n token = {:succeed => true}\n case score.attributes[\"when\"]\n when 'success'\n token = {:succeed => true}\n when 'fail'\n token = {:succeed => false}\n end\n new_event.scores << token.merge( {:scoregroup => score.attributes[\"score-group\"],\n :value => score.attributes[\"points\"].to_f } )\n }\n\n #Support arbitrary parameter storage\n event.find('parameters/param').each { |param|\n new_event.attributes << { param.attributes[\"name\"] => param.attributes[\"value\"] }\n }\n \n return new_event\n end",
"title": ""
},
{
"docid": "4d1147cd9fcb3e6b924bcf4bd5b06da6",
"score": "0.53026974",
"text": "def parse_json(json)\n JSON.parse(json, :create_additions=>false)\n end",
"title": ""
},
{
"docid": "ceb069e4799df04473a0cb6901fb2fb2",
"score": "0.5293903",
"text": "def parse(text)\n begin\n text.gsub! '\\\"', '\"'\n text.gsub! '\\\\n', '\\n'\n text.gsub! '\\\\r', '\\r'\n hash = nil\n time = nil\n if text.start_with?('{') then\n begin\n hash = JSON.parse(text)\n time = @time_parser.parse(hash['time'])\n rescue => e\n puts \"parse failed #{e.message}\"\n hash = text\n end\n else\n hash = text\n end\n yield time, hash\n rescue => e\n puts \"parse failed #{e.message}\"\n yield text\n end\n end",
"title": ""
},
{
"docid": "b11007b3774d138b2ef86b72438f3779",
"score": "0.5291304",
"text": "def parse_me(json_obj)\n\n\n\n # Error handling remnant\n begin\n puts json_obj.inspect\n JSON.parse(json_obj)\n rescue JSON::ParserError, TypeError => e\n []\n end\n\n\n\n end",
"title": ""
},
{
"docid": "b1383d00ce03523a8489e4c46170abe1",
"score": "0.52736586",
"text": "def parse(json)\n res = super(json)\n res[\"key\"]\n end",
"title": ""
},
{
"docid": "b100c1bc12c4d71bc1abd975aa2038c6",
"score": "0.5273455",
"text": "def payload\n \n case request.headers[EVENT_HEADER]\n when \"issues\"\n event_handler_issues(params[:github_event])\n when \"issue_comment\"\n event_handler_issue_comment(params[:github_event])\n when \"pull_request\"\n event_handler_pull_request(params[:github_event])\n else \n render json: {\n :error => \"action not supported\"\n }, status: 400\n end\n\n end",
"title": ""
},
{
"docid": "51214a38f9bb1784c79a2d2ec1c61d8f",
"score": "0.5270538",
"text": "def context \n rc = {}\n return rc if events == nil || events.size == 0\n events.each_with_index do |e,i|\n if scheduled? \n rc[\"system\"] = :messaging_user \n rc[\"trigger\"] = get_timer_event_class\n break\n else\n ec = begin\n Rules::RulesConfig.event_config(e)[:context]\n rescue => e \n Rails.logger.error(\"Unable to get Event configuration for event [#{e}] - returned empty hash {}\")\n {}\n end\n if i == 0\n rc.merge!(ec) # start with the first event's context\n else\n rc.each do |field, metadata|\n if ec[field] == nil\n # this event did not have the field in question, so it should not be in our interesected context\n rc.delete field \n elsif ec[field] != rc[field]\n # if it is a trigger(x) type field, then don't delete it, but rather make it fall back to trigger(object)\n if field == \"trigger\"\n rc[field] = :object\n else\n rc.delete field # this event had the field, but it was a different type, it cannot be in our intersected context\n end\n end # if ec[field] == nil\n end # rc.each do |field, metadata|\n end # if i == 0\n end # if scheduled?\n end # events.each_with_index do |e,i|\n\n HashWithIndifferentAccess.new(rc)\n end",
"title": ""
},
{
"docid": "2b89e16e68c324013e1516996b1a5e57",
"score": "0.5264433",
"text": "def parse_and_record_events(body, event_name)\n events = SFDC::KMTracking::Events.new( JSON.parse(body), event_name )\n events.record_all()\n end",
"title": ""
},
{
"docid": "042f27b47305937a58dc0cb37f021a81",
"score": "0.5264051",
"text": "def parse_event(event, appCore)\n # Perform basic hash conversion\n eh = super\n \n new_event = DbEvent.new(eh)\n \n # Check if the :ipaddress field is included\n if eh.include?(:ipaddress)\n # Check if the pool specified exists and has a valid interface\n if !appCore.ipPools.member?(eh[:ipaddress]) \n raise ArgumentError, \"event ip address pool name not valid: #{eh[:ipaddress]}\"\n elsif appCore.ipPools[eh[:ipaddress]][:ifname] == nil\n $log.warn \"Event #{eh[:name]} uses ip address pool with no interface associated\".light_yellow\n end\n # Assign the pool name even if their is no interface ready\n new_event.ipaddress = eh[:ipaddress]\n else\n raise ArgumentError, \"event ip address pool name not defined\"\n end\n\n # Add scores to event\n event.find('score-atomic').each{ |score|\n token = {:succeed => true}\n case score.attributes[\"when\"]\n when 'success'\n token = {:succeed => true}\n when 'fail'\n token = {:succeed => false}\n end\n new_event.scores << token.merge( {:scoregroup => score.attributes[\"score-group\"],\n :value => score.attributes[\"points\"].to_f } )\n }\n\n #Support arbitrary parameter storage\n event.find('parameters/param').each { |param|\n new_event.attributes << { param.attributes[\"name\"] => param.attributes[\"value\"] }\n }\n\n #Specific entries in the command\n targetServer = event.find('server').first \n new_event.serverip = targetServer[\"ipaddress\"]\n new_event.serverport = targetServer[\"port\"]\n new_event.dbname = targetServer[\"dbname\"]\n new_event.dbuser = targetServer[\"username\"]\n new_event.dbpass = targetServer[\"password\"]\n\n event.find('action').each{ |action|\n if action[\"file\"] != nil\n new_event.actions << { file: action[\"file\"] }\n elsif action[\"sql\"] != nil\n new_event.actions << { sql: action[\"sql\"] }\n else\n $log.error \"invalid acion statement in #{event.name}\".red\n raise ArgumentError, \"invalid action statement for sql\"\n end\n }\n \n return new_event\n end",
"title": ""
},
{
"docid": "b58c78f0aaf66aaacec26745b4e4eb01",
"score": "0.52475715",
"text": "def load_json(json)\n @raw = JSON.load(json)\n\n @action = @raw['action']\n end",
"title": ""
},
{
"docid": "efef531a6f16b357d42dfa735d9fe383",
"score": "0.52472985",
"text": "def format_sidekiq_json_message_context\n if hash[:message].present?\n context = JSON.parse(hash[:message])['context']\n hash[:sidekiq_job_context] = hash[:message]\n hash[:message] = context\n end\n rescue JSON::ParserError\n nil\n end",
"title": ""
},
{
"docid": "9704ba931f6b61cb6bc3ff83ab502ba5",
"score": "0.5241167",
"text": "def extractJson(tag, time, record)\n\n message = record[\"message\"];\n\n begin\n json = JSON.parse(message);\n rescue\n return record; # Looks like the message isn't JSON after all.\n end\n \n record[\"json\"] = message; # Persist the original structured JSON\n\n if json.key?(\"message\")\n record[\"message\"] = json[\"message\"];\n elsif json.key?(\"msg\")\n record[\"message\"] = json[\"msg\"];\n end\n\n if json.key?(\"level\")\n record[\"level\"] = normalizeLevel(json[\"level\"]);\n else\n record[\"level\"] = \"other\";\n end\n\n # Handle timestamps\n\n begin\n\n date = nil;\n if json.key?(\"@timestamp\")\n date = json[\"@timestamp\"];\n elsif json.key?(\"timestamp\")\n date = json[\"timestamp\"];\n elsif json.key?(\"ts\")\n date = json[\"ts\"]\n end\n\n if !date.nil?\n if isNumeric(date)\n record[\"@timestamp\"] = formatTimestamp(Time.at(date.to_f));\n else\n record[\"@timestamp\"] = formatTimestamp(Time.parse(date));\n end\n else\n # Use the Fluentd injestion time.\n record[\"@timestamp\"] = formatTimestamp(Time.at(time));\n end\n \n return record;\n\n rescue\n\n # Handle any parsing errors by recording the Fluentd injestion time.\n\n record[\"@timestamp\"] = formatTimestamp(Time.at(time));\n return record;\n end\n end",
"title": ""
},
{
"docid": "6cfa9c7d4a33c146b3c4b09df44caa78",
"score": "0.5240327",
"text": "def process_input\n request_body = request.body.read\n if request_body[0] == \"{\" && request_body[-1] == \"}\"\n @_input = JSON.parse(request_body)\n else\n @_input = params\n end\n end",
"title": ""
},
{
"docid": "4c1184ae6979475c9ccf4ef8fdecc18c",
"score": "0.5239117",
"text": "def parse_json(con, json, dt, forg, frepo)\n h = JSON.parse json\n f = 0\n e = 0\n full_name = h['repo']['name']\n if repo_hit(full_name, forg, frepo)\n eid = h['id']\n if $json_out\n prt = JSON.pretty_generate(h)\n ofn = \"jsons/#{dt.to_i}_#{eid}.json\"\n File.write ofn, prt\n end\n if $db_out\n $ev[Thread.current.object_id] = h\n e = write_to_pg(con, h)\n $ev.delete(Thread.current.object_id)\n end\n puts \"Processed: '#{dt}' event: #{eid}\" if $debug >= 1\n f = 1\n end\n [f, e]\nend",
"title": ""
},
{
"docid": "c3c814016c98242455fa75393a78e229",
"score": "0.5235081",
"text": "def valid_event_json\n [\n {\n \"sg_message_id\" => \"sendgrid_internal_message_id\",\n \"email\" => \"[email protected]\",\n \"timestamp\" => 1337197600,\n \"smtp-id\" => \"<[email protected]>\",\n \"event\" => \"processed\"\n },\n {\n \"sg_message_id\" => \"sendgrid_internal_message_id\",\n \"email\" => \"[email protected]\",\n \"timestamp\" => 1337966815,\n \"category\" => \"newuser\",\n \"event\" => \"click\",\n \"url\" => \"https://sendgrid.com\"\n },\n {\n \"sg_message_id\" => \"sendgrid_internal_message_id\",\n \"email\" => \"[email protected]\",\n \"timestamp\" => 1337969592,\n \"smtp-id\" => \"<[email protected]>\",\n \"event\" => \"group_unsubscribe\",\n \"asm_group_id\" => 42\n }\n ].to_json\n end",
"title": ""
},
{
"docid": "18043355ce4a6b9f29eaf8c92aa838c3",
"score": "0.52218693",
"text": "def parse_event(event_type, event_data = {})\n if ((event_type == 376) || (event_type == 422)) && !@connected\n @connected = true\n process_callbacks(:connect, event_data)\n end\n\n process_callbacks(event_type, event_data)\n end",
"title": ""
},
{
"docid": "e4dc9568ff3339406c99b210e3cd2a3e",
"score": "0.5221863",
"text": "def context\n payload[:context]\n end",
"title": ""
},
{
"docid": "41a825cf4d014785bb5b8ef0f90970fc",
"score": "0.5207856",
"text": "def parse_request\n @json = JSON.parse(request.body.read)\n end",
"title": ""
},
{
"docid": "8db28cd6ceed1d34da8f7ac7247d0493",
"score": "0.5205139",
"text": "def lambda_handler(event:, context:)\n info = {\n 'event' => event,\n 'ENV' => ENV.to_hash,\n 'context' => context.instance_variables.each_with_object({}) { |k, h| h[k] = context.instance_variable_get k },\n 'ps aux' => `bash -O extglob -c 'for cmd in /proc/+([0-9])/cmdline; do echo $cmd; xargs -n 1 -0 < $cmd; done'`,\n 'proc environ' => `xargs -n 1 -0 < /proc/1/environ`,\n }\n\n pp info\n\n return info\nend",
"title": ""
},
{
"docid": "db7a211fd862f114b669b2b9323721ba",
"score": "0.51994175",
"text": "def parse()\n if !File.exist?(\"./lib/command-food-app/#{@mod}/#{@path}\")\n puts \"Error: ./lib/command-food-app/#{@mod}/#{@path} does not exist\"\n return {}\n end\n\n \t\tfile = File.open(\"./lib/command-food-app/#{@mod}/#{@path}\", \"rb\")\n\t\t contents = file.read\n\t\t file.close\n\t\t contents = JSON.parse(contents)\n\n\t return contents\n end",
"title": ""
},
{
"docid": "c8f7de33ffca9dffa4a5a7d83ada3336",
"score": "0.5199244",
"text": "def parse_event(event, appCore)\n # Perform basic hash conversion\n eh = super\n \n new_event = ScpEvent.new(eh)\n \n # Check if the :ipaddress field is included\n if eh.include?(:ipaddress)\n # Check if the pool specified exists and has a valid interface\n if !appCore.ipPools.member?(eh[:ipaddress]) \n raise ArgumentError, \"event ip address pool name not valid: #{eh[:ipaddress]}\"\n elsif appCore.ipPools[eh[:ipaddress]][:ifname] == nil\n $log.warn \"Event #{eh[:name]} uses ip address pool with no interface associated\".light_yellow\n end\n # Assign the pool name even if their is no interface ready\n new_event.ipaddress = eh[:ipaddress]\n else\n raise ArgumentError, \"event ip address pool name not defined\"\n end\n\n # Add scores to event\n event.find('score-atomic').each{ |score|\n token = {:succeed => true}\n case score.attributes[\"when\"]\n when 'success'\n token = {:succeed => true}\n when 'fail'\n token = {:succeed => false}\n end\n new_event.scores << token.merge( {:scoregroup => score.attributes[\"score-group\"],\n :value => score.attributes[\"points\"].to_f } )\n }\n\n #Support arbitrary parameter storage\n event.find('parameters/param').each { |param|\n new_event.attributes << { param.attributes[\"name\"] => param.attributes[\"value\"] }\n }\n\n #Specific entries in the command\n targetServer = event.find('server').first \n new_event.serverip = targetServer[\"ipaddress\"]\n new_event.serverport = targetServer[\"port\"]\n new_event.serveruser = targetServer[\"username\"]\n new_event.serverpass = targetServer[\"password\"]\n\n event.find('upload').each{ |upload|\n new_event.uploads << { source: upload[\"local\"], dest: upload[\"remote\"] }\n }\n event.find('download').each{ |download|\n new_event.downloads << { source: download[\"remote\"], dest: download[\"local\"] }\n }\n \n return new_event\n end",
"title": ""
},
{
"docid": "53db75f58e48a4b50d899fd5fc67ec87",
"score": "0.5196516",
"text": "def context\n JsonapiCompliable.context[:object]\n end",
"title": ""
},
{
"docid": "b4fd133f09417b6e3ac4f6765096c73e",
"score": "0.51946384",
"text": "def from_json(json_data)\n\t\th_temp = JSON.parse(json_data)\n\t\t@basePath = h_temp['basePath']\n\t\t@infoList = h_temp['infoList'].map { |fi|\n\t\t\t{\n\t\t\t\t:status => fi['status'],\n\t\t\t\t:action => fi['action'],\n\t\t\t\t:filename => fi['filename'],\n\t\t\t\t:path => fi['path'],\n\t\t\t\t:size => fi['size'],\n\t\t\t\t:checksum => fi['checksum']\n\t\t\t}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "9cd22b70ad2d245e2ce74e4d91b74d61",
"score": "0.5193217",
"text": "def process_fields(event)\n h = Hash.new\n h[:url] = event['event_url']\n h[:event_title] = clean_title(event['name'])\n\n h[:group] = event['group']\n\n h[:city] = ''\n\n if event['venue'].nil?\n address = ''\n glink = ''\n else\n address, glink = build_address(event['venue'])\n h[:city] = event['venue']['city']\n end\n\n h[:address] = address\n h[:glink] = glink\n\n if event['description'].nil?\n h[:desc] = ''\n else\n h[:desc] = filter_description(event['description'],\n 'Read more about this Meetup',\n h[:url])\n end\n\n photo = ''\n if event['photos']\n img = event_photo(event['photos'])\n photo = \"<a class=\\\"event-photo-link\\\" href=\\\"#{h[:url]}\\\">#{img}</a>\"\n end\n h[:photo] = photo\n h[:time] = event_date(event)\n h[:formatted_time] = format_date(h[:time])\n h\nend",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
},
{
"docid": "ca9c1a8ca08baaac17620d74ad340663",
"score": "0.51904225",
"text": "def parse\n parse_ems_event_targets(ems_event)\n end",
"title": ""
}
] |
de63c2f1dfd767927f9bbd5950e72995
|
Creates a Filter object indicating that the value of a particular attribute must begin with a particular string. The attribute value is escaped, so the "" character is interpreted literally.
|
[
{
"docid": "01aab02b8ef8cbd1b529b4c7bd031a27",
"score": "0.6412583",
"text": "def begins(attribute, value)\n new(:eq, attribute, escape(value) + \"*\")\n end",
"title": ""
}
] |
[
{
"docid": "8d8e5dfd97d2c54dc535f8036c4f7513",
"score": "0.6612641",
"text": "def filter(value)\n !case_sensitive? && value ? /\\A#{Regexp.escape(value.to_s)}\\z/i : value\n end",
"title": ""
},
{
"docid": "341724e133b9af184cfc4c91273ac7fa",
"score": "0.62880296",
"text": "def begins_with(value)\n ObjectFilterOperation.new('^=', value)\n end",
"title": ""
},
{
"docid": "fc97e73b139d5da3a3b099b5ec06f34e",
"score": "0.610486",
"text": "def with(attribute, value)\n @client.filters << Riddle::Client::Filter.new(attribute.to_s, value,\n false)\n end",
"title": ""
},
{
"docid": "79baaf54a696430c149a451cd4f23f1a",
"score": "0.61034006",
"text": "def filter string\n end",
"title": ""
},
{
"docid": "59690ec2c3173bf25b982d7a68b190ff",
"score": "0.6063205",
"text": "def filter_attributes=(attribs)\n self.filter = attribs[:str].blank? ? nil : Search::Search.new(attribs)\n end",
"title": ""
},
{
"docid": "cac2bc972d600b65079a910b99a81014",
"score": "0.6061247",
"text": "def filter_by_normalized(attr)\n normalized_name = (attr.to_s + '_normalized').to_sym\n scope \"filter_with_#{attr}\", lambda { |value|\n where(normalized_name => Regexp.new(Regexp.escape(I18n.transliterate(value)), 'i'))\n }\n end",
"title": ""
},
{
"docid": "ee99dbe691ee60b3e4cb278e7f455ab9",
"score": "0.60586286",
"text": "def filter_one_attribute(obj, attr, value)\n filters = lookup_filter(attr)\n if filters\n filters.each do |p|\n value = case p\n when Symbol\n obj.send(p, attr, value)\n when String\n obj.send(p.to_sym, attr, value)\n when Proc\n p.call(obj, attr, value)\n else\n raise \"internal error: bad attribute filter class #{p.class}\"\n end\n end\n end\n\n value\n end",
"title": ""
},
{
"docid": "9425035f588c3bd5abe3390871b91ef6",
"score": "0.60442895",
"text": "def filter=(value)\n # nil and false disable the filter\n return @filter = false unless value # rubocop:disable Lint/ReturnInVoidContext\n\n @filter = value.to_s.downcase\n end",
"title": ""
},
{
"docid": "1da140ef47da87e39da475be154cd948",
"score": "0.6013085",
"text": "def contains(attribute, value)\n new(:eq, attribute, \"*\" + escape(value) + \"*\")\n end",
"title": ""
},
{
"docid": "5f40e382a21a216ed0891c0bfd64dc46",
"score": "0.59857154",
"text": "def parse_filter_value(filter, value)\n return filter[:parse].call(value) if filter[:parse]\n return nil if value.blank? && !filter[:required]\n Effective::Attribute.new(filter[:as] || filter[:value] || :string).parse(value, name: filter[:name])\n end",
"title": ""
},
{
"docid": "6a4cddfea9e2180573e2da43f8cc404d",
"score": "0.5948592",
"text": "def define_filtered_attr_writer(attribute, filter)\n define_method(\"#{attribute}=\") do |value|\n result =\n case filter\n when Symbol\n value.respond_to?(filter) ? value.send(filter) : value\n when Regexp\n value.respond_to?(:gsub) ? value.gsub(filter, '') : value\n when Proc\n filter.call(value)\n else # nil\n end\n\n if defined?(super)\n super(result)\n else\n # Required for non-column attributes:\n instance_variable_set(\"@#{attribute}\".to_sym, result)\n write_attribute(attribute.to_sym, result)\n end\n end\n end",
"title": ""
},
{
"docid": "c2517f98b1019d6c011927a7a9528c0e",
"score": "0.59416807",
"text": "def jsonapi_filter(attr, description = nil)\n description ||= \"#{attr.to_s.tr('_', ' ')} filter\"\n\n define_parameter attr, desc: description, scope: :filter\n end",
"title": ""
},
{
"docid": "c2517f98b1019d6c011927a7a9528c0e",
"score": "0.59416807",
"text": "def jsonapi_filter(attr, description = nil)\n description ||= \"#{attr.to_s.tr('_', ' ')} filter\"\n\n define_parameter attr, desc: description, scope: :filter\n end",
"title": ""
},
{
"docid": "decfd86aa6b3107ac56115348dfec6e7",
"score": "0.59377456",
"text": "def filter_by_normalized(attr)\n normalized_name = (attr.to_s + '_normalized').to_sym\n adapter_name = ActiveRecord::Base.connection.adapter_name.downcase\n\n body =\n if adapter_name.starts_with?('postgresql')\n lambda { |value|\n where(\"unaccent(#{attr}) ILIKE unaccent(?)\", \"%#{sanitize_sql_like(value)}%\")\n }\n else\n lambda { |value|\n where(\"#{attr} LIKE ?\", \"%#{sanitize_sql_like(value)}%\")\n }\n end\n\n scope \"filter_with_#{normalized_name}\", body\n end",
"title": ""
},
{
"docid": "d93270b97dff02f991d0c61cf136197b",
"score": "0.59143126",
"text": "def filter\n @filter_string\n end",
"title": ""
},
{
"docid": "0b2c4eabd326be68de0265a42b8028d7",
"score": "0.58642834",
"text": "def filter= value\n # nil and false disable the filter\n return @filter = false unless value\n @filter = value.to_s.downcase\n end",
"title": ""
},
{
"docid": "beb6a1fa0075891bea032c609bfffc28",
"score": "0.5738581",
"text": "def have_attribute(attribute)\n match(/(?<=\\A|\\s)#{Regexp.escape(attribute)}(?=\\z|\\s)/)\n end",
"title": ""
},
{
"docid": "b3a8139281611569a6aed0a0cc9a453f",
"score": "0.57228106",
"text": "def where_regex(attr, value)\n where(\"#{qualified_column_for(attr)} ~ ?\", \"(?e)\" + value)\n end",
"title": ""
},
{
"docid": "ac73fc513e291de335ba451a143da01c",
"score": "0.56919754",
"text": "def inclusion_filter=(filter); end",
"title": ""
},
{
"docid": "96f9f20d12d2b42bbcf0202e930a313f",
"score": "0.5660874",
"text": "def filter(line)\n begin\n filter_str = line.split(' ')[2..-1].join(' ')\n filter = eval filter_str\n filter = \"/#{filter_str}/\" unless filter.kind_of?(Regexp) || filter_str.nil? || filter_str.empty?\n return filter\n rescue\n /#{filter_str}/ unless filter_str.nil? || filter_str.empty?\n end\n end",
"title": ""
},
{
"docid": "585d3fb486732671349eff8751015c4c",
"score": "0.56131864",
"text": "def quoted_string_value_constraint(attr_name)\n @_ts[attr_name] << AttributeConstraint.new(\n \"Value for #{@_ts.name}##{attr_name} must be in matching quotes\") do | attr |\n %w(' \").include?(attr.value[0]) && %w(' \").include?(attr.value[-1]) &&\n attr.value[0] == attr.value[-1]\n end\n end",
"title": ""
},
{
"docid": "1ba5aaa187a8dd45285269ffc36d1d67",
"score": "0.5572496",
"text": "def is(value)\n ObjectFilterOperation.new('_=', value)\n end",
"title": ""
},
{
"docid": "fa97ded658442ee49968a6884c679534",
"score": "0.5568262",
"text": "def SetFilter(attribute, values, exclude = false)\r\n assert { attribute.instance_of? String }\r\n assert { values.instance_of? Array }\r\n assert { !values.empty? }\r\n\r\n if values.instance_of?(Array) && values.size > 0\r\n values.each do |value|\r\n assert { value.instance_of? Fixnum }\r\n end\r\n \r\n @filters << { 'attr' => attribute, 'exclude' => exclude, 'values' => values }\r\n end\r\n end",
"title": ""
},
{
"docid": "6cc599e37e5973832dfbef3ea6f67cba",
"score": "0.55674094",
"text": "def set_filter(attr, values)\n @filter[attr] = values\n end",
"title": ""
},
{
"docid": "e9132f7ad41fa631d142a4fede4634c3",
"score": "0.55340147",
"text": "def compile_string_literal(node)\n if node.parts.empty?\n ->(attribute) { \"\" === attribute }\n elsif (value = extract_string(node))\n ->(attribute) { value === attribute }\n else\n compile_error(node)\n end\n end",
"title": ""
},
{
"docid": "1f7e212e905fb2804fea0173c58bdaea",
"score": "0.55028903",
"text": "def escape_attribute(string)\n URI.escape(string, UNSAFE_ATTRIBUTE)\n end",
"title": ""
},
{
"docid": "d2a7e8094d37aec750343790bc35b0b6",
"score": "0.5494081",
"text": "def filter_proc_from_string(filter)\n normalized_exclusion_list = filter.split.map(&:downcase)\n ->(token) {\n normalized_exclusion_list.include?(token)\n }\n end",
"title": ""
},
{
"docid": "fb92169f72273165267f5f28fae3915a",
"score": "0.5487217",
"text": "def filter( filter_str )\n # TODO how to access helper method\n # sanitize_term(self, self.taxonomy, filter_str )\n end",
"title": ""
},
{
"docid": "a81b573a2b1692ddead1b94eaa0dcb87",
"score": "0.548531",
"text": "def initialize(filterer, filtered) # a filter instance is instantiated with 2 string attributes\n @filterer = filterer\n @filtered = filtered\n end",
"title": ""
},
{
"docid": "61094f7890b8fd94ab4b64f445f88e1e",
"score": "0.5473011",
"text": "def attribute_match(equality, value)\n regexp = value.is_a?(Regexp) ? value : Regexp.escape(value.to_s)\n case equality\n when \"=\" then\n # Match the attribute value in full\n Regexp.new(\"^#{regexp}$\")\n when \"~=\" then\n # Match a space-separated word within the attribute value\n Regexp.new(\"(^|\\s)#{regexp}($|\\s)\")\n when \"^=\"\n # Match the beginning of the attribute value\n Regexp.new(\"^#{regexp}\")\n when \"$=\"\n # Match the end of the attribute value\n Regexp.new(\"#{regexp}$\")\n when \"*=\"\n # Match substring of the attribute value\n regexp.is_a?(Regexp) ? regexp : Regexp.new(regexp)\n when \"|=\" then\n # Match the first space-separated item of the attribute value\n Regexp.new(\"^#{regexp}($|\\s)\")\n else\n raise InvalidSelectorError, \"Invalid operation/value\" unless value.empty?\n # Match all attributes values (existence check)\n //\n end\n end",
"title": ""
},
{
"docid": "394f25acaeedf0c23abe9d4950d4dbe6",
"score": "0.5466527",
"text": "def attribute_filtering_params\n params[:attr] ? params[:attr].map(&:to_sym) : nil\n end",
"title": ""
},
{
"docid": "e0a2bf7e6a06abf24a102bb0c59e52c5",
"score": "0.5456965",
"text": "def nagmk_filter_from_str(filter_str)\n predicates = filter_str.strip.match(/^(Filter: )?(\\S+) (\\S+) ?([\\S ]+)?$/)\n if predicates\n return nagmk_filter(predicates[2], predicates[3], predicates[4])\n end\n \n raise QueryException.new(\"Can't create filter because the expression doesn't match /^(Filter: )?(\\S+) (\\S+) ?([\\S ]+)?$/\")\n end",
"title": ""
},
{
"docid": "7aed8b9c52cc826b9dfb683501118da7",
"score": "0.54480237",
"text": "def string_matchers()\n [/\"([^\\\\\"]|\\\\\"|\\\\)*\"/]\n end",
"title": ""
},
{
"docid": "1f14a714108ab51cf30883a4c2a33c2a",
"score": "0.54391116",
"text": "def attribute_filtering_params\n params[:attr] ? Array(params[:attr]).map(&:to_sym) : nil\n end",
"title": ""
},
{
"docid": "345827c905c7affed9e2d8a4e90d49e7",
"score": "0.5430681",
"text": "def setter_filter(attribute_name, value, options)\n value\n end",
"title": ""
},
{
"docid": "f02eeac1e761f5a2891eb68548ba5df4",
"score": "0.5423721",
"text": "def attribute_exact_facet(attribute = nil)\n a = attribute.to_sym\n return nil if send(a).blank?\n if send(\"exact_#{a}\".to_sym)\n\n # TODO: Think we need to handle ' and '\n\n v = send(a)\n v.gsub!(/\\s+/, ' ')\n v = ::Regexp.escape(v)\n v.gsub!(/\\\\\\s+/, '\\s*') # spaces are escaped, but we need to expand them in case we dont' get them caught\n v = '^\\s*' + v + '\\s*$'\n\n table[a].matches_regexp(v)\n else\n table[a].matches('%' + send(a).strip.gsub(/\\s+/, '%') + '%')\n end\n end",
"title": ""
},
{
"docid": "f922ca2760bbf146086cc602ba72caad",
"score": "0.5397065",
"text": "def filter(value)\n merge(amfilter: value.to_s)\n end",
"title": ""
},
{
"docid": "5de1829c5ecab6355ee0befdc88a059b",
"score": "0.53913385",
"text": "def construct(ldap_filter_string)\n FilterParser.parse(ldap_filter_string)\n end",
"title": ""
},
{
"docid": "c15d5c9df84472395aa7abf7f81e0aa6",
"score": "0.53831565",
"text": "def SetFilter(attribute, values, exclude = false)\n Lib.sphinx_add_filter(@sphinx, attribute, values.length, values, exclude)\n end",
"title": ""
},
{
"docid": "693dab6734d4f43ac07cca44b9dc1063",
"score": "0.53378844",
"text": "def query_for(attr, val)\n config = config_for(attr)\n return nil if config.nil?\n parser = FilterParser.new(attr, val, model, config)\n parser.to_query\n end",
"title": ""
},
{
"docid": "ffd991a26ea911a38dbb0780ef7371f8",
"score": "0.5333526",
"text": "def filter\n\n @attributes['__filter__']\n end",
"title": ""
},
{
"docid": "6a46ec0128ef8a3cfd9bfbc5f1e2f3fd",
"score": "0.53203684",
"text": "def filter= (f)\n\n f ? @attributes['__filter__'] = f : @attributes.delete('__filter__')\n end",
"title": ""
},
{
"docid": "671ce4e3a53d899656fa3f8b4f2fbfc7",
"score": "0.5315481",
"text": "def filter name, operator, value\n Filter.new name, operator, value\n end",
"title": ""
},
{
"docid": "26afb0cdd48b6ee267bc60e579a60632",
"score": "0.5301625",
"text": "def filter_text\n attributes.fetch(:filterText)\n end",
"title": ""
},
{
"docid": "26afb0cdd48b6ee267bc60e579a60632",
"score": "0.5301625",
"text": "def filter_text\n attributes.fetch(:filterText)\n end",
"title": ""
},
{
"docid": "3abf4025d813bc4bb82ac18c76d22c95",
"score": "0.5276349",
"text": "def search(attribute: , search_string:)\n where(\"#{attribute} ILIKE ?\", \"%#{search_string}%\")\n end",
"title": ""
},
{
"docid": "1d79b7312a42b7f273b8161e85c1e0a8",
"score": "0.52494305",
"text": "def nagmk_filter(name, comparator, value)\n Nagios::MkLiveStatus::Filter::Attr.new(name, comparator, value)\n end",
"title": ""
},
{
"docid": "eb36d24f72956b098866f2756644301b",
"score": "0.52288985",
"text": "def clean_filter(value)\n value = @filters[value] if value.is_a? Symbol\n ActiveRecord::Type::Boolean.new.cast(value)\n end",
"title": ""
},
{
"docid": "8849a8fe98407d440d41a64849f1b2e0",
"score": "0.52101195",
"text": "def search_filter(name)\n filter = Puppet[:ldapstring]\n\n if filter.include? \"%s\"\n # Don't replace the string in-line, since that would hard-code our node\n # info.\n filter = filter.gsub('%s', name)\n end\n filter\n end",
"title": ""
},
{
"docid": "8501afb676acdb984e724056ec8911a4",
"score": "0.52030194",
"text": "def query_string attr\n qs = self.get_attribute_field attr, :value\n qs_rule = self.get_attribute_field attr, :rule\n if qs && (qs_rule == \"fuzzy\")\n index.query(match: {attr=> {query: qs, fuzziness:2, prefix_length:1}})\n elsif qs\n index.query(query_string: {fields: [attr], query: qs})\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "26d396eaa3081e677385d9890b732e24",
"score": "0.5194288",
"text": "def escape_attr s\n # http://www.w3.org/TR/html5/syntax.html#attributes-0\n s ? (s.gsub /\"/, '"') : ''\n end",
"title": ""
},
{
"docid": "980f1ecce12cb6af88aea60e530e6082",
"score": "0.5193868",
"text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end",
"title": ""
},
{
"docid": "1ad650cf0d83c2b4986a57da221042c2",
"score": "0.5178373",
"text": "def sanitize_filterrific_param(val); end",
"title": ""
},
{
"docid": "ed7468905e86f3263f15fa7f1db021b3",
"score": "0.51780176",
"text": "def filter=(value)\n filter value\n end",
"title": ""
},
{
"docid": "80ef2905ddfa217d9cf33352e7a52d31",
"score": "0.5176998",
"text": "def classic_filter\n self.class.new(self.gsub('.', '').sub(/['`’]s\\z/, ''))\n end",
"title": ""
},
{
"docid": "cea10299ceb7ba2232efa2d3c91b55ae",
"score": "0.51508576",
"text": "def attribute?() @type.downcase.start_with?( 'attribute' ); end",
"title": ""
},
{
"docid": "60c71c957dd1f91eaff682bd1558e0db",
"score": "0.51433784",
"text": "def parse_filter(filter_argument = T.unsafe(nil), &filter_proc); end",
"title": ""
},
{
"docid": "8b635b92216d0bbb971d33e8962159c9",
"score": "0.51377094",
"text": "def lowercase_filter\n self.class.new(UnicodeUtils.downcase(self))\n end",
"title": ""
},
{
"docid": "aaffe3df56b9fee1efc547881beff9c6",
"score": "0.51269156",
"text": "def parse(ldap_filter_string)\n new(ldap_filter_string).filter\n end",
"title": ""
},
{
"docid": "1ac7da58722c34e6aea9ffff281d4568",
"score": "0.5123852",
"text": "def sanitize_attr(attr)\n return unless attr\n attr.gsub(/[^a-zA-Z\\:\\_]/, '-')\n end",
"title": ""
},
{
"docid": "4cad763f26737367bdf4735b70a2a860",
"score": "0.511625",
"text": "def filter (text=\"\")\n @options.filter = (text)\n end",
"title": ""
},
{
"docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad",
"score": "0.5115732",
"text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad",
"score": "0.5115732",
"text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad",
"score": "0.5115732",
"text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad",
"score": "0.5115732",
"text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "eedb671caa9e36be5bbdaccb0a999d04",
"score": "0.51116216",
"text": "def ends(attribute, value)\n new(:eq, attribute, \"*\" + escape(value))\n end",
"title": ""
},
{
"docid": "e250378b80ede70e4aea7734ec2ed6c2",
"score": "0.51085013",
"text": "def without(attribute, value)\n @client.filters << Riddle::Client::Filter.new(attribute.to_s, value,\n true)\n end",
"title": ""
},
{
"docid": "9227c13732d69b83c963d365ce11d84a",
"score": "0.51059484",
"text": "def filter=(value)\n @filter = value\n end",
"title": ""
},
{
"docid": "825eb2fe68093b6a8d6560f5ceca6ef5",
"score": "0.5104385",
"text": "def filters_string\n '?' << @filters_string\n end",
"title": ""
},
{
"docid": "98e89a62a75729cd6d86bed8c266dfa5",
"score": "0.51010764",
"text": "def filter_by_string(results, field, string, positive)\n partial_results = index(field).select do |(key, _)|\n key =~ /#{Regexp.escape(string)}/i\n end\n\n filter_index(results, partial_results, positive)\n end",
"title": ""
},
{
"docid": "d5246685b25faadadaf91e9fad37c712",
"score": "0.5099696",
"text": "def format_predicate(attribute)\n original_format_predicate(attribute)\n rescue ArgumentError\n arel_pred = arel_predicate_for_attribute(attribute)\n attribute.attr.public_send(arel_pred)\n end",
"title": ""
},
{
"docid": "79f7e871b8e18efa8a49e8e19c79ff60",
"score": "0.50996846",
"text": "def parse_filter(string)\n unless string.include?('=')\n raise ArgumentError.new(\"Invalid filter: #{string.inspect}\")\n end\n\n key, *values = string.split('=')\n value = values.join('=')\n\n # parse regex\n if value[0] == '/' && value[-1] == '/'\n return { key => /#{value[1...-1]}/ }\n end\n\n # parse array-like\n if value[0] == '[' && value[-1] == ']'\n return { key => value[1...-1].split(',') }\n end\n\n # just a string\n { key => value }\n end",
"title": ""
},
{
"docid": "9119130df56e7a6facc3f4ec85efea93",
"score": "0.5094949",
"text": "def filter(*args, &block)\n filter_schema.optional(name).value(*args, &block)\n self\n end",
"title": ""
},
{
"docid": "f23487097a4c66b9ab87d25ddbb1578d",
"score": "0.5087747",
"text": "def attribute_is_filtered?(attribute, attr_filters)\n return false if attr_filters.empty?\n attr_filters.each { |k, v| return true if attribute[k] == v }\n false\n end",
"title": ""
},
{
"docid": "d1a63948d86a27da502db3f40d48101b",
"score": "0.5076727",
"text": "def format(attr, *args)\n value = instance_variable_get(\"@#{attr}\".to_sym)\n return true unless value\n\n args[0].match?(value)\n end",
"title": ""
},
{
"docid": "1fb139375da652187897c608de391ba8",
"score": "0.5067338",
"text": "def match_filter(filter = {})\n # 1. reduce\n remaining = Hash[filter].reject {|k,v| attributes[k].to_s == v.to_s }\n if remaining.empty?\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "b9d4d82a8a18f8ed85c65b00b3a91b9b",
"score": "0.50612557",
"text": "def lower\r\n @attr_expression.lower\r\n end",
"title": ""
},
{
"docid": "e4d4bb4e9a4e8c022f68bf52b9be33cc",
"score": "0.50467587",
"text": "def pre_filter(values = [], options = {})\n return values unless !options.empty? && PRE_FILTER_KEYS.any? { |k| options.key?(k) }\n\n # if there's a prefix in play for (non-pre) attribute filtration and\n # attribute filtration won't allow that prefix, then don't even bother\n # with pre filtration that could only result in values that would be\n # blocked\n if options.key?(:attribute_namespace) &&\n !NewRelic::Agent.instance.attribute_filter.might_allow_prefix?(options[:attribute_namespace])\n return values\n end\n\n values.each_with_object([]) do |element, filtered|\n object = pre_filter_object(element, options)\n filtered << object unless discarded?(object)\n end\n end",
"title": ""
},
{
"docid": "cdcff855fd93874ab1789d7c93f55cb4",
"score": "0.5045232",
"text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend",
"title": ""
},
{
"docid": "cdcff855fd93874ab1789d7c93f55cb4",
"score": "0.5045232",
"text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend",
"title": ""
},
{
"docid": "cdcff855fd93874ab1789d7c93f55cb4",
"score": "0.5045232",
"text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend",
"title": ""
},
{
"docid": "cdcff855fd93874ab1789d7c93f55cb4",
"score": "0.5045232",
"text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend",
"title": ""
},
{
"docid": "cdcff855fd93874ab1789d7c93f55cb4",
"score": "0.5045232",
"text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend",
"title": ""
},
{
"docid": "a032153e351dcf3be76526485bff3cc4",
"score": "0.5041287",
"text": "def [](value, *args)\n case value\n when String, Regexp, Array, Hash\n filter(value, *args)\n else\n super(value)\n end\n end",
"title": ""
},
{
"docid": "19a910bf218c9fffc77d7321ee0215cc",
"score": "0.5035906",
"text": "def whitespaced_start_with\n ->(column, _value) {\n ::Arel::Nodes::SqlLiteral.new(\n \"regexp_replace(#{column.table.name}.#{column.field}, '[-]', ' ', 'g')\"\n ).matches_any([\n \"#{column.search.value.gsub(/[-]/, ' ')}%\",\n \"% #{column.search.value.gsub(/[-]/, ' ')}%\"\n ])\n }\n end",
"title": ""
},
{
"docid": "d0b596bf7636cc5a257a9758239a11df",
"score": "0.5028566",
"text": "def begins_with value\n @items.with_filter(attribute, \"BEGINS_WITH\", value)\n end",
"title": ""
},
{
"docid": "4c10ce015649c3aae66461e0cc287771",
"score": "0.5012589",
"text": "def filter=(value)\n @filter = value\n end",
"title": ""
},
{
"docid": "8a58065420078b25837f4febdcd21bc0",
"score": "0.50086874",
"text": "def filter_expr(statement_str, *subs)\n names = @params[:expression_attribute_names]\n if names.nil?\n @params[:expression_attribute_names] = {}\n names = @params[:expression_attribute_names]\n end\n values = @params[:expression_attribute_values]\n if values.nil?\n @params[:expression_attribute_values] = {}\n values = @params[:expression_attribute_values]\n end\n prepared = _key_pass(statement_str, names)\n statement = _apply_values(prepared, subs, values)\n @params[:filter_expression] = statement\n self\n end",
"title": ""
},
{
"docid": "df67b5f809e14313d6430ad4a0139129",
"score": "0.50033987",
"text": "def where(attributes = {})\n field = attributes.keys[0]\n value = attributes.values[0]\n all.select { |r| r.try(field).to_s.downcase.eql? value.to_s.downcase }\n end",
"title": ""
},
{
"docid": "000f0c96d18a34c101df99697be80b74",
"score": "0.50032276",
"text": "def accepts_filter(filter_parameter, options={})\n rspec_api[:filter] = options.merge(name: filter_parameter)\n end",
"title": ""
},
{
"docid": "b36e5f52fcd04c0b9d8d7e515ae7c650",
"score": "0.4995555",
"text": "def contains_exactly(value)\n ObjectFilterOperation.new('~', value)\n end",
"title": ""
},
{
"docid": "bc91ed3739cc93e4d1a3cfd1a6bef373",
"score": "0.4993273",
"text": "def filter_attribute(value, allowed_values, default: nil)\n return default unless value\n return value if allowed_values.include?(value)\n\n default\n end",
"title": ""
},
{
"docid": "72954c3c303eb29ce5cf431a146fa0bd",
"score": "0.4989048",
"text": "def have_attribute(label, value)\n HaveAttributeMatcher.new(label, value)\n end",
"title": ""
},
{
"docid": "9c0ad17c2dcf6f126a9449cfb9f4753d",
"score": "0.4988148",
"text": "def sanitize_attribute_name(name)\n Lexer.sanitize_attribute_name(name)\n end",
"title": ""
},
{
"docid": "22db0ecfedc9b32fc141daff131d9b87",
"score": "0.49874517",
"text": "def value regex\n add RowFilter.value(regex)\n end",
"title": ""
},
{
"docid": "7136e4d75312bfc6aafadb112f904e4f",
"score": "0.49847332",
"text": "def filter_movie_attr(attr)\n attr_raw = attr\n attr_sym = attr.to_sym\n\n raise ArgumentError, (\"#{attr_sym} is not a valid attribute.\" if !attr_sym == :director && :cast_members)\n filtered = @movie_DS.select{ |ds| ds.attr_title? }.map(&attr_sym)#.flatten\n attr_raw == ('languages' && 'title') ? filtered : filtered#.uniq\n end",
"title": ""
},
{
"docid": "c781b268fb9bfbe4c46908144310fdd5",
"score": "0.498162",
"text": "def format_where_clause(attribute, value)\n q = \"#{remote_attribute_name(attribute)}=\" #exact match\n\n # No escaping boolean values\n if value.is_a?(TrueClass) || value.is_a?(FalseClass)\n q << value.to_s\n elsif value.is_a? Date\n q << value.strftime(\"%Y-%m-%d\")\n elsif value.nil?\n q << \"NULL\"\n else\n q << \"'#{value}'\"\n end\n\n q\n end",
"title": ""
},
{
"docid": "565ca97d8739c12e43c2786634ef01ee",
"score": "0.49710667",
"text": "def parse_ldap_filter(obj)\n case obj.ber_identifier\n when 0x87 # present. context-specific primitive 7.\n eq(obj.to_s, \"*\")\n when 0xa3 # equalityMatch. context-specific constructed 3.\n eq(obj[0], obj[1])\n else\n raise Net::LDAP::SearchFilterTypeUnknownError, \"Unknown LDAP search-filter type: #{obj.ber_identifier}\"\n end\n end",
"title": ""
},
{
"docid": "549a0921134060c55d41664a4dbeae0f",
"score": "0.4962927",
"text": "def set_FilterName(value)\n set_input(\"FilterName\", value)\n end",
"title": ""
},
{
"docid": "ce4ee3ec18597655ad284848975706f5",
"score": "0.4962557",
"text": "def equals(attribute, value)\n new(:eq, attribute, escape(value))\n end",
"title": ""
}
] |
881e9de70c033540f88b2f555752e3e0
|
=begin after_filter :set_csrf_cookie_for_ng protected def verified_request? super || form_authenticity_token == request.headers['XXSRFTOKEN'] end private def set_csrf_cookie_for_ng cookies['XSRFTOKEN'] = form_authenticity_token if protect_against_forgery? end =end
|
[
{
"docid": "647db06564fb7e78b9a19641623c12ba",
"score": "0.0",
"text": "def render *args\n gon.flash = flash.to_h\n super\n end",
"title": ""
}
] |
[
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "1786b47aef4517b84cd05c23d02ccb29",
"score": "0.90172845",
"text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "df08a3fe49dbd0d61a738fbda63e6ff3",
"score": "0.8952119",
"text": "def set_csrf_cookie_for_ng\n\t\tcookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n\tend",
"title": ""
},
{
"docid": "604d46f53ba7f2dcfb401d9590163bc6",
"score": "0.86948025",
"text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "e8dd9c0a0b94fd68f6add80755de3468",
"score": "0.83919716",
"text": "def set_csrf_headers\n if request.xhr?\n cookies['XSRF-TOKEN'] = form_authenticity_token if cookies['XSRF-TOKEN'].blank?\n end\n end",
"title": ""
},
{
"docid": "2faa07eeb7653697639a2eecf5c50f59",
"score": "0.83566886",
"text": "def set_xsrf_token_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"title": ""
},
{
"docid": "8825ecc5068bb630c9557f74489db775",
"score": "0.8315763",
"text": "def set_csrf_cookie\n cookies['CSRF-TOKEN'] = form_authenticity_token\n end",
"title": ""
},
{
"docid": "71d07dd449a40586ff872e029a3051ff",
"score": "0.8195351",
"text": "def set_csrf_cookie\n csrf_cookie_key = 'XSRF-TOKEN'\n cookies[csrf_cookie_key] = form_authenticity_token if protect_against_forgery? && current_user\n end",
"title": ""
},
{
"docid": "e1e2dd31031be43154de09f044bda681",
"score": "0.78686786",
"text": "def auth_csrf_token\n request.env['HTTP_X_AUTH_CSRF']\n end",
"title": ""
},
{
"docid": "dc79960cdf00574f35bac020612ba422",
"score": "0.78527266",
"text": "def set_csrf_headers\n response.headers['X-CSRF-Token'] = form_authenticity_token\n end",
"title": ""
},
{
"docid": "9a89e44421f2195db5bb7689e3b2ba39",
"score": "0.7736356",
"text": "def csrf_token\n env[\"rack.session\"].fetch(:csrf)\nend",
"title": ""
},
{
"docid": "47b114d77ea99bb964a498c9d79114f0",
"score": "0.7719906",
"text": "def set_csrf_headers\n if request.xhr?\n # Add the newly created csrf token to the page headers\n # These values are sent on 1 request only\n response.headers['X-CSRF-Token'] = \"#{form_authenticity_token}\"\n response.headers['X-CSRF-Param'] = \"#{request_forgery_protection_token}\"\n end\n end",
"title": ""
},
{
"docid": "164945c2ec15735beb4533c90a7f2ca8",
"score": "0.7489129",
"text": "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end",
"title": ""
},
{
"docid": "164945c2ec15735beb4533c90a7f2ca8",
"score": "0.7489129",
"text": "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end",
"title": ""
},
{
"docid": "164945c2ec15735beb4533c90a7f2ca8",
"score": "0.7489129",
"text": "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end",
"title": ""
},
{
"docid": "164945c2ec15735beb4533c90a7f2ca8",
"score": "0.7489129",
"text": "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end",
"title": ""
},
{
"docid": "cccb878ff807ddb5583ef5bc57ecf2c2",
"score": "0.74860686",
"text": "def verified_request?\r\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\r\n end",
"title": ""
},
{
"docid": "179f8d32b9db28ca0ead721847108f7e",
"score": "0.74622536",
"text": "def submitted_csrf_token\n request.env['HTTP_X_CSRF_TOKEN'] || params['csrf_token']\n end",
"title": ""
},
{
"docid": "7cad7ab35ed6d848684619d2521b7553",
"score": "0.74039555",
"text": "def csrf_token\n session[:csrf] ||= SecureRandom.hex 32\n end",
"title": ""
},
{
"docid": "4a0725b3b47d26c6ebc06d13fcbe7bdc",
"score": "0.7401688",
"text": "def csrf; end",
"title": ""
},
{
"docid": "ee23ab1be2b9689da7541cce56abd68b",
"score": "0.7372447",
"text": "def csrf_meta_tags; end",
"title": ""
},
{
"docid": "ac0afdfc66c759c46e6ec65c57758955",
"score": "0.7341263",
"text": "def verified_request?\n\t\tsuper || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n\tend",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "260deb95b7e3dd640c66afabe1076b38",
"score": "0.7245963",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "c7be89c722e0ca6fa4df4d7b731922d7",
"score": "0.72395545",
"text": "def protect_from_forgery\n end",
"title": ""
},
{
"docid": "9141b854ca214f34466bf71ef6eb7067",
"score": "0.71829057",
"text": "def authenticity_token_from_cookie_session\n session[:csrf_id] ||= CGI::Session.generate_unique_id\n session.dbman.generate_digest(session[:csrf_id])\n end",
"title": ""
},
{
"docid": "d9f78c11fd99bb3ea16abc76fb424d46",
"score": "0.71531427",
"text": "def rails_csrf_token\n rails_controller_instance.send(:form_authenticity_token)\n end",
"title": ""
},
{
"docid": "c707fc45c3dd2a1c238e27aab8c7e2fa",
"score": "0.71329504",
"text": "def rails_csrf_token\n rails_controller_instance.send(:form_authenticity_token)\n end",
"title": ""
},
{
"docid": "fe697d8a1a507e23997fb1222df48ee6",
"score": "0.71310157",
"text": "def protect_against_forgery?; end",
"title": ""
},
{
"docid": "bda23fed5d6c5aeff2f87bd731fa2e8b",
"score": "0.71058893",
"text": "def verified_request?\n\t\tsuper || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n\tend",
"title": ""
},
{
"docid": "536b36748f460ec31c0903ed2492b7fa",
"score": "0.71042496",
"text": "def set_csrf_token(_req, res)\n res.session[CSRF_TOKEN] ||= generate_csrf_token\n end",
"title": ""
},
{
"docid": "f3a3b627afe6036cb7f976328df1a2a2",
"score": "0.70704955",
"text": "def form_authenticity_token\n \"foo\"\n end",
"title": ""
},
{
"docid": "fae9a6f1bccc3be13f3008cd7e4319f8",
"score": "0.7069861",
"text": "def allow_forgery_protection\n true\n end",
"title": ""
},
{
"docid": "6e800a5e91c8114132d9b73a9440f6be",
"score": "0.70617527",
"text": "def yield_authenticity_token\n if protect_against_forgery?\n <<JAVASCRIPT\n <script type='text/javascript'>\n //<![CDATA[\n window._auth_token_name = \"#{request_forgery_protection_token}\";\n window._auth_token = \"#{form_authenticity_token}\";\n //]]>\n </script>\nJAVASCRIPT\n end\n end",
"title": ""
},
{
"docid": "8007b6632cbe79134fb599e964bff758",
"score": "0.705436",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "8007b6632cbe79134fb599e964bff758",
"score": "0.705436",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "8007b6632cbe79134fb599e964bff758",
"score": "0.705436",
"text": "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end",
"title": ""
},
{
"docid": "6b556fd40bc936ea517281f2093e06ef",
"score": "0.7054212",
"text": "def csrf_header\n csrf_options[:header]\n end",
"title": ""
},
{
"docid": "5945afa95c77699f9b527a143653158f",
"score": "0.70397794",
"text": "def rails_csrf_param\n rails_controller.request_forgery_protection_token\n end",
"title": ""
},
{
"docid": "6cf1b4d1d478ce69c710d03b56ff59a6",
"score": "0.7037097",
"text": "def csrf_metatag\n \"<meta name=\\\"#{csrf_field}\\\" content=\\\"#{csrf_token}\\\" \\/>\"\n end",
"title": ""
},
{
"docid": "9d35072ddb7e8a0e4933bd2698b17131",
"score": "0.7027598",
"text": "def rails_csrf_param\n rails_controller.request_forgery_protection_token\n end",
"title": ""
},
{
"docid": "162cc60628ab8ef6de5b7a775c26b3cd",
"score": "0.70224017",
"text": "def clean_up_csrf?; end",
"title": ""
},
{
"docid": "162cc60628ab8ef6de5b7a775c26b3cd",
"score": "0.70224017",
"text": "def clean_up_csrf?; end",
"title": ""
},
{
"docid": "8874a00c09aa91921b23b65ebbeb8ae2",
"score": "0.700949",
"text": "def csrf=(_arg0); end",
"title": ""
},
{
"docid": "1fa4979aaeca6d8e9cba04970342eb8d",
"score": "0.70038825",
"text": "def handle_unverified_request\n logger.warn \" Form token: #{params[request_forgery_protection_token]}\" if logger\n logger.warn \" Header token: #{request.headers['X-CSRF-Token']}\" if logger\n logger.warn \" Session token: #{session[:_csrf_token]}\" if logger\n super\n end",
"title": ""
},
{
"docid": "2ae3ea268e90ede5e83114bb546809ac",
"score": "0.6967107",
"text": "def respond_with_csrf_header\n # Only return the authenticity token to approved origins.\n return unless request.headers['HTTP_ORIGIN'] && origin_is_whitelisted?\n # Only return the authenticity token for JSON requests to approved API actions\n if(API_ACTIONS.include?(action_name) && formats.include?(:json))\n response.headers['X-CSRF-Token'] = form_authenticity_token\n end\n end",
"title": ""
},
{
"docid": "a1d5d7a56b70df76c0598a21169c399c",
"score": "0.69553274",
"text": "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end",
"title": ""
},
{
"docid": "b7332a666f8ecae1e27905cabaca2c28",
"score": "0.6931515",
"text": "def form_authenticity_token() 'token' end",
"title": ""
},
{
"docid": "09865d7fabcfff153fff0fde94cea038",
"score": "0.692663",
"text": "def masked_authenticity_token(session, form_options: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ab84f0b5dc85ee34d5525e3678038b6f",
"score": "0.69120747",
"text": "def append_csrf_token_in_params\n params[:authenticity_token] ||= request.headers.env['HTTP_X_CSRF_TOKEN']\n end",
"title": ""
},
{
"docid": "4554b5f374d592bbbb83ddbeaf7315a5",
"score": "0.69105273",
"text": "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end",
"title": ""
},
{
"docid": "487e12559a5c1ac1329ad5a5152e9b58",
"score": "0.69051504",
"text": "def check_csrf?\n true\n end",
"title": ""
},
{
"docid": "f7c55d7daad1fdb8d28d0874f740131e",
"score": "0.6893592",
"text": "def request_authenticity_tokens; end",
"title": ""
},
{
"docid": "d46ba75764999518e15058c64a906b11",
"score": "0.68926793",
"text": "def auth_token\n (protect_against_forgery? ? form_authenticity_token : nil)\n end",
"title": ""
},
{
"docid": "d28da58631fa828fe19a486437dc04c5",
"score": "0.68704164",
"text": "def protect_against_forgery?\n end",
"title": ""
},
{
"docid": "d4fe1206d3ec52cb23e67d00e6412aea",
"score": "0.6862708",
"text": "def check_csrf?\n true\n end",
"title": ""
},
{
"docid": "00b3c9350e39eb7ed2562ecc04c59f93",
"score": "0.6842696",
"text": "def check_csrf\n rails_check_csrf!\n end",
"title": ""
},
{
"docid": "ee9388261047e8b1a7af3d72438f9727",
"score": "0.6818603",
"text": "def check_csrf\n rails_check_csrf!\n end",
"title": ""
},
{
"docid": "ac2468f4355a44b1bb6c242edb8826db",
"score": "0.6802482",
"text": "def protect_against_forgery?\n\n end",
"title": ""
},
{
"docid": "47decd279b79c2837a9a5bfe9e76c4de",
"score": "0.67891574",
"text": "def form_authenticity_token\n @form_authenticity_token ||= if !session.respond_to?(:session_id)\n raise InvalidAuthenticityToken, \"Request Forgery Protection requires a valid session. Use #allow_forgery_protection to disable it, or use a valid session.\"\n elsif request_forgery_protection_options[:secret]\n authenticity_token_from_session_id\n elsif session.respond_to?(:dbman) && session.dbman.respond_to?(:generate_digest)\n authenticity_token_from_cookie_session\n else\n raise InvalidAuthenticityToken, \"No :secret given to the #protect_from_forgery call. Set that or use a session store capable of generating its own keys (Cookie Session Store).\"\n end\n end",
"title": ""
},
{
"docid": "d7ffce47ff04aee202d6a80dd1f2fd8f",
"score": "0.6777429",
"text": "def invalid_authenticity_request\n sign_out(current_user)\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n render error: 'invalid token', status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "69529f3bea32bcc0c69ca4bb9de47905",
"score": "0.6774925",
"text": "def use_request_specific_csrf_tokens?\n csrf_options[:require_request_specific_tokens]\n end",
"title": ""
},
{
"docid": "677a928dfe232073777af784656fb712",
"score": "0.67546463",
"text": "def authenticity_token\n @authenticity_token || helper.form_authenticity_token\n end",
"title": ""
},
{
"docid": "677a928dfe232073777af784656fb712",
"score": "0.6753786",
"text": "def authenticity_token\n @authenticity_token || helper.form_authenticity_token\n end",
"title": ""
},
{
"docid": "281a86007be777136ea871b30d7a3fdc",
"score": "0.67500854",
"text": "def csrf_token_hash(action=nil)\n vc = @controller.view_context\n # :nocov:\n if vc.protect_against_forgery?\n # :nocov:\n {vc.request_forgery_protection_token.to_s=>vc.form_authenticity_token}\n end\n end",
"title": ""
},
{
"docid": "38f77625843c8fb4c3203c71c03b1fdb",
"score": "0.6737736",
"text": "def verify_authenticity_token; end",
"title": ""
},
{
"docid": "93a47c42de53c999a15427e24a730a97",
"score": "0.6724275",
"text": "def clean_up_csrf?\n true\n end",
"title": ""
},
{
"docid": "93a47c42de53c999a15427e24a730a97",
"score": "0.6724275",
"text": "def clean_up_csrf?\n true\n end",
"title": ""
},
{
"docid": "6001dff362e233e5c531ffd625060ac5",
"score": "0.6718513",
"text": "def verify_csrf_token?\n false\n end",
"title": ""
},
{
"docid": "487129826d80e80d3e54f19210e585f8",
"score": "0.671183",
"text": "def disable_request_forgery_protection; end",
"title": ""
},
{
"docid": "1abb7b2896bad8b871b5093669846195",
"score": "0.6675828",
"text": "def protect_against_forgery?\n false\nend",
"title": ""
},
{
"docid": "960d4be63575d15b580d5f265bb21760",
"score": "0.66622686",
"text": "def yield_authenticity_token\n if protect_against_forgery?\n <<-JAVASCRIPT\n <script type='text/javascript'>\n //<![CDATA[\n var AUTH_TOKEN = \"#{form_authenticity_token}\";\n //]]>\n </script>\n JAVASCRIPT\n end\n end",
"title": ""
},
{
"docid": "26b410a9f0ecdf5041102a3671861b45",
"score": "0.6659061",
"text": "def disable_request_forgery_protection=(_arg0); end",
"title": ""
},
{
"docid": "a573ccc9950264271e15e720d5f7936a",
"score": "0.6646932",
"text": "def rails_csrf_tag\n %(<input type=\"hidden\" name=\"#{rails_csrf_param}\" value=\"#{rails_csrf_token}\">)\n end",
"title": ""
},
{
"docid": "0fdd0732fb6dec3092b73f6ece799fd7",
"score": "0.6606328",
"text": "def verify_csrf_token(req, res)\n handle_invalid_csrf_token(req, res) if invalid_csrf_token?(req, res)\n end",
"title": ""
},
{
"docid": "80fde550e18fb7b8c42babcfe4149700",
"score": "0.65987843",
"text": "def form_authenticity_token(form_options: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2e8088edc23177376708c9e7f975dace",
"score": "0.6589369",
"text": "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end",
"title": ""
},
{
"docid": "2e8088edc23177376708c9e7f975dace",
"score": "0.6589369",
"text": "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end",
"title": ""
},
{
"docid": "2e8088edc23177376708c9e7f975dace",
"score": "0.6589369",
"text": "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end",
"title": ""
},
{
"docid": "a618d5367ae714d20b241618c8108882",
"score": "0.6582665",
"text": "def clean_up_csrf?\n false\n end",
"title": ""
},
{
"docid": "5aeb525246a2f3a9cab7d2c8b782edf9",
"score": "0.6579431",
"text": "def rails_csrf_tag\n %(<input type=\"hidden\" name=\"#{rails_csrf_param}\" value=\"#{rails_csrf_token}\">)\n end",
"title": ""
},
{
"docid": "975613ec934a75dcbfd3280790eeddad",
"score": "0.65750754",
"text": "def protect_against_forgery?\n controller.send(:protect_against_forgery?)\n end",
"title": ""
},
{
"docid": "7e4d1bd1bce6d8fe6212598da618aaa4",
"score": "0.6550763",
"text": "def protect_against_forgery?\n false\n end",
"title": ""
},
{
"docid": "7e4d1bd1bce6d8fe6212598da618aaa4",
"score": "0.65504795",
"text": "def protect_against_forgery?\n false\n end",
"title": ""
}
] |
b6dbe2c3e782554de631d372042e711f
|
determines which of two consecutive elements will appear first in the results. def bubble_sort!(array) loop do swapped = false 1.upto(array.size 1) do |index| next if array[index 1] <= array[index] array[index 1], array[index] = array[index], array[index 1] swapped = true end break unless swapped end nil end method modified:
|
[
{
"docid": "d702255bed02fc34d470830a75336bd9",
"score": "0.0",
"text": "def bubble_sort!(array)\r\n loop do\r\n swapped = false\r\n 1.upto(array.size - 1) do |index|\r\n if block_given?\r\n next if yield(array[index - 1], array[index])\r\n array[index - 1], array[index] = array[index], array[index - 1]\r\n else\r\n next if array[index - 1] <= array[index]\r\n array[index - 1], array[index] = array[index], array[index - 1]\r\n end\r\n swapped = true\r\n end\r\n\r\n break unless swapped\r\n end\r\n nil\r\nend",
"title": ""
}
] |
[
{
"docid": "daadacfbff964bcb227e5ebb583130cd",
"score": "0.91047496",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n break unless swapped\n end\n nil\n end",
"title": ""
},
{
"docid": "4c8690af18ae3992f616f47ba8ea235a",
"score": "0.902212",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n\n break unless swapped\n end\n nil\nend",
"title": ""
},
{
"docid": "4c8690af18ae3992f616f47ba8ea235a",
"score": "0.902212",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n\n break unless swapped\n end\n nil\nend",
"title": ""
},
{
"docid": "4c8690af18ae3992f616f47ba8ea235a",
"score": "0.902212",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n\n break unless swapped\n end\n nil\nend",
"title": ""
},
{
"docid": "00a0c71f41240ddd98f07158e6335250",
"score": "0.8990501",
"text": "def bubble_sort(array)\n\tloop do \n\t\tswapped = false\n\t\tnumber = array.length-1\n\t\tnumber.times do |i|\n\t\t\tif array[i] < array[i+1]\n\t\t\t\t\tarray[i], array[i+1] = array[i+1], array[i]\n\t\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\tbreak if not swapped\n\tend\n\tarray\nend",
"title": ""
},
{
"docid": "fdf61647a8b9cc65923178b22f06cb68",
"score": "0.8989238",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n\n break unless swapped\n end\n nil\n\nend",
"title": ""
},
{
"docid": "6fe17525e689977b9201e3cea608db6e",
"score": "0.8983165",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n\n break unless swapped\n end\nend",
"title": ""
},
{
"docid": "603d83927ea0540b6b4f4b5add46a9fe",
"score": "0.8914853",
"text": "def bubble_sort(array)\n swapped = true\n\n while swapped\n swapped = false\n\n array[0..-2].each_with_index do |val, idx|\n if val > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n swapped = true\n end\n end\n\n\n break if !swapped\n end\n array\nend",
"title": ""
},
{
"docid": "d3be9d675b2877bf60115d9a1833affa",
"score": "0.8904576",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n 1.upto(array.size - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n \n break unless swapped\n end\n p array\nend",
"title": ""
},
{
"docid": "654d588bc798b00f5982b22d75b49bc2",
"score": "0.889278",
"text": "def bubble_sort(array)\n (array.size).downto(0) do |stop_index|\n swapped = false\n\n (1...stop_index).each do |index|\n if array[index] < array[index - 1]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n end\n\n break unless swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "ff228a55db0a4a3e6910744ec814d57d",
"score": "0.88891447",
"text": "def bubble_sort(array)\r\n\tloop do\r\n\t\tswapped = false\r\n\t\t(array.length-1).times do |i|\r\n\t\t if array[i] > array[i+1]\r\n\t\t array[i], array[i+1] = array[i+1], array[i]\r\n\t\t swapped = true\r\n\t\t end\r\n\t\tend\r\n\r\n\t\tbreak if not swapped\r\n\tend\r\n\tarray\r\nend",
"title": ""
},
{
"docid": "fae15586a8f58b27e9921f84ab6e0d54",
"score": "0.8860091",
"text": "def bubble_sort(array)\n\n\twhile true\n\t\tswaps = 0\n\n\t\tarray.each_index do |ind|\n\t\t\tif (ind < array.length - 1) && (array[ind] > array[ind + 1])\n\t\t\t\tarray[ind], array[ind + 1] = array[ind + 1], array[ind]\n\t\t\t\tswaps += 1\n\t\t\tend\n\t\tend\n\n\t\tbreak if swaps == 0\n\tend\n\n\tarray\nend",
"title": ""
},
{
"docid": "52d2d91e1f72471f1c93cf8f6f87ee87",
"score": "0.8855466",
"text": "def bubble_sort!(array)\n loop do\n swap = false\n \n 1.upto(array.size-1) do |index|\n next if array[index-1] < array[index]\n array[index-1], array[index] = array[index], array[index-1]\n swap = true\n end\n\n break if swap == false\n end\nend",
"title": ""
},
{
"docid": "3e7a432a777355205ddd6e7346569c72",
"score": "0.8846339",
"text": "def bubble_sort!(array)\n loop do\n swapped = false\n current_index = 0\n while current_index + 1 < array.size\n if (array[current_index] <=> array[current_index + 1]) == 1\n array[current_index], array[current_index + 1] = array[current_index + 1], array[current_index]\n swapped = true\n end\n current_index += 1\n end\n \n break unless swapped\n end\nend",
"title": ""
},
{
"docid": "1568bc6c5aa23a973405cc872524dc42",
"score": "0.88395876",
"text": "def bubble_sort!(array)\n length = array.length - 2\n loop do\n compare = []\n 0.upto(length) do |index|\n compare << ( array[index] <=> array[index + 1] )\n if compare.last == 1\n array[index], array[index + 1] = array[index + 1], array[index]\n end\n end\n length -= 1\n break if !compare.include?(1)\n end\n array\nend",
"title": ""
},
{
"docid": "9a83417c5ada629665bb79086b9fe6d4",
"score": "0.88110876",
"text": "def bubble_sort!(array)\n loop do\n array_modified = false\n\n for idx in 0..array.size\n comparison = array[idx] <=> array[(idx + 1)]\n array_modified = true if comparison == 1\n array[idx], array[(idx+1)] = array[(idx+1)], array[idx] if comparison == 1\n end\n break if array_modified == false\n end\n array\nend",
"title": ""
},
{
"docid": "d1136fd7c89a3f2efcefb04fbf44a568",
"score": "0.88014513",
"text": "def bubble_sort(array)\r\n\r\n\tloop do\r\n\t\ti = 0\r\n\t\tswap_counter = 0\r\n\t\twhile i < array.length - 1\r\n\t\t\tif array[i] > array[i + 1]\r\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]\r\n\t\t\t\tswap_counter += 1\r\n\t\t\tend\r\n\t\t\ti += 1\r\n\t\tend\r\n\t\tbreak if swap_counter == 0\r\n\tend\r\n\r\n\tarray\r\nend",
"title": ""
},
{
"docid": "1f046de6d3a8354965db5b6252768c86",
"score": "0.8798801",
"text": "def bubble_sort!(array)\n swap = true\n loop do\n (0..array.size - 2).each do |index|\n if array[index] > array[index + 1]\n array[index], array[index + 1] = array[index + 1], array[index]\n swap = true\n end\n end\n break if swap == false\n swap = false\n end\nend",
"title": ""
},
{
"docid": "d218fbd0533b8cb76dbaf8e0bddfb6e7",
"score": "0.8778115",
"text": "def bubble_sort!(array)\nneed_swaps = true\n while need_swaps\n need_swaps = false\n array.each_index do |i|\n if (array[i+1] != nil) && (array[i] > array[i+1])\n array[i], array[i+1] = array[i+1], array[i]\n need_swaps = true\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "4e9980a38597f58ded4b790ac605f982",
"score": "0.87691283",
"text": "def bubble_sort(array)\n\tn = array.length \n\n\tloop do \n\n\t\tswapped = false \n\n\t\t(n - 1).times do |i|\n\t\t\tif array[i] > array[i + 1]\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]\n\t\t\t\tswapped = true\n\t\t\tend \n\t\tend \n\n\t\tbreak if not swapped \n\tend \n\n\tarray \nend",
"title": ""
},
{
"docid": "fb8d794ae8ce5dcebe22e5836928d8fd",
"score": "0.87577546",
"text": "def bubble_sort(array)\r\n loop do \r\n swapped = false\r\n number = array.length-1\r\n number.times do |i|\r\n if array[i] < array[i+1]\r\n array[i], array[i+1] = array[i+1], array[i]\r\n swapped = true\r\n end\r\n end\r\n break if not swapped\r\n end\r\n array\r\nend",
"title": ""
},
{
"docid": "6e2ab9e43e34b7fbe4f42fe5ffddcf73",
"score": "0.8752437",
"text": "def bubble_sort!(array)\n count = array.size - 1\n loop do\n swapped = false\n (count).times do |idx|\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n swapped = true\n end\n end\n break unless swapped\n count -= 1\n end\n nil\nend",
"title": ""
},
{
"docid": "2ea9f027c23e1faf5150647313c80e3e",
"score": "0.8741673",
"text": "def bubble_sort!(array)\n\n loop do\n value_in_array_exchanged = false\n\n (0...(array.length - 1)).each do |index|\n if ((array[index] <=> array[index + 1]) == 1)\n # Can use Ruby idiom (array[index], array[index + 1] = array[index + 1], array[index]) instead of bottom 3 lines\n # holder = array[index]\n # array[index] = array[index + 1]\n # array[index + 1] = holder\n value_in_array_exchanged = true\n end\n end\n\n break if value_in_array_exchanged == false\n end\n\n return array\nend",
"title": ""
},
{
"docid": "38b7a54b1ea0142ced320bdb5a7c0c31",
"score": "0.874155",
"text": "def bubble_sort(array)\r\n return array if array.size <= 1\r\n swapped = true\r\n while swapped do\r\n swapped = false\r\n 0.upto(array.size-2) do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1] = array[i+1], array[i] \r\n swapped = true\r\n end\r\n end \r\n end\r\n\r\n array\r\nend",
"title": ""
},
{
"docid": "d1374076aa851cfa2e77d1f8f28c2d40",
"score": "0.87375194",
"text": "def bubble_sort(array)\n return array if array.size <= 1\n swapped = true\n while swapped do\n swapped = false\n 0.upto(array.size-2) do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i] \n swapped = true\n end\n end \n end\n\n array\nend",
"title": ""
},
{
"docid": "b5d81a045d926b124ac6740d51def556",
"score": "0.87327427",
"text": "def bubble_sort(array)\n length = array.length\n loop do\n swapped = false\n\n (length-1).times do |count|\n if array[count] > array[count+1]\n array[count], array[count+1] = array[count+1], array[count]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\n end",
"title": ""
},
{
"docid": "79f60c2c36f9705f33389b1c47ddf04a",
"score": "0.8726069",
"text": "def bubble_sort(array)\n if array[0] > array[1]\n swap = array[1], array[0]\n swap\n else\n array\n end\nend",
"title": ""
},
{
"docid": "dc0822511d427fa62535865d133cfc54",
"score": "0.87174165",
"text": "def bubble_sort(array)\n sorted = true\n while sorted\n sorted = false\n (array.length - 1).times do |a|\n if array[a + 1] < array[a]\n array[a], array[a + 1] = array[a + 1], array[a]\n sorted = true\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "0bfd63c5cc385e1a66d489bfe268852e",
"score": "0.8710924",
"text": "def bubble_sort!(array)\n until array == array.sort\n idx = 0\n until idx == array.size - 1\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n end\n idx += 1\n end\n end\nend",
"title": ""
},
{
"docid": "f2a44365ac73f2d33872c4b6bdb9740e",
"score": "0.87005705",
"text": "def bubble_sort!(array)\n loop do\n swap_count = 0\n array.size.times do |idx|\n if (array[idx] <=> array[idx+1]) == 1\n array[idx], array[idx+1] = array[idx+1], array[idx]\n swap_count += 1\n end\n end\n break if swap_count == 0\n end\nend",
"title": ""
},
{
"docid": "efa59e11fc46a66b7f3ad4e6b68dbb82",
"score": "0.86971056",
"text": "def bubble_sort!(array)\n loop do\n idx = 0\n swapped = false\n\n loop do\n break if array[idx + 1] == nil\n\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n swapped = true\n end\n \n idx += 1\n end\n\n return array if swapped == false\n end\nend",
"title": ""
},
{
"docid": "6aa3ac60c6cc890ecf6fc032ab944fab",
"score": "0.86918736",
"text": "def bubble_sort(array)\n array_length = array.size\n return array if array_length <= 1\n\n loop do\n swapped = false\n\n (array_length - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n\n break unless swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "77beb97f1261a58720d9a3ef6e21c40c",
"score": "0.8688065",
"text": "def bubble_sort(array)\n\tsorted = false\n\twhile !sorted\n\t\t\tsorted = true\n\n\t\t\t(0...array.length - 1).each do |i|\n\t\t\t\t\tif array[i] > array[i + 1]\n\t\t\t\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]\n\t\t\t\t\t\t\tsorted = false\n\t\t\t\t\tend\n\t\t\tend\n\tend\n\n\tarray\nend",
"title": ""
},
{
"docid": "f67cb4dd0a3ae7e9b75835012a743348",
"score": "0.86867416",
"text": "def bubble_sort(array)\n return array if array.size <= 1 #No need to sort an empty or single element array\n\n swapped = true #We have to have a flag to check if array is sorted.\n\n while swapped do\n swapped = false\n 0.upto(array.size - 2) do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i] #swap positions\n swapped = true\n end\n end\n end\nend",
"title": ""
},
{
"docid": "e069dce8ffdab8a66255dfca82ecfb26",
"score": "0.86847967",
"text": "def bubble_sort(array)\n is_sorted = false\n\n while is_sorted == false\n is_sorted = true\n (0...array.length - 1).each do |idx|\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n is_sorted = false\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "807f9ac797f69db970b21d0d47573ce0",
"score": "0.86827403",
"text": "def bubble_sort(array, swapped=false)\n (array.length-1).times { |i| (array[i], array[i+1] = array[i+1], array[i]; swapped = true) if array[i] > array[i+1] }\n swapped == false ? array : bubble_sort(array)\nend",
"title": ""
},
{
"docid": "bf162f8c1aab4bdc0d0ba89bab1b8267",
"score": "0.86740434",
"text": "def bubble_sort(array)\n loop do\n continue = false;\n for i in (0..array.length-2)\n if array[i] > array[i + 1]\n array[i], array[i+1] = array[i+1], array[i]\n continue = true\n end\n end\n break unless continue\n end\n array\nend",
"title": ""
},
{
"docid": "0ad652ccf020c43020ffa16ecddd2985",
"score": "0.8672978",
"text": "def bubble_sort!(array)\n loop do\n change_made = false\n 1.upto(array.size - 1) do |i| \n if array[i - 1] > array[i]\n array[i - 1], array[i] = array[i], array[i - 1]\n change_made = true\n end\n end\n break if change_made == false\n end\n nil\nend",
"title": ""
},
{
"docid": "771a7dabcec4a4b05223a8d4bc486f6e",
"score": "0.86711884",
"text": "def bubble_sort(array)\n array_length = array.length\n\n loop do\n swapped = false\n # It loops length - 1 times until some condition did not satisfy\n (array_length - 1).times do |i|\n if array[i] > array[i + 1]\n # If first element is greater than second element then swap\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n break unless swapped\n end\n array\nend",
"title": ""
},
{
"docid": "4e4e375fca5e46a88a647dc97deeb321",
"score": "0.8665291",
"text": "def bubble_sort(array)\n\tn = array.length\n#make our first loop\n\tloop do \n\t\tswapped = false\n#if element on the right is greater than the element on the right--swap them.\n\t\t(n-1).times do |i|\n\t\t\tif array[i] > array[i + 1]\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]#this is the swap\n\t\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\tbreak if not swapped\n\tend\n\tarray\nend",
"title": ""
},
{
"docid": "6a96106b3a718e47f3e14635a5f8bd8b",
"score": "0.8662738",
"text": "def bubble_sort(array)\n\tstop = 2\n\twhile true\n\t\tswap = false\n\t\t(0..array.length-stop).each do |index|\n\t\t\tif array[index] > array[index+1]\n\t\t\t\ttemp = array[index]\n\t\t\t\tarray[index] = array[index+1]\n\t\t\t\tarray[index+1] = temp\n\t\t\t\tswap = true\n\t\t\tend\n\t\tend\n\t\t# array is sorted if no swaps performed, break out of while loop\n\t\tif swap == false\n\t\t\tbreak\n\t\tend\n\t\tstop += 1\n\tend\n\treturn array\nend",
"title": ""
},
{
"docid": "d6f8b271afb070038e18075bfcebd21d",
"score": "0.865599",
"text": "def bubble_sort!(array)\n loop do\n index = 0\n swaps = 0\n while index < array.length - 1\n if array[index] > array[index + 1]\n array[index], array[index + 1] =\n array[index + 1], array[index]\n swaps += 1\n end\n index += 1\n end\n break if swaps.zero?\n end\n array\nend",
"title": ""
},
{
"docid": "481a8ce8be5a0fe96690d21ef5e6405a",
"score": "0.86509705",
"text": "def bubble_sort(array)\n sorted = false\n\n until sorted\n sorted = true\n\n array[0..-2].each_with_index do |num1, i|\n num2 = array[i + 1]\n if num2 < num1\n # If the next number is smaller than the current, swap the positions\n # and redo the sort from the beginning.\n sorted = false\n array[i], num2 = num2, array[i]\n end\n end\n\n end\n array\nend",
"title": ""
},
{
"docid": "23a8691b51b7f1794c25171df0f2b0e3",
"score": "0.86500484",
"text": "def bubble_sort!(array)\n loop do\n first = 0\n second = 1\n swapped = false\n\n loop do\n break if array[second] == nil\n\n if array[first] > array[second]\n array[first], array[second] = array[second], array[first]\n swapped = true\n end\n\n first += 1\n second = first + 1\n end\n\n return array if swapped == false\n end\nend",
"title": ""
},
{
"docid": "5538b5c3c88a617d7f6ea7dbbacad789",
"score": "0.8643353",
"text": "def bubble_sort(array)\n array_length = array.size\n return array if array_length <= 1\n\n loop do\n swap = false\n (array_length - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swap = true\n end\n end\n break unless swap\n end\n array\nend",
"title": ""
},
{
"docid": "d5ca5624ba1da7fc484f32552f2ceeda",
"score": "0.86414444",
"text": "def bubble_sort(array)\n\tsorted = false\t\t# Set sorted to false to enter loop\n\tuntil sorted\n\t\tsorted = true\t# Assume it's sorted until we see otherwise\n\t\t0.upto(array.length - 2) do |i|\n\t\t# Look at each pair of adjacent elements\n\t\t\tif array[i] > array[i+1]\n\t\t\t# If the latter is greater than the former:\n\t\t\t\t# Swap values\n\t\t\t\ttmp = array[i]\n\t\t\t\tarray[i] = array[i+1]\n\t\t\t\tarray[i+1] = tmp\n\t\t\t\t# Array was not sorted; set sorted to false and\n\t\t\t\t# see if it's now sorted.\n\t\t\t\tsorted = false\n\t\t\tend\n\t\tend\n\tend\n\t# Array is now sorted\n\tarray\t\t\t\t# Return array\nend",
"title": ""
},
{
"docid": "9159c15f80359ad00f2004d5c26a4260",
"score": "0.8638229",
"text": "def bubble_sort array\n sorted = true\n while sorted\n sorted = false\n (array.length-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n sorted = true\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "e64aac129cb18ba6f3c36b9d0da51bce",
"score": "0.8637624",
"text": "def bubble_sort(array)\n switches = 1\n j = 1\n while switches > 0\n switches = 0\n i = 0\n while i < array.length - j\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n switches += 1\n end\n i += 1\n end\n j += 1\n end\n return array\nend",
"title": ""
},
{
"docid": "58ccf1596a667ccdff1410b02fe8cac6",
"score": "0.86295193",
"text": "def bubble_sort(array)\n (1...array.size).reverse_each do | j |\n 1.upto(j).each do | i |\n if array[i] < array[i-1]\n array[i], array[i-1] = array[i-1], array[i]\n end\n end\n end\n array\n end",
"title": ""
},
{
"docid": "850e6be1ad1800e69a22596daa76f429",
"score": "0.8628942",
"text": "def bubble_sort(array)\n\t(array.length - 1).downto(1) do |i|\n\t\t0.upto(i - 1) do |j|\n\t\t\tif array[j] > array[j + 1]\n\t\t\t\tarray[j], array[j + 1] = array[j + 1], array[j]\n\t\t\tend\n\t\tend\n\tend\n\treturn array\nend",
"title": ""
},
{
"docid": "a8a23f225fddb6a18dcc5f2498f18276",
"score": "0.8628566",
"text": "def bubble_sort(array)\r\n\tn = array.length\r\n\t\r\n\tloop do\r\n\t\tswapped = false\r\n\r\n\t(n-1).times do |i|\r\n\t\tif array[i] > array[i+1]\r\n\t\t\tarray[i], array[i+1] = array[i+1], array[i]\r\n\t\tswapped = true\r\n\t\tend\r\n\tend\r\n\t\tbreak if not swapped\r\n\tend\r\n\tarray\r\nend",
"title": ""
},
{
"docid": "6715524c92e58ae4156038c94ce4502f",
"score": "0.8626449",
"text": "def bubble_sort!(array)\n size = array.length\n\n loop do\n swap_count = 0\n (0..(array.length - 2)).each do |index|\n if array[index] > array[index + 1]\n array[index], array[index + 1] = array[index + 1], array[index]\n swap_count += 1\n end\n end\n break if swap_count == 0\n end\n\n array\nend",
"title": ""
},
{
"docid": "9c3645537bf6488a89c1caa7e3416ffd",
"score": "0.8626195",
"text": "def bubble_sort(array)\r\n return if array.length <= 1\r\n swapped = true\r\n while swapped do\r\n swapped = false\r\n 0.upto(array.length-2) do |x|\r\n if array[x] > array[x+1]\r\n a = array[x]\r\n array[x] = array[x+1]\r\n array[x+1] = a\r\n swapped = true\r\n end\r\n end\r\n end\r\n array\r\nend",
"title": ""
},
{
"docid": "a656a987ce8e87aa67bf872bf815e607",
"score": "0.862587",
"text": "def bubble_sort(array)\n array_length = array.length\n\n loop do\n swapped = false\n\n (array_length - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n break if not swapped # same as swapped == false\n end\n array\nend",
"title": ""
},
{
"docid": "c5b6010f04d4c724814c99242fba8a61",
"score": "0.8612884",
"text": "def bubble_sort(array)\n\t#find the length of the array \n \tn = array.length\n\t# set up a loop that will compare the elements of the array \n \tloop do \n\t\t#set a boolean variable to \"false\" to declare that the swap has not been done\n \t\tswapped = false\n\t\t#compare array.length -1 times \n\t\t(n-1).times do |i|\n\t\t#set a conditional statement that declares that if the first element is larger than the second element, swap the position of the larger element with the other element \n \t\tif array[i] > array[i+1]\n \t\t\tarray[i], array[i+1] = array[i+1], array[i]\n\t\t\t\t#set boolean \"swapped\" as true when the swap is complete\n \t\t\tswapped = true\n \t\tend #if \n\t\tend # n-1.times\n\n \t\tbreak if not swapped #end loop if there are no more array elements to compare and swap \n \tend #do loop \n\n \tp array #return sorted array \nend",
"title": ""
},
{
"docid": "2b29e59c739fa030b17284047699f61c",
"score": "0.86111027",
"text": "def bubble_sort(array)\n\n # If the size is less than or equal to 1, the array has already been sorted.\n return array if array.size <= 1 \n \n swapped = true\n \n # Until there are no swaps left, check the current element against the next\n # one to the right, swap values if needed.\n while swapped do\n swapped = false\n 0.upto(array.size-2) do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i] # swap values\n swapped = true\n end\n end \n end\n\n array\nend",
"title": ""
},
{
"docid": "06f51b907dac205b837a0269054ebb91",
"score": "0.8601181",
"text": "def bubble_sort(array)\n swapped = nil\n loop do\n swapped = false\n for i in (1...array.size)\n if array[i] < array[i - 1]\n swap_values_at_indices(i, i - 1, array)\n swapped = true\n end\n end\n break if swapped == false\n end\n array\nend",
"title": ""
},
{
"docid": "5073f52fc1bfce7b04c65bd70d5350a6",
"score": "0.85932994",
"text": "def bubble_sort(array)\n\n loop {\n swapped = false\n l = array.length - 1\n j = 0\n while j < l\n if array[j] > array[j+1]\n array[j], array[j+1] = array[j+1],array[j]\n swapped = true\n end\n j +=1\n end\n return array if swapped == false\n }\nend",
"title": ""
},
{
"docid": "5a23b276c7fbad3c8366537c734a091d",
"score": "0.8586907",
"text": "def bubble_sort(array)\n counter = 1\n counter1 = 0\n loop do\n if array[counter] < array[counter - 1]\n array[counter], array[counter - 1] = array[counter - 1], array[counter]\n end\n counter += 1\n counter1 += 1 if counter == array.length \n counter = 1 if counter == array.length \n break if counter1 == array.length\n end\n array\nend",
"title": ""
},
{
"docid": "6ca02aade41dea7143687acc1f7c81ee",
"score": "0.8583673",
"text": "def bubble_sort!(array)\n loop do\n first = 0\n second = 1\n \n loop do\n return array if array[second] == nil\n\n if array[first] > array[second]\n array[first], array[second] = array[second], array[first]\n first = 0\n second = 1\n else\n first += 1\n second = first + 1\n\n end\n end\n end\nend",
"title": ""
},
{
"docid": "932ecafbc06d9266c93b736c23e36757",
"score": "0.8579042",
"text": "def bubble_sort(array)\n\tn = array.length\n\tloop do\n\t\tswapped = false\n\t\t(n-1).times do |item|\n\t\t\tif array[item] > array[item + 1]\n\t\t\t\tarray[item], array[item +1] = array[item + 1], array[item]\n\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\tbreak if swapped == false\n\tend\n\tp array\nend",
"title": ""
},
{
"docid": "45c69e1a6156b08dc9315e30ec9b816b",
"score": "0.85755646",
"text": "def bubble_sort(array)\n\n i = 0\n swapped = false\n\n while i < array.length - 1\n\n a = array[i]\n b = array[i+1]\n\n if a <= b\n i += 1\n else\n array[i] = b\n array[i+1] = a\n swapped = true\n i += 1\n end\n\n end\n\n if swapped\n bubble_sort(array)\n end\n\n array\nend",
"title": ""
},
{
"docid": "ce3e29f0f8b9ecb50a76b9862055b432",
"score": "0.85746413",
"text": "def bubble_sort(array)\n swapped = false # swapped set to false \n array[0...-1].each_with_index do |el, i| # swap elements for length minus one (the number of spaces between elements)\n if el > array[i + 1] \n array[i], array[i+1] = array[i+1], array[i]\n swapped = true # swapped is set to true whenever the array was found not completely sorted \n end\n end\n bubble_sort(array) if swapped # if swapped remained false (no elements unsorted) break\n end",
"title": ""
},
{
"docid": "8dd439dd362d9eccca20adf85704169b",
"score": "0.8571974",
"text": "def bubblesort(array)\n\tswap = true\n\twhile swap\n\t\tswap = false\n\t\tfor i in 1...array.length do\n\t\t\tif array[i] < array[i-1]\n\t\t\t\tarray[i], array[i-1] = array[i-1], array[i]\n\t\t\t\tswap = true\n\t\t\tend\n\t\tend\n\tend\n\tp array\nend",
"title": ""
},
{
"docid": "2e03062d56abcf066544a8d511b3d8ef",
"score": "0.8562932",
"text": "def bubble_sort(array)\n unsorted_until_index = array.length - 1\n sorted = false\n\n until sorted\n sorted = true\n \n (0...unsorted_until_index).each do |idx|\n if array[idx] > array[idx + 1]\n sorted = false\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n end\n end\n\n unsorted_until_index -= 1\n end\n\n array\nend",
"title": ""
},
{
"docid": "e7b8b0b635bd95e4e0798d5115f40c80",
"score": "0.8561256",
"text": "def bubblesort(array)\r\n loop do\r\n sorted = false\r\n \r\n (array.length - 1).times do |x|\r\n if array[x] > array[x + 1]\r\n array[x], array[x + 1] = array[x + 1], array[x]\r\n sorted = true\r\n end\r\n end\r\n \r\n break if not sorted\r\n end\r\n \r\n return array\r\nend",
"title": ""
},
{
"docid": "61011cc0a0501ba04f6a5b88f7c7d2b8",
"score": "0.8555823",
"text": "def bubble_sort(array)\n n = array.length\n loop do\n switched = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n switched = true\n end\n end\n\n break if not switched\n end\n\n array\nend",
"title": ""
},
{
"docid": "9f55c885b61e8a7b985d92a865c7de89",
"score": "0.8552307",
"text": "def bubble_sort(array)\n sorted = false\n until sorted\n swapped = false\n array.each_with_index do |x,i|\n break if i == array.length - 1 \n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i] #swap items\n swapped = true\n end\n end\n sorted = ! swapped #array is sorted when no more items were swapped\n end\n array\nend",
"title": ""
},
{
"docid": "3ebbe9bcb2e4a89d767f2f4a55c0f429",
"score": "0.8548662",
"text": "def bubbleSort(array)\n swapped = true\n while swapped do\n swapped = false\n (array.length - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "141df1fca193d1a9dbdc94c84bfb1fb6",
"score": "0.8546429",
"text": "def bubble_sort(array)\n n = array.length\n\n loop do\n swapped = false\n (n-1).times do |i|\n if array[i] < array[i+1]\n array[i], array[i+1]=array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "88dcd50c1c1d150c3d602fd56133c119",
"score": "0.8544482",
"text": "def bubble_sort(array)\n # initialize sorted to true\n sorted = false\n #initialized swapped variable\n swapped = false\n#define a variable that takes the length of the parameter(array.length)\n length = array.length\n\n#loop until sorted is true\n until sorted\n sorted = true\n\n# array length-1 times, loop\n for input in 0...(length -2)\n# if the swapped varible is false after inner loop,\n#the array is sorted\n if array[input] > array[input + 1]\n sorted = false\n array[input], array[input + 1] = array[input + 1], array[input]\n end\n end\n end\n # state of the swap is now true\n return array\n \n\n if swapped == false\n sorted = true\n end\nend",
"title": ""
},
{
"docid": "a35705f4d79e063c5a4e7173e5433c97",
"score": "0.8543618",
"text": "def bubble_sort(array)\n num_of_elements = array.length #n is total number of values in array\n\n loop do\n #iterate through entire array and check values of each element and compare them\n\n swapped = false\n\n (num_of_elements-1).times do |i|\n if array[i] > array[i + 1]\n #swapping position:\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n array\nend",
"title": ""
},
{
"docid": "18d35ffdf24f093a984003ea91a0bc01",
"score": "0.85426766",
"text": "def bubble_sort!(arr)\n loop do\n swapped = false\n 1.upto(arr.length - 1) do |i|\n if arr[i - 1] > arr[i]\n arr[i - 1], arr[i] = arr[i], arr[i - 1]\n swapped = true\n end\n end\n\n break unless swapped\n end\nend",
"title": ""
},
{
"docid": "5ab896044807b2c9919b0ed286bcd1c0",
"score": "0.85424346",
"text": "def bubble_sort(array)\n is_sorted = false\n counter = 0\n\n while not is_sorted do \n is_sorted = true\n for i in 0..(array.length - 2 - counter)\n if array[i] > array[ i + 1]\n swap(i, i+1 , array)\n is_sorted = false\n end\n end\n counter += 1\n end\n\n return array\nend",
"title": ""
},
{
"docid": "8f07495e8c9f260c21ae5a130e300179",
"score": "0.8541456",
"text": "def bubble_sort(array)\n is_sorted = false\n last_item = array.length\n\n until is_sorted\n is_sorted = true\n\n (0..last_item).each do |i|\n if !array[i + 1].nil? && array[i] > array[i + 1]\n is_sorted = false\n array[i], array[i + 1] = array[i + 1], array[i]\n end\n end\n\n last_item -= 1\n end\n\n array\nend",
"title": ""
},
{
"docid": "a66ee3bf268236e06fb97c608e7785f3",
"score": "0.8536813",
"text": "def bubble_sort(array)\n\nn = array.length\n\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n end\n break if not swapped\n end\n array\nend",
"title": ""
},
{
"docid": "4b4278de014012817a10e265a344c412",
"score": "0.8536214",
"text": "def bubble_sort (array)\n n = array.length\n\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1]=array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "4b4278de014012817a10e265a344c412",
"score": "0.8536214",
"text": "def bubble_sort (array)\n n = array.length\n\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1]=array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "89df52e94e087e5329f2e7935224a1a4",
"score": "0.8531766",
"text": "def bubble_sort!(array)\n n = array.length\n loop do\n changes = false\n (0..(n - 2)).each do |n|\n if array[n] > array[n + 1]\n array[n], array[n + 1] = array[n + 1], array[n]\n changes = true\n end\n end\n n = n - 1\n break if changes == false\n end\n array\nend",
"title": ""
},
{
"docid": "081d1ae58bb7b2cc539a80d9b6f10d32",
"score": "0.8531192",
"text": "def bubblesort_each (array)!\n array.each do\n swap_count = 0\n array.each_with_index do |a, index|\n break if index == (array.length - 1)\n if a > array[index + 1]\n array[index],array[index + 1] = array[index + 1], array[index]\n swap_count += 1\n end\n end\n break if swap_count == 0\n end\n array\n end",
"title": ""
},
{
"docid": "5353ab296ce5caa46b7786dda6e913f0",
"score": "0.8530476",
"text": "def bubble_sort (array)\n a = 0\n b = 1\n until (array.each_cons(2).all? { |a, b| (a <=> b) <= 0}) == true do\n sort = lambda {array[a] <=> array[b]}\n sort_call = sort.call\n loop do\n case sort_call\n when -1 #don't swap\n a += 1\n b += 1\n break\n when 0 #don't swap\n a += 1\n b += 1\n break\n when 1 #swap\n array.insert(a,array.delete_at(b))\n a += 1\n b += 1\n break\n else #end of array, return to start\n a = 0\n b = 1\n break\n end\n end\n end\n puts array.inspect\nend",
"title": ""
},
{
"docid": "9c6469d415387d46c0ed380ec399eeb7",
"score": "0.8526701",
"text": "def bubble_sort(array)\r\n n = array.length\r\n loop do\r\n swapped = false\r\n (n-1).times do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1]=array[i+1], array[i]\r\n swapped = true\r\n end\r\n end\r\n break if not swapped\r\n end\r\n array\r\nend",
"title": ""
},
{
"docid": "81305474a54e3ed197b88dfbd8d68f73",
"score": "0.85183746",
"text": "def bubble_sort!(array)\n n = array.length\n \n loop do\n swapped = false \n \n 1.upto(n - 1) do |index|\n next if array[index - 1] <= array[index]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n \n break unless swapped\n n -= 1\n end\n\n p array\nend",
"title": ""
},
{
"docid": "f675cb224ee0e3bf680329932efbf250",
"score": "0.85155326",
"text": "def bubble_sort(array)\n array_length = array.length\n loop do\n sort = false\n\n (array_length -1).times do |num|\n if array[num] > array[num+1]\n array[num], array[num+1] = array[num+1], array[num]\n sort = true\n end\n end\n\n break if not sort\n end\n\n array\nend",
"title": ""
},
{
"docid": "f675cb224ee0e3bf680329932efbf250",
"score": "0.85150915",
"text": "def bubble_sort(array)\n array_length = array.length\n loop do\n sort = false\n\n (array_length -1).times do |num|\n if array[num] > array[num+1]\n array[num], array[num+1] = array[num+1], array[num]\n sort = true\n end\n end\n\n break if not sort\n end\n\n array\nend",
"title": ""
},
{
"docid": "3d0b2080fb53d28afe08198d09d05b46",
"score": "0.8513832",
"text": "def bubble_sort(array)\n n = array.length\n loop do\n swapped = false \n (n - 1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true \n end \n end \n break if not swapped\n end\n array \nend",
"title": ""
},
{
"docid": "a9a70a98921a1ee97095148f4cb8ce4d",
"score": "0.85083884",
"text": "def bubble_sort!(array)\n n = array.length\n\n loop do\n swapped = false\n\n 1.upto(n - 1) do |i|\n if array[i -1] > array[i]\n array[i - 1], array[i] = array[i], array[i - 1]\n swapped = true\n end\n end\n break if swapped == false\n end\n nil\nend",
"title": ""
},
{
"docid": "fc4747109986be55d1012509c906b7bb",
"score": "0.85079926",
"text": "def bubble_sort!(array)\n round = 1\n loop do \n \n i = 0\n loop do\n if (array[i] <=> array[i + 1]) == 1\n array[i], array[i + 1] = array[i + 1], array[i]\n end \n i += 1\n break if i == array.size - 1\n end \n \n round += 1 \n break if round == array.size\n end \n array\nend",
"title": ""
},
{
"docid": "63fba5e94abbce0b7b10520d030123ef",
"score": "0.85053176",
"text": "def bubble_sorter(array)\n \n array_length = array.length\n\n ready_to_stop = false \n until ready_to_stop\n\n if array != array.sort\n \n index = 0\n while index <= array_length - 2\n p array\n \n if array[index].to_i > array[(index + 1)].to_i\n #puts \"Comparing #{array[index].to_i} to #{array[(index + 1)].to_i}\"\n \n original_first = (array[index].to_i)\n original_second = (array[index + 1].to_i)\n \n array[index] = original_second\n array[index + 1] = original_first\n else\n #puts \"Comparing #{array[index].to_i} to #{array[(index + 1)].to_i}\"\n \n end\n index += 1\n \n end\n #puts \"One pass through\"\n ready_to_stop = false\n else\n ready_to_stop = true\n end\nend\n array \nend",
"title": ""
},
{
"docid": "9eb92b1bb9f32ed4203809440078972c",
"score": "0.85021484",
"text": "def bubble_sort(arr)\n\tif arr.length <= 1 \n\t\treturn arr\n\tend\n\tloop do \n\t\tswap_flag = false\n\t\t(arr.length - 1).times do |i|\n\t\t\tif arr[i] > arr[i+1]\n\t\t\t\tarr[i], arr[i+1] = arr[i+1], arr[i]\n\t\t\t\tswap_flag = true\n\t\t\tend\n\t\tend\n\t\tbreak if not swap_flag\n\tend\n\tarr\nend",
"title": ""
},
{
"docid": "ae51c343871dbdfa78dd7a55b0e5578c",
"score": "0.8501563",
"text": "def bubble_sort!(array)\n\n compare_array = []\n\n loop do\n array.each_with_index do |num, index|\n break if (array[index + 1]) == nil\n if array[index] > array[index+1]\n array[index], array[index+1] = array[index+1], array[index]\n end\n end\n\n return array if compare_array == array\n compare_array = array.clone\n end\n array\nend",
"title": ""
},
{
"docid": "208d62dfb5f7162d5858023315ff8b80",
"score": "0.84977835",
"text": "def bubble_sort(array)\n\t\n\tn = array.length\n\n\tloop do\n\t\tsorted = false\n\n\t\t(n - 1).times do |i|\n\t\t\tif array[i] > array[i + 1]\n\t\t\t\tarray[i], array[i + 1]=array[i + 1], array[i]\n\t\t\t\tsorted = true\n\t\t\tend\n\t\tend\n\t\tbreak if not sorted\n\tend\n\tp array\nend",
"title": ""
},
{
"docid": "6c08c4c82447bd710b76436443761784",
"score": "0.84971",
"text": "def bubble_sort!(arr)\n loop do\n swap = false\n\n 1.upto(arr.size - 1) do |index|\n next if arr[index - 1] <= arr[index]\n arr[index - 1], arr[index] = arr[index], arr[index - 1]\n swap = true\n end\n \n break if swap == false \n end\n arr\nend",
"title": ""
},
{
"docid": "1e642790e1587468d6786aa2e4b3baf3",
"score": "0.849519",
"text": "def bubble_sort (array)\n n = array.length\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "1e642790e1587468d6786aa2e4b3baf3",
"score": "0.849519",
"text": "def bubble_sort (array)\n n = array.length\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "666d003b1b0d06c850de18c057d2e9ab",
"score": "0.84948987",
"text": "def bubble_sort(array)\r\n n = array.length \r\n loop do\r\n swapped = false\r\n\r\n (n-1).times do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1] = array[i+1], array[i]\r\n swapped = true\r\n end\r\n end\r\n\r\n break if not swapped\r\n end\r\n\r\n array\r\nend",
"title": ""
},
{
"docid": "84a1516ebc874bd69a21119040c01f68",
"score": "0.8493867",
"text": "def bubble_sort(array)\n\t#make a variable for the length of the array\n\tn = array.length\n\t#loop through each element of the array \n\tloop do |i|\n\t\t#establish a way to break the loop\n\t\tswapped = false\n\t\t#because we are using pairs of numbers, we want one less\n\t\t#than the length of the array, then DO THIS that many times\n\t\t(n-1).times do |i|\n\t\t\t#if the array integer is less than the one to its right,\n\t\t\t#switch them and move to the next integer in the array\n\t\t\tif array[i] > array[i+1]\n\t\t\t\tarray[i], array[i+1] = array[i+1], array[i]\n\t\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\t#once the numbers are not switching then swapped is not true\n\t\t#and the loop breaks\n\t\tbreak if not swapped\n\tend\n\tp array\nend",
"title": ""
},
{
"docid": "38e7fb4177c24e502473375407128bde",
"score": "0.8490416",
"text": "def bubble_sort(array)\n n = array.length\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"title": ""
},
{
"docid": "cc70f23fdec2809ac800428bcade24ab",
"score": "0.8490114",
"text": "def bubble_sort(array)\r\n n = array.length\r\n loop do\r\n swapped = false\r\n\r\n (n-1).times do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1] = array[i+1], array[i]\r\n swapped = true\r\n end\r\n end\r\n\r\n break if not swapped\r\n end\r\n\r\n array\r\nend",
"title": ""
},
{
"docid": "cc70f23fdec2809ac800428bcade24ab",
"score": "0.8490114",
"text": "def bubble_sort(array)\r\n n = array.length\r\n loop do\r\n swapped = false\r\n\r\n (n-1).times do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1] = array[i+1], array[i]\r\n swapped = true\r\n end\r\n end\r\n\r\n break if not swapped\r\n end\r\n\r\n array\r\nend",
"title": ""
},
{
"docid": "41f955a16c57e92ed03d26df8f5ff7cb",
"score": "0.8489166",
"text": "def bubble_sort(array)\n # find the amount of array elements\n a = array.length\n # set a boolean variable called swept.\n swept = true\n # start a while loop\n while swept do\n swept = false\n (a - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swept = true\n end\n end\n end\n return array\nend",
"title": ""
}
] |
3b8910ab70920414755c849afd0bf6eb
|
Prepare a fragment that can be used in SQL statements that converts teh data value from integer, string, or UUID to valid UUID string as per Postgres guidelines
|
[
{
"docid": "b6e796c7be1fcc69494760246b022212",
"score": "0.66029143",
"text": "def to_uuid_pg(column, seed)\n if seed\n \"uuid_generate_v5('#{seed}'::uuid, #{column}::text)\"\n else\n \"uuid(lpad(replace(text(#{column}),'-',''), 32, '0'))\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "66a98e3193968db7dd4c3bbedb6c1c27",
"score": "0.7051413",
"text": "def quote_with_uuid(value, column = nil) #:nodoc:\n return quote_without_uuid(value, column) if column.nil? || column.type.to_s.match(/^uuid/).nil?\n return value.strip == 'uuid_generate_v4()' ? \"#{value}\" : \"'#{value}'\"\n end",
"title": ""
},
{
"docid": "6463f1048dbfef34f526cdbdd062e963",
"score": "0.66169196",
"text": "def prepare_value(value)\n {uuid => value}\n end",
"title": ""
},
{
"docid": "54bd3151b59448c43d89570174f6b67e",
"score": "0.6139491",
"text": "def cast(value)\n if value.is_a?(MySQLBinUUID::Type::Data)\n # It could be a Data object, in which case we should add dashes to the\n # string value from there.\n add_dashes(value.to_s)\n elsif value.is_a?(String) && value.encoding == Encoding::ASCII_8BIT && strip_dashes(value).length != 32\n # We cannot unpack something that looks like a UUID, with or without\n # dashes. Not entirely sure why ActiveRecord does a weird combination of\n # cast and serialize before anything needs to be saved..\n undashed_uuid = value.unpack1('H*')\n add_dashes(undashed_uuid.to_s)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2d78fdef889fe43d756174e92065a7c3",
"score": "0.597291",
"text": "def column_to_uuid(table, column, seed: nil)\n execute %Q{ALTER TABLE #{table}\n ALTER COLUMN #{column} SET DATA TYPE UUID USING (#{to_uuid_pg(column, seed)})}\n end",
"title": ""
},
{
"docid": "1e7181062c9229f14c3336295f808f9b",
"score": "0.5875055",
"text": "def convert_uuid!(comment=nil)\n v = get(16).bytes.map{|x| \"%02x\" % x}\n vv = [\n v[0,4].join,\n v[4,2].join,\n v[6,2].join,\n v[8,2].join,\n v[10,6].join,\n ].join(\"-\")\n out_with_comment! \"<uuid>#{vv}</uuid>\", comment\n end",
"title": ""
},
{
"docid": "52a65d21adafe445f9b96e933a2e5885",
"score": "0.585856",
"text": "def build_sql(value_str)\n \"COPY #{value_str} FROM STDIN WITH (FORMAT csv, DELIMITER E'\\x0B')\"\n end",
"title": ""
},
{
"docid": "6622e9aa6a0ecb9a8f5d48201dd1ffa5",
"score": "0.58302075",
"text": "def serialize(value)\n return if value.nil?\n undashed_uuid = strip_dashes(value)\n\n # To avoid SQL injection, verify that it looks like a UUID. ActiveRecord\n # does not explicity escape the Binary data type. escaping is implicit as\n # the Binary data type always converts its value to a hex string.\n unless valid_undashed_uuid?(undashed_uuid)\n raise MySQLBinUUID::InvalidUUID, \"#{value} is not a valid UUID\"\n end\n\n Data.new(undashed_uuid)\n end",
"title": ""
},
{
"docid": "3e035903e04e7777b4f45e34d0304d08",
"score": "0.5787594",
"text": "def value_to_uuid(value)\n if value.is_a?(::Cql::Uuid)\n value\n else\n ::Cql::TimeUuid.new(value) rescue nil\n end\n end",
"title": ""
},
{
"docid": "f8e60100009095e1d2ced1a72d2a89c5",
"score": "0.57780236",
"text": "def from_param(string)\n UUID.parse(string)\n end",
"title": ""
},
{
"docid": "421cdcf81986c5efd0941f44cb30eecb",
"score": "0.5773411",
"text": "def quote_default_value(value, column)\n if column.type == :uuid && value =~ /\\(\\)/\n value\n else\n quote(value)\n end\n end",
"title": ""
},
{
"docid": "2e0373d26325ef90979c335914fce77b",
"score": "0.5760607",
"text": "def convert_sql(sql, definition)\n sql.gsub(/\\b\\d+\\b/, ':int').gsub(/`([^`]+)`/, '\\1').gsub(/'[^']*'/, ':string').rstrip\n end",
"title": ""
},
{
"docid": "68b429520b3a038efc910cef8c6fc86a",
"score": "0.5734932",
"text": "def format_uuid(raw)\n raise \"Uuid must be 10 digits\" unless 10 == raw.length\n \n \"#{raw[0..2]}-#{raw[3..5]}-#{raw[6..9]}\"\n end",
"title": ""
},
{
"docid": "e9de64a7dd17e9f102a3bd3087615b4f",
"score": "0.5713443",
"text": "def from_uuid_to_uuid(representation)\n if representation != :standard\n raise ArgumentError,\n 'Binary of type :uuid can only be stringified to :standard representation, ' \\\n \"requested: #{representation.inspect}\"\n end\n\n data\n .chars\n .map { |n| '%02x' % n.ord }\n .join\n .sub(/\\A(.{8})(.{4})(.{4})(.{4})(.{12})\\z/, '\\1-\\2-\\3-\\4-\\5')\n end",
"title": ""
},
{
"docid": "0e3afce55b8d7779df236523a2d0003d",
"score": "0.56818134",
"text": "def from_uuid_old_to_csharp_legacy_uuid(hex)\n hex.sub(/\\A(..)(..)(..)(..)(..)(..)(..)(..)(.{16})\\z/, '\\4\\3\\2\\1\\6\\5\\8\\7\\9')\n end",
"title": ""
},
{
"docid": "a824ee5b34eb3be3e42cb2425a3bb04c",
"score": "0.56294936",
"text": "def from_uuid_old_to_python_legacy_uuid(hex)\n hex\n end",
"title": ""
},
{
"docid": "44bbdc3e3166058eb513cfe57eb845be",
"score": "0.562161",
"text": "def prepared_statement_arg(v)\n case v\n when Numeric\n v.to_s\n when Date, Time\n literal(v).gsub(\"'\", '')\n else\n v\n end\n end",
"title": ""
},
{
"docid": "e41dbe5b71d12eaea8d79d7f4e8c4ffa",
"score": "0.5582815",
"text": "def uuid2\n hexchars = (('0'..'9').to_a).concat(('a'..'f').to_a)\n sections = [8, 4, 4, 4, 12]\n result = ''\n\n sections.each do |section|\n section.times do\n result << hexchars.sample.to_s\n end\n result << '-'\n end\n\n result.chop # to cut off trailing char\nend",
"title": ""
},
{
"docid": "67f03a4987c958ecbc16e812986b4014",
"score": "0.5502986",
"text": "def to_param\n if uuid_changed? and uuid_was and !Vidibus::Uuid.validate(uuid)\n uuid_was\n else\n uuid\n end\n end",
"title": ""
},
{
"docid": "8570ab09e172590b8e906072663cf5e9",
"score": "0.5477277",
"text": "def frac2uuid frac\n val = (\"%030x\" % (0xffffffffffffffffffffffffffffffff * frac).to_i).chars\n \"00000000-00\\x0100-00\\x0200-0000-000000000000\".chars.map{|c|\n c != '0' ? c : val.shift\n }.join\nend",
"title": ""
},
{
"docid": "483f64c97f62cd95b3dda9a6748b3ce9",
"score": "0.54711103",
"text": "def from_uuid_old_to_uuid(representation)\n if representation.nil?\n raise ArgumentError, 'Representation must be specified for BSON::Binary objects of type :uuid_old'\n end\n\n hex = data.chars.map { |n| '%02x' % n.ord }.join\n handler = :\"from_uuid_old_to_#{representation}_uuid\"\n\n raise ArgumentError, \"Invalid representation: #{representation}\" unless respond_to?(handler, true)\n\n send(handler, hex)\n .sub(/\\A(.{8})(.{4})(.{4})(.{4})(.{12})\\z/, '\\1-\\2-\\3-\\4-\\5')\n end",
"title": ""
},
{
"docid": "7b3fbfd1101aece9ce645c261b91e41c",
"score": "0.5413856",
"text": "def to_param\n uuid\n end",
"title": ""
},
{
"docid": "7b3fbfd1101aece9ce645c261b91e41c",
"score": "0.5413856",
"text": "def to_param\n uuid\n end",
"title": ""
},
{
"docid": "7b3fbfd1101aece9ce645c261b91e41c",
"score": "0.5413856",
"text": "def to_param\n uuid\n end",
"title": ""
},
{
"docid": "abf89cbbf1fb9c414d182c2e088007b5",
"score": "0.5391656",
"text": "def from_uuid_old_to_java_legacy_uuid(hex)\n hex.sub(/\\A(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)\\z/) do\n (::Regexp.last_match[1..8].reverse + ::Regexp.last_match[9..16].reverse).join\n end\n end",
"title": ""
},
{
"docid": "979cc9dccaaf14f48d7efd60b04dc267",
"score": "0.53877443",
"text": "def parsed_uuid(uuid)\n components = uuid.split(\"::\")\n\n database_model = components[0..-2].join(\"::\")\n id = components.last\n\n [database_model, id]\n end",
"title": ""
},
{
"docid": "8078e89cb6f44e15fd2f66cd4ac949b9",
"score": "0.5386227",
"text": "def create_uid(id)\n id.parameterize\n end",
"title": ""
},
{
"docid": "5bcb63a93865c79460c09528c0e02bfb",
"score": "0.5370688",
"text": "def create_uuid\n characters = [*'a'..'f', *'0'..'9']\n \"#{characters.sample(8).join}-#{characters.sample(4).join}-#{characters.sample(4).join}-#{characters.sample(4).join}-#{characters.sample(12).join}\"\nend",
"title": ""
},
{
"docid": "a6e00bb6f6074659839adae0e80a6347",
"score": "0.5355872",
"text": "def new_uuid\n string_values = ['1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']\n uuid = \"\"\n 8.times {uuid += string_values.sample}\n uuid += \"-\"\n 3.times\n 4.times {uuid+= string_values.sample}\n uuid += \"-\"\n 12.times {uuid += string_values.sample}\n uuid\nend",
"title": ""
},
{
"docid": "f51bf6b47e1367a22b5078f1de4347e6",
"score": "0.53474337",
"text": "def create_uuid\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n \n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n \n uuid\nend",
"title": ""
},
{
"docid": "397f59933134bd613bc576cbedb6f958",
"score": "0.5336406",
"text": "def primary_key_to_uuid(table, options = {})\n default = options[:default] || 'gen_random_uuid()'\n seed = options[:seed]\n\n column = connection.primary_key(table)\n\n execute %Q{ALTER TABLE #{table}\n ALTER COLUMN #{column} DROP DEFAULT,\n ALTER COLUMN #{column} SET DATA TYPE UUID USING (#{to_uuid_pg(column, seed)}),\n ALTER COLUMN #{column} SET DEFAULT #{default}}\n\n execute %Q{DROP SEQUENCE IF EXISTS #{table}_#{column}_seq} rescue nil\n end",
"title": ""
},
{
"docid": "4de73ab1ee77773e60ff319425082af8",
"score": "0.5329087",
"text": "def olduuid uuid\n\trf = uuid\n\trf.insert(8, \"-\")\n\trf.insert(13, \"-\")\n\trf.insert(18, \"-\")\n\trf.insert(23, \"-\")\n\treturn rf\nend",
"title": ""
},
{
"docid": "25f0ceb74639c45a402b15eb6e51a286",
"score": "0.53244495",
"text": "def create_uuid\n uuid = ''\n sections = [8, 4, 4, 4, 12]\n\n sections.each do |section|\n section.times { uuid += HEX.sample }\n uuid += '-' unless section == 12\n end\n \n uuid\nend",
"title": ""
},
{
"docid": "481173d811de19c49202e0c95a6a88aa",
"score": "0.53236276",
"text": "def uuid_method\nhexadecimal_chars = %w(a b c d e f 0 1 2 3 4 5 6 7 8 9)\n\nfour_digit_array = []\nsecond_four_digit_array = []\nthird_four_digit_array = []\neight_digit_array = []\ntwelve_digit_array = []\n\nuntil four_digit_array.length == 4\nfour_digit_array << hexadecimal_chars.sample\nend\nuntil second_four_digit_array.length == 4\nsecond_four_digit_array << hexadecimal_chars.sample\nend\nuntil third_four_digit_array.length == 4\nthird_four_digit_array << hexadecimal_chars.sample\nend\nuntil eight_digit_array.length == 4\neight_digit_array << hexadecimal_chars.sample\nend\nuntil twelve_digit_array.length == 4\ntwelve_digit_array << hexadecimal_chars.sample\nend\n\"#{eight_digit_array.join}-#{four_digit_array.join}-#{second_four_digit_array.join}-#{third_four_digit_array.join}-#{twelve_digit_array.join}\"\nend",
"title": ""
},
{
"docid": "34b153fb4fef0fb9dad6810f280c740e",
"score": "0.5315233",
"text": "def sql_string(value)\n \"'#{value.gsub(\"'\", \"''\")}'\" \nend",
"title": ""
},
{
"docid": "3125f3cf64ab941417af81eacf1b7875",
"score": "0.5315079",
"text": "def build_UUID\n uuid = \"\"\n segment = \"\"\n character_set = ('a'..'f').to_a + (0..9).to_a\n\n sections = [8, 4, 4, 4, 12]\n uuid = sections.map do |section|\n segment = \"\"\n section.times do \n segment += character_set.sample.to_s \n end\n segment\n end.join('-')\nend",
"title": ""
},
{
"docid": "12f6b54e2ff275043f7644861be1ecf7",
"score": "0.52857333",
"text": "def literal_blob_append(sql, v)\n if v.empty?\n sql << \"''\"\n else\n sql << \"x'#{v.unpack('H*').first}'\"\n end\n end",
"title": ""
},
{
"docid": "d561f3b8b4fadc89abf7910a77322cf6",
"score": "0.5281775",
"text": "def create_uuid()\n characters = []\n ('a'..'z').each { |let| characters << let}\n ('0'..'9').each { |num| characters << num}\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |num, index|\n num.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "eaebe9ad73a8855be9c7fb70f6889939",
"score": "0.527655",
"text": "def create_uuid_2\n characters = []\n uuid = ''\n ('a'..'f').each { |char| characters << char}\n (0..9).each { |digit| characters << digit.to_s }\n \n sections = [8, 4, 4, 4, 12]\n\n sections.each_with_index do |section, index|\n section.times { uuid << characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "16f94c12c87aa98e3d87c710b25cab8b",
"score": "0.5275216",
"text": "def to_param\n uuid\n end",
"title": ""
},
{
"docid": "73abebc98abbe81ea243fa7964d5d225",
"score": "0.52689034",
"text": "def to_param\n uuid\n end",
"title": ""
},
{
"docid": "6719e7c9b34bba8367d12269c0b876a1",
"score": "0.5265947",
"text": "def create_uuid()\n possibles = ('a'..'z').to_a.concat((1..9).to_a)\n portions = [8, 4, 4, 4, 12]\n\n uuid = portions.map do |portion|\n uuid_string = ''\n portion.times { uuid_string += possibles.sample.to_s }\n uuid_string\n end\n\n uuid.join('-')\nend",
"title": ""
},
{
"docid": "c60a849ea006e3b1a303051af7e5554e",
"score": "0.5259365",
"text": "def create_uuid\n hex = (\"a\"..\"f\").to_a\n (0..9).each{|num| hex << num.to_s}\n \n uuid = \"\"\n uuid_format = [8,4,4,4,12]\n uuid_format.each do |num|\n num.times{ uuid += hex.sample}\n uuid += \"-\" if uuid.length < 36\n end\n uuid\nend",
"title": ""
},
{
"docid": "6231a3565937c50fdf97b94dbb8f9494",
"score": "0.52447736",
"text": "def prepare(value)\n value.to_s.gsub('\"', '\\\"')\n end",
"title": ""
},
{
"docid": "ce6160880b5ed2d1f3d41c0f4c6b815c",
"score": "0.5239123",
"text": "def uuid\n char = (0..9).collect { |n| n.to_s }\n char += ('a'..'f').to_a\n blocks = [8,4,4,4,12]\n \n uuid = ''\n blocks.each do |num|\n while num >= 0\n uuid << char.sample\n num -= 1\n end\n uuid += '-' \n end\n uuid.chop\nend",
"title": ""
},
{
"docid": "50105d4e6fc56163a3e37ee5ba9118c1",
"score": "0.5226845",
"text": "def create_UUID\n characters =[]\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= section.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "89bff074a885875c3de4fe8b55d6bf7a",
"score": "0.52210265",
"text": "def normalize_object_id_strings(str, options)\n str = str.gsub(/#<(.*?):0x[a-f\\d]+/, '#<\\1:placeholder_id') unless options[:skip_standard]\n str = str.gsub(/BSON::ObjectId\\('[a-f\\d]{24}'\\)/, 'placeholder_bson_id') unless options[:skip_bson]\n str\nend",
"title": ""
},
{
"docid": "89bff074a885875c3de4fe8b55d6bf7a",
"score": "0.52210265",
"text": "def normalize_object_id_strings(str, options)\n str = str.gsub(/#<(.*?):0x[a-f\\d]+/, '#<\\1:placeholder_id') unless options[:skip_standard]\n str = str.gsub(/BSON::ObjectId\\('[a-f\\d]{24}'\\)/, 'placeholder_bson_id') unless options[:skip_bson]\n str\nend",
"title": ""
},
{
"docid": "81d2150097ef3d71bb103d56ee9be137",
"score": "0.52145904",
"text": "def make_uuid\n hex_arr = (0..9).to_a + ('a'..'f').to_a\n hex_arr = hex_arr.map!(&:to_s)\n \n uuid = \"\"\n sections = [8, 4, 4, 4, 12] \n sections.each_with_index do |section, index|\n section.times { uuid += hex_arr.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "0fc7cce1d1bd2cb9de1a7a71e10654d5",
"score": "0.5214409",
"text": "def new_uuid\n uuid_arr = []\n ('a'..'f').each {|char| uuid_arr << char}\n (0..9).each {|num| uuid_arr << num.to_s}\n\n uuid = \" \"\n uuid_arr.sample\n\nend",
"title": ""
},
{
"docid": "85ea1f58c397624c37038cb8c3618437",
"score": "0.51847744",
"text": "def quote_identifier(v)\n schema_utility_dataset.quote_identifier(v)\n end",
"title": ""
},
{
"docid": "85ea1f58c397624c37038cb8c3618437",
"score": "0.51847744",
"text": "def quote_identifier(v)\n schema_utility_dataset.quote_identifier(v)\n end",
"title": ""
},
{
"docid": "1571c94069c440e59c9c01a6b8009149",
"score": "0.51536024",
"text": "def quote_identifier(v)\n schema_utility_dataset.quote_identifier(v)\n end",
"title": ""
},
{
"docid": "1571c94069c440e59c9c01a6b8009149",
"score": "0.51536024",
"text": "def quote_identifier(v)\n schema_utility_dataset.quote_identifier(v)\n end",
"title": ""
},
{
"docid": "196055ff37b4449a8fca475474274098",
"score": "0.5127391",
"text": "def literal_blob_append(sql, v)\n sql << \"'\" << v.gsub(/[\\000-\\037\\047\\134\\177-\\377]/n){|b| \"\\\\#{(\"%o\" % b[0..1].unpack(\"C\")[0]).rjust(3, '0')}\"} << \"'\"\n end",
"title": ""
},
{
"docid": "aa3c6365ae8a89eb94d88101f5c3b853",
"score": "0.5127046",
"text": "def create_uuid\n options = ('a'..'f').to_a + (0..9).to_a\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times {uuid += options.sample.to_s}\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "3d8ae4fc2f357d9cb75d611d9eaf4abc",
"score": "0.5124963",
"text": "def valid_id?(value)\n value.is_a?(String) && value.match?(UUID_PATTERN)\n end",
"title": ""
},
{
"docid": "930bac2fe0e780219e04636d72e51a67",
"score": "0.5117326",
"text": "def set_uuid(uuid=create_uuid)\n field = model.uuid_field\n meth = :\"#{field}=\"\n if respond_to?(field) && respond_to?(meth) && (model.uuid_overwrite? || get_column_value(field).nil?)\n set_column_value(meth, uuid)\n end\n end",
"title": ""
},
{
"docid": "abef1579f8735747a18d1b389cff8560",
"score": "0.5098216",
"text": "def columns_to_uuid(table, *columns, seed: nil)\n columns.each do |column|\n column_to_uuid(table, column, seed: seed)\n end\n end",
"title": ""
},
{
"docid": "b4340bdd482cfcbaf094d0150eb20c17",
"score": "0.5085348",
"text": "def gen_uuid\n `uuidgen -t`.chomp.delete('-')\nend",
"title": ""
},
{
"docid": "8db215f9ca37dbb965c89247e0311c28",
"score": "0.5076721",
"text": "def generate_uuid\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit.to_s}\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= section.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "67bb04786a85eb130bcab5cbb696faf2",
"score": "0.50678205",
"text": "def revert_postgres_type( type )\n case type\n when /\\Acharacter varying/\n return :String, :default_size => 255\n when /\\Acharacter/\n return :String, :fixed => true, :default_size => 255\n when /\\Atext\\z/\n return :String, :text => true\n when /\\Abytea\\z/\n return :blob\n when /\\Atimestamp/\n return :timestamp\n end\n end",
"title": ""
},
{
"docid": "01b7d44247a4e881f54f0c5a777f3e13",
"score": "0.5065712",
"text": "def convert_identifier(identifier)\n case identifier\n when SQL::Identifier\n identifier.value.to_s\n else\n identifier\n end\n end",
"title": ""
},
{
"docid": "30804ce547a53fcb9aa3a178350f7df5",
"score": "0.50626236",
"text": "def getSampleValueFromUUID(uuidStr, colName)\n sampleID = ConvertUUIDToBarcode.getBarcode(uuidStr)\n return nil if sampleID.nil?\n \n truncSampleID = sampleID.split(\"-\")[0..@barcodeLen-1].join(\"-\")\n self.getSampleValue(truncSampleID, colName)\n end",
"title": ""
},
{
"docid": "22b4d85b13fab71cdccc222b125ec721",
"score": "0.5060707",
"text": "def raw\n command = \"create_uuid\"\n end",
"title": ""
},
{
"docid": "c07e6e4947bd8d8cd86272cd25c53b71",
"score": "0.50413734",
"text": "def get_uuid\n characters = ('0'..'9').to_a + ('a'..'f').to_a\n dash_positions = [8, 13, 18, 23]\n uuid = []\n\n 32.times do\n uuid.push(characters.sample)\n end\n uuid.each_with_index{ |char, ind| uuid.insert(ind, '-') if dash_positions.include?(ind) }\n uuid.join\nend",
"title": ""
},
{
"docid": "18d178cf04564616dbff7bbadf29b351",
"score": "0.5031813",
"text": "def generate_uuid_for_string(string)\n ary = Digest::SHA256.hexdigest(string).unpack(\"NnnnnN\")\n ary[2] = (ary[2] & 0x0fff) | 0x4000\n ary[3] = (ary[3] & 0x3fff) | 0x8000\n sprintf \"%08x-%04x-%04x-%04x-%04x%08x\", *ary\n end",
"title": ""
},
{
"docid": "5101400989970444427e6db1f439860a",
"score": "0.50235504",
"text": "def generate_sql\n sql = 'guid, obj_id'\n @fields.each do |field|\n sql << ',v'\n sql << field.num.to_s\n sql << ' as '\n sql << field.name\n end\n return sql\n end",
"title": ""
},
{
"docid": "569aa49d9e14c1e87c861fa1894ff154",
"score": "0.5020207",
"text": "def before_create\n super\n @uuid = Concept.find_by_sql(\"SELECT UUID() uuid\").first.uuid\n \n self.uuid = @uuid if !self.uuid?\n end",
"title": ""
},
{
"docid": "c3c2b739c57de5daad0518a58d480c19",
"score": "0.5020187",
"text": "def header_to_id(given)\n return '' unless given.is_a?(String)\n return '' unless given.match(/\\A[a-z\\d]{16,32}\\z/i)\n given\n end",
"title": ""
},
{
"docid": "93cc08f5e0c12b4daed1c5de9ccdbba4",
"score": "0.5004483",
"text": "def create_uuid\n hex = ('0'..'9').to_a + ('a'..'f').to_a\n uuid = ''\n sections = [8,4,4,4,12]\n sections.each_with_index do |section, index|\n section.times { uuid += hex.sample }\n uuid += '-' unless index == sections.size - 1\n end\n p uuid\nend",
"title": ""
},
{
"docid": "ecb1cc5c956a0a92c3844791cd1d104f",
"score": "0.49969143",
"text": "def prepare_statement_sub(sql)\n sql.gsub(/\\$\\d+/, '?')\n end",
"title": ""
},
{
"docid": "18deff7c3adafce88d18b93102a3db35",
"score": "0.49861902",
"text": "def uuid\n id = ''\n id << %w(0 1 2 3 4 5 6 7 8 9 a b c d e f).sample until id.size >= 32\n 4.times { |i| id.insert(8+i*5, '-') }\n id\nend",
"title": ""
},
{
"docid": "f185ffcc0aa0b8d252e91499c6cc7b75",
"score": "0.49847433",
"text": "def return_uuid\n possible = []\n possible << ('a'..'f').to_a\n possible << ('0'..'9').to_a\n possible.flatten!\n uuid = ''\n\n sample = [8, 4, 4, 4, 12]\n\n sample.each_with_index do | value, index |\n value.times { uuid += possible.sample }\n uuid += '-' unless sample.size <= index + 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "1000de4fe97aceeaf131a2c269f51294",
"score": "0.49818772",
"text": "def make_uuid()\n hex_set = %w(a b c d e f 1 2 3 4 5 6 7 8 9)\n uuid_string = ''\n counter = 1 \n 5.times do\n case counter\n when 1\n hex = 8\n when (2..4)\n hex = 4\n when 5\n hex = 12\n end \n hex.times { uuid_string << hex_set[rand(hex_set.size)] } \n uuid_string << '-' unless counter == 5\n counter += 1\n end\n uuid_string\nend",
"title": ""
},
{
"docid": "9b93c4fd37b7265064da29b75c2e95a4",
"score": "0.4972503",
"text": "def make_val(row_value, column_type)\n val = row_value\n if (row_value.nil?)\n val = 'NULL'\n else\n if (column_type == 'varchar' || column_type == 'text' || column_type == 'blob')\n val = \"'#{ Mysql2::Client.escape(row_value) }'\"\n elsif (column_type == 'datetime')\n # datetime values come back like '2014-12-25 11:11:11 -0500' and we want to remove the timezone offset\n val = \"'#{/(\\S* \\S*) .*/.match(val.to_s)[1]}'\"\n end\n end\n val\n end",
"title": ""
},
{
"docid": "273a5ed6b1d7f155e90dd0db2c715353",
"score": "0.4970057",
"text": "def brazilian_id(formatted: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e196d67e3de0fff641c05ab1d028512e",
"score": "0.49690244",
"text": "def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12] # integers representing the number of characters in each section\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1 # index >= 4\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "8c8d578488a229e628ac1a88e9c2baba",
"score": "0.4961298",
"text": "def generate_uuid\n hexadecimals = ('0'..'9').to_a.concat(('a'..'f').to_a)\n uuid = ''\n\n 32.times do\n uuid += hexadecimals.sample\n end\n uuid.insert(8, '-').insert(13, '-').insert(18, '-').insert(23, '-')\nend",
"title": ""
},
{
"docid": "302e344c769e4b2b4fd19c508b01d883",
"score": "0.49479645",
"text": "def make_uuid()\n uuid = \"\"\n 8.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n 3.times do\n 4.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n end\n 12.times { uuid << rand(16).to_s(16) }\n \n uuid\nend",
"title": ""
},
{
"docid": "4b473cb2f65bd46995bab00bd208b0b9",
"score": "0.4946477",
"text": "def uuid?(uuid)\n uuid_regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/\n uuid_regex.match?(uuid.to_s.downcase)\nend",
"title": ""
},
{
"docid": "6b501a8784c188659570f3cbefdc633d",
"score": "0.49456716",
"text": "def initialize(uuid)\n (/^\n (?<chunk1>[0-9a-f]{8}) -\n (?<chunk2>[0-9a-f]{4}) -\n (?<chunk3>[0-9a-f]{4}) -\n (?<chunk4>[0-9a-f]{2})\n (?<chunk5>[0-9a-f]{2}) -\n (?<chunk6>[0-9a-f]{12})\n $/ix =~ uuid) || fail(ArgumentError, \"Not in UUID format: #{uuid}\")\n\n @time_low = chunk1.hex\n @time_mid = chunk2.hex\n @time_hi_and_version = chunk3.hex\n @clock_seq_hi_and_reserved = chunk4.hex\n @clock_seq_low = chunk5.hex\n @node = chunk6.hex\n end",
"title": ""
},
{
"docid": "ad52b360cbe7e07264531625dc2554b1",
"score": "0.49446496",
"text": "def create_uuid\n if self.uuid.nil?\n valid_uid = false\n until valid_uid\n self.uuid = format_uuid(SecureRandom.hex(5))\n valid_uid = Voucher.find_by_uuid(self.uuid).nil?\n self.slug = self.uuid\n end\n end\n end",
"title": ""
},
{
"docid": "d4cc547ddf9ff6e89eaf273b3aa2b1f4",
"score": "0.4940366",
"text": "def quote(value, column = nil) #:nodoc:\n if value.kind_of?(String) && column && column.sql_type =~ /^xml$/\n \"xml '#{quote_string(value)}'\"\n elsif value.kind_of?(Numeric) && column && column.sql_type =~ /^money$/\n # Not truly string input, so doesn't require (or allow) escape string syntax.\n \"'#{value.to_s}'\"\n elsif value.kind_of?(String) && column && column.sql_type =~ /^bit/\n case value\n when /^[01]*$/\n \"B'#{value}'\" # Bit-string notation\n when /^[0-9A-F]*$/i\n \"X'#{value}'\" # Hexadecimal notation\n end\n elsif column && column.sql_type =~ /^datetime$/\n if (not value.nil?) && (value.acts_like?(:date) || value.acts_like?(:time))\n \"CONVERT(datetime,'#{quoted_date(value)}',120)\"\n else\n # Fixtures#insert_fixtures sets fields like +updated_now+ to a String instance (\"Time.now.to_s(:db)\")\n super\n end\n elsif column && column.sql_type =~ /^boolean$/\n \"'#{value ? 1 : 0}'\"\n elsif value.class.to_s == 'System::Byte[]' && column && column.sql_type =~ /^binary$/\n \"CONVERT(varbinary(max),'0x#{bytes_to_string(value)}',1)\" \n else\n super\n end\n end",
"title": ""
},
{
"docid": "5f3b5bf4a1d73f1508729a9a4d610566",
"score": "0.49370843",
"text": "def to_sql\n\n # Hide Amex numbers\n# if (!@titolo_name.nil?) \n# if (@categoria_name == \"AMERICAN EXPRESS\" || @categoria_name == \"BANK OF AMERICA\") \n# @titolo_name.gsub!(/\\*.*\\*/, \"\");\n# end\n# end\n\n \n\n return \"INSERT INTO expenses (`created`, `anno`, `missione_title`, `missione_id`, `categoria_title`, `categoria_code`, `titolo_name`, `amministrazione_id`, `amministrazione_title`, `programma_id`, `programma_title`, `pagamenti_residui`,`pagamenti_totali`) VALUES (NOW(), '#{@anno}','#{@missione_title.to_s.gsub(/\\\\/,'\\&\\&').gsub(/'/,\"''\")}', '#{@missione_id}', '#{@categoria_title.to_s.gsub(/'/, \"''\")}', '#{@categoria_code}', '#{@titolo_name.to_s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")}', '#{@amministrazione_id}', '#{@amministrazione_title.to_s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")}', '#{@programma_id}', '#{@programma_title.to_s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")}', #{@pagamenti_residui.gsub(/,/, \"\")}), #{@pagamenti_totali.gsub(/,/, \"\")});\"\n end",
"title": ""
},
{
"docid": "d548e08471927b37110db0e62b6afaee",
"score": "0.493249",
"text": "def from_string(string)\n UUID.parse(string)\n end",
"title": ""
},
{
"docid": "d353f1935f2798d0e9790912286b2c0b",
"score": "0.49314857",
"text": "def normalize_uuid(key)\n norm_key = key.downcase.gsub(/[-\\s]/, '')\n if 10 == norm_key.length\n \"#{norm_key[0..2]}-#{norm_key[3..5]}-#{norm_key[6..9]}\"\n else\n key\n end\n end",
"title": ""
},
{
"docid": "f2fb01d033586fd239b8a20837fac458",
"score": "0.4927975",
"text": "def another_generate_uuid\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |letter| characters << letter }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n uuid\nend",
"title": ""
},
{
"docid": "8ac57b25ad7125525e9ebf13f4ff84f2",
"score": "0.492568",
"text": "def coerce_to(klazz)\n api.read_uuid(uuid, CoercionHandler.new(api, klazz))\n end",
"title": ""
},
{
"docid": "3047aecc30149020856eae6b7e97c3cd",
"score": "0.49166447",
"text": "def valid_uuid_format?(uuid)\n !!(uuid =~ /^[A-Za-z0-9_\\-]{16,}$/)\n end",
"title": ""
},
{
"docid": "5ba9ad8db428f4fa47e01dcfec3d61ec",
"score": "0.4894858",
"text": "def prepare_value(value)\n return value if value.nil? || value.is_a?(String)\n\n value.to_s\n end",
"title": ""
},
{
"docid": "4fd83404eaddd034ace7e4a901cdb548",
"score": "0.48916432",
"text": "def generate_uuid\n characters = []\n ('a'..'z').each { |letter| characters << letter}\n (0..9).each { |integer| characters << integer}\n sections = [8, 4, 4, 4, 12]\n uuid = []\n sections.each do |digit_quantity|\n uuid << characters.flatten.sample(digit_quantity).join\n end\n uuid.join('-')\nend",
"title": ""
},
{
"docid": "5ac85c4d46eec5b33e14d3aa1dc5c1c5",
"score": "0.48903075",
"text": "def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "5ac85c4d46eec5b33e14d3aa1dc5c1c5",
"score": "0.48903075",
"text": "def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "5ac85c4d46eec5b33e14d3aa1dc5c1c5",
"score": "0.48903075",
"text": "def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "5ac85c4d46eec5b33e14d3aa1dc5c1c5",
"score": "0.48903075",
"text": "def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"title": ""
},
{
"docid": "4100169916d4b83af5801992f5289689",
"score": "0.48814952",
"text": "def uuid\n group_1 = 8.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"0a580bd3\"\n group_2 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"ad8e\"\n group_3 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"4aa1\"\n group_4 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"b825\"\n group_5 = 12.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"6442e98450ac\"\n\n \"#{group_1}-#{group_2}-#{group_3}_#{group_4}-#{group_5}\" # => \"0a580bd3-ad8e-4aa1_b825-6442e98450ac\"\nend",
"title": ""
},
{
"docid": "d063394d36a7777ccda3ecad4221b235",
"score": "0.4881403",
"text": "def cast_string(arg, sql_type = nil)\n cast(arg, sql_type || String).sql_string\n end",
"title": ""
},
{
"docid": "c1bea14381583a49072b6ff77b842cee",
"score": "0.48813272",
"text": "def as_sql(expression, aliaz)\n \"#{expression} #{quote_identifier(aliaz)}\"\n end",
"title": ""
},
{
"docid": "7f0fbb1616009238ceeb43edbd8d6b20",
"score": "0.4877017",
"text": "def to_formatted_uuid\n size == 16 ? ::UUID.parse_raw(self).to_s : self.freeze\n end",
"title": ""
},
{
"docid": "173f29e9cd8f9b6309c3f33b0851c085",
"score": "0.48667237",
"text": "def int_to_uuid(num)\n '00000000-0000-0000-0000-%012d' % num.to_i\n end",
"title": ""
}
] |
4357a984b404bc9c37c95eb4c4587e09
|
List StaticRouteBfdPeers Paginated list of all StaticRouteBfdPeers.
|
[
{
"docid": "8b1278114c421e949e1b9bb896ad8255",
"score": "0.55595016",
"text": "def list_static_route_bfd_peer_0(tier_0_id, opts = {})\n data, _status_code, _headers = list_static_route_bfd_peer_0_with_http_info(tier_0_id, opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "9a79a42545d70819ffb04c4c8ef78197",
"score": "0.61804277",
"text": "def list_static_hop_bfd_peers(logical_router_id, opts = {})\n data, _status_code, _headers = list_static_hop_bfd_peers_with_http_info(logical_router_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "942d5db70888096088c9355090f68fb0",
"score": "0.5862815",
"text": "def list_static_route_bfd_peer(tier_0_id, opts = {})\n data, _status_code, _headers = list_static_route_bfd_peer_with_http_info(tier_0_id, opts)\n data\n end",
"title": ""
},
{
"docid": "5eeedc24a1396574322a6cdbe05051f6",
"score": "0.57462037",
"text": "def index\n @peers = Peer.all\n end",
"title": ""
},
{
"docid": "81f0c46b792f2494b7122448df59013e",
"score": "0.57102406",
"text": "def list_static_route_bfd_peer_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer\"\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 PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer, 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 PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/static-routes/bfd-peers'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\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 => 'StaticRouteBfdPeerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi#list_static_route_bfd_peer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b7a8e761af2265b9e2caf66e9d366f7b",
"score": "0.5700795",
"text": "def list_peers\n client.make_request('/list-peers', 'post', params: {})\n end",
"title": ""
},
{
"docid": "d5602f62bbf4a7d7c444297a256851a0",
"score": "0.5545605",
"text": "def list_static_route_bfd_peer_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer_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 PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer_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 PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi.list_static_route_bfd_peer_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}/static-routes/bfd-peers'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\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 => 'StaticRouteBfdPeerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysRoutingStaticRoutesBFDPeersApi#list_static_route_bfd_peer_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9854b5f6895d3a38e7cde90f9411f5ec",
"score": "0.5409418",
"text": "def list_static_hop_bfd_peers_with_http_info(logical_router_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.list_static_hop_bfd_peers ...\"\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling LogicalRoutingAndServicesApi.list_static_hop_bfd_peers\"\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 LogicalRoutingAndServicesApi.list_static_hop_bfd_peers, 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 LogicalRoutingAndServicesApi.list_static_hop_bfd_peers, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/logical-routers/{logical-router-id}/routing/static-routes/bfd-peers\".sub('{' + 'logical-router-id' + '}', logical_router_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'StaticHopBfdPeerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#list_static_hop_bfd_peers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a86d6483338621da2454b8a3b6b6c827",
"score": "0.5345474",
"text": "def list_peers\n @replication_admin.listPeers\n end",
"title": ""
},
{
"docid": "a86d6483338621da2454b8a3b6b6c827",
"score": "0.5345474",
"text": "def list_peers\n @replication_admin.listPeers\n end",
"title": ""
},
{
"docid": "0d378e1af6c7b7a152a1498227dd211f",
"score": "0.5157833",
"text": "def index\n @peers = @peer_group.peers\n end",
"title": ""
},
{
"docid": "225b270257d7476c69de89b80d0b5b42",
"score": "0.5050941",
"text": "def list_peers\n @admin.listReplicationPeers\n end",
"title": ""
},
{
"docid": "5f3fcca87a5e4e39db6d41cf6f34c366",
"score": "0.50284505",
"text": "def index\n @mx_peers = MxPeer.order(:name)\n end",
"title": ""
},
{
"docid": "4c20612ee7193190eaaa6db83a7cfe29",
"score": "0.4906135",
"text": "def peers\n connection.get do |req|\n req.url \"status/peers\"\n end\n end",
"title": ""
},
{
"docid": "abc141a9de264c1184208aab3cc118c3",
"score": "0.48749158",
"text": "def friends\n with_client do\n friends = []\n results = client.get_connections(\"me\", \"friends\")\n begin\n friends += results\n results = results.next_page\n end while results\n friends\n end\n end",
"title": ""
},
{
"docid": "1516c9d73e31f40c98e154ff368ec7cb",
"score": "0.47738755",
"text": "def peers\n url = ['/v1/status/peers']\n ret = @conn.get concat_url url\n JSON.parse(ret.body)\n end",
"title": ""
},
{
"docid": "93e8285eac24da5c5cefd5c95001dabd",
"score": "0.47736597",
"text": "def peers\n @peers ||= []\n end",
"title": ""
},
{
"docid": "a670c4351bd1619aafdd6772fab4eb50",
"score": "0.47275633",
"text": "def peers\n rpc 'getpeers'\n end",
"title": ""
},
{
"docid": "f8a932c89caabd17c6fbf805d43b260b",
"score": "0.4722966",
"text": "def peers\n resp = RestClient.get peers_url\n return JSON.parse(resp.body) if resp.code == 200\n logger.warn(\"Unable to get peers. Resp code: #{resp.code} Resp message: #{resp.body}\")\n nil\n end",
"title": ""
},
{
"docid": "2a7cdd78d7557cd7ea01c338ac06f65d",
"score": "0.47213167",
"text": "def list_private_connection_peering_routes request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_private_connection_peering_routes_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::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "40b1ecae91dafb9784b316886347ec37",
"score": "0.46906468",
"text": "def peers\n @peers ||= options[:peers].map { |peer| Raft::Peer.new(peer) }\n end",
"title": ""
},
{
"docid": "0ee73a4fa3e497cbd1dabbfb48d05a12",
"score": "0.46846828",
"text": "def index\n @peers = @player.peers.all\n if @peers.empty?\n flash[:notice] = \"You have no Peers yet.\"\n redirect_to(new_player_peer_path(@player)) and return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @peers }\n end\n end",
"title": ""
},
{
"docid": "638533949d9a7ad7665f39c1bda0e586",
"score": "0.46664798",
"text": "def peers_get filter = nil\n peer = @client.query_get \"peers/get\", filter\n end",
"title": ""
},
{
"docid": "81c7e037cd0b19ec66c9450b3dac0ecb",
"score": "0.46470568",
"text": "def patch_static_route_bfd_peer(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts = {})\n patch_static_route_bfd_peer_with_http_info(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts)\n nil\n end",
"title": ""
},
{
"docid": "cd20d778cac8a4197690fbd8770ea66f",
"score": "0.46430677",
"text": "def index\n @send_links = SendLink.all\n end",
"title": ""
},
{
"docid": "d04f41a0a1897749a699025baaa0a22f",
"score": "0.4636338",
"text": "def index\n @broadcasts = Broadcast.paginate(page: params[:page],\n per_page: params[:per_page])\n .order('created_at DESC')\n end",
"title": ""
},
{
"docid": "0ab8161b72eb22683b3ad8d217e6614b",
"score": "0.46235412",
"text": "def peers filter = nil\n peers = @client.query_get \"peers\", filter\n if peers[\"success\"]\n return peers[\"peers\"]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "a6be09670be8e28207b6a759efff0a9b",
"score": "0.4622573",
"text": "def index\n @routes = Route.paginate(page: params[:page], per_page: 10)\n end",
"title": ""
},
{
"docid": "0fc8515e196f5ae7116204ef08d47048",
"score": "0.4597689",
"text": "def read_static_route_bfd_peer(tier_0_id, bfd_peer_id, opts = {})\n data, _status_code, _headers = read_static_route_bfd_peer_with_http_info(tier_0_id, bfd_peer_id, opts)\n data\n end",
"title": ""
},
{
"docid": "5d0a1dc9c393b934cf2c5c895925e00b",
"score": "0.45866504",
"text": "def patch_static_route_bfd_peer_0(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts = {})\n patch_static_route_bfd_peer_0_with_http_info(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts)\n nil\n end",
"title": ""
},
{
"docid": "c1e99fc547f427ffc57f0ee59b5583a9",
"score": "0.45749453",
"text": "def get_hyperflex_data_protection_peer_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HyperflexApi.get_hyperflex_data_protection_peer_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/hyperflex/DataProtectionPeers'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'HyperflexDataProtectionPeerResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"HyperflexApi.get_hyperflex_data_protection_peer_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: HyperflexApi#get_hyperflex_data_protection_peer_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "db5d7db23c6bb4763764d0e288c9f8c9",
"score": "0.45718235",
"text": "def list_static_routes(logical_router_id, opts = {})\n data, _status_code, _headers = list_static_routes_with_http_info(logical_router_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "44bdaf12a0c6337bfc7abd2a5aad40c7",
"score": "0.45581642",
"text": "def index\n @gateways = Gateway.where(type: 'peer', context: 'default').where(accountcode: @providers.all.map(&:id)).order(:accountcode).page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gateways }\n end\n end",
"title": ""
},
{
"docid": "7abd65ba1edf70bbe47996915fa3208a",
"score": "0.45577312",
"text": "def index\n @relays = Relay.all\n end",
"title": ""
},
{
"docid": "a8fbc524996653c4a4e634d7eb6d1c3e",
"score": "0.45553493",
"text": "def get_hyperflex_data_protection_peer_list(opts = {})\n data, _status_code, _headers = get_hyperflex_data_protection_peer_list_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "f7dba4801e75c418715b03121fffebe7",
"score": "0.45539075",
"text": "def show_peer_tableCFs(id)\n rpc = @admin.getReplicationPeerConfig(id)\n show_peer_tableCFs_by_config(rpc)\n end",
"title": ""
},
{
"docid": "e2e00916d7c30b84e17981cc6297158e",
"score": "0.4537599",
"text": "def list\n parsed = get_request '/api/route.aspx', query: { cmd: :routes }\n parsed['root']['routes']['route'].map { |route| Route.new route }\n end",
"title": ""
},
{
"docid": "1bf10c330bb694434bd0b4a409e2fb02",
"score": "0.45338434",
"text": "def peers(obj = nil)\n @peers ||= {}\n obj.nil? ? @peers.values.flatten : (@peers[obj] ||= [])\n end",
"title": ""
},
{
"docid": "1bf10c330bb694434bd0b4a409e2fb02",
"score": "0.45338434",
"text": "def peers(obj = nil)\n @peers ||= {}\n obj.nil? ? @peers.values.flatten : (@peers[obj] ||= [])\n end",
"title": ""
},
{
"docid": "d68987244e6658e1e747ab1decbfc20c",
"score": "0.45302776",
"text": "def index\n @tenant_contact_links = TenantContactLink.all.page params[:page]\n end",
"title": ""
},
{
"docid": "e58a709419a14a605cb7ec193ebf7cfb",
"score": "0.4525493",
"text": "def update_static_route_bfd_peer_0(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts = {})\n data, _status_code, _headers = update_static_route_bfd_peer_0_with_http_info(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts)\n data\n end",
"title": ""
},
{
"docid": "916efa4cda58370304ce0d2ec0f68d3b",
"score": "0.4524737",
"text": "def peers\n instances = @volt_app.store._active_volt_instances\n\n instances.where(server_id: {'$ne' => @server_id}).all.sync\n end",
"title": ""
},
{
"docid": "d4d7b7f04a2f5d3bae40b1115d47974a",
"score": "0.45105323",
"text": "def list\r\n\t\t@current_area = 'static_pages'\r\n\t\t@current_menu = 'static'\r\n\r\n\t\tsort_order ||= get_sort_order(\"s-name\", \"name\")\r\n\t\tsort_order ||= get_sort_order(\"s-path\", \"path\")\r\n\t\tsort_order ||= \"form_name IS NULL ASC, path ASC\"\r\n\r\n\t\tpage = params[:page] ? params[:page].to_i : 1\r\n\t\titems_per_page = 30\r\n\t\toffset = (page - 1) * items_per_page\r\n\r\n\t\t@static_page_count = StaticPage.count()\r\n\r\n\t\t@pages = Paginator.new(self, @static_page_count, items_per_page, page)\r\n\r\n\t\tif params[:delete] and params[:select]\r\n\t\t\tif @demo_admin\r\n\t\t\t\tredirect_to :action => :static_pages\r\n\t\t\telse\r\n\t\t\t\tc = params[:select].keys.collect { |k| \"id=#{k}\" }.join(' OR ')\r\n\t\t\t\tStaticPage.delete_all c\r\n\t\t\t\tredirect_to :action => :list\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@static_pages = StaticPage.find(:all, :order => sort_order, :offset => offset, :limit => items_per_page)\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "236ea13ae8e0e090a88df43b83fe6af3",
"score": "0.4510261",
"text": "def peers\n @peers ||= @options[:peers].map { |peer| Floss::Peer.new(peer, rpc_client_class: rpc_client_class) }\n end",
"title": ""
},
{
"docid": "3dc17174853c5dfd2ba9c6a7f1b8d925",
"score": "0.44845375",
"text": "def read_static_route_bfd_peer_0(tier_0_id, bfd_peer_id, opts = {})\n data, _status_code, _headers = read_static_route_bfd_peer_0_with_http_info(tier_0_id, bfd_peer_id, opts)\n data\n end",
"title": ""
},
{
"docid": "713650eddbcadbee5174830f9c015f6d",
"score": "0.4466883",
"text": "def update_static_route_bfd_peer(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts = {})\n data, _status_code, _headers = update_static_route_bfd_peer_with_http_info(tier_0_id, bfd_peer_id, static_route_bfd_peer, opts)\n data\n end",
"title": ""
},
{
"docid": "4867827f014e5426a18d3ececf7c7274",
"score": "0.44582957",
"text": "def peers_list(num)\n peers_list_all[0..num].map do |peer_id|\n hash = Marshal.load(File.open(peer_id, 'rb').read)\n hash['peer_id'] = peer_id\n hash\n end\n end",
"title": ""
},
{
"docid": "fc99a2c5108ea86d3e49fc68b5628bc8",
"score": "0.4452846",
"text": "def index\n @friends = current_user.friends.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "c1ab7e9886ad24f4e63a2960b9b54cdc",
"score": "0.44477388",
"text": "def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/get-all\", params)\n end",
"title": ""
},
{
"docid": "af12ee0f236a26d2c88043044382d996",
"score": "0.44387814",
"text": "def index\n add_breadcrumb t('index'), friendships_path\n \n respond_to do |format|\n format.html # index.html\n end\n end",
"title": ""
},
{
"docid": "e89a8471fd2c0478ac69224d312856e6",
"score": "0.44346732",
"text": "def friend_list()\n return self.get(\"/json/api/friend-list.php\")\n end",
"title": ""
},
{
"docid": "fc42e07e2692ff6bae131aaa06ea4986",
"score": "0.44310534",
"text": "def index\n @indexer_peers = IndexerPeer.all\n end",
"title": ""
},
{
"docid": "1aa7e9657bd9f4be631bdb3c549a8266",
"score": "0.4429912",
"text": "def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}\", params)\n end",
"title": ""
},
{
"docid": "8d3ebe0a5abf72f090915e35b3157391",
"score": "0.44129157",
"text": "def index\n @route_clients = RouteClient.all\n end",
"title": ""
},
{
"docid": "5f29ee8d74e4a1081dd6fdfc1c4dd437",
"score": "0.44061098",
"text": "def index\n @friend_lists = FriendList.all\n end",
"title": ""
},
{
"docid": "14309b769c7156fdbcb305b6b21c3493",
"score": "0.4405775",
"text": "def peers\n # TODO add find from previous connected peer at first.\n (find_from_dns_seeds + seeds).uniq\n end",
"title": ""
},
{
"docid": "64c3aee6f494e177b05434bf29942ab5",
"score": "0.44028696",
"text": "def index\n @neighbors = Neighbor.all\n end",
"title": ""
},
{
"docid": "f72aa8190ce31b3162c0f87241f667e7",
"score": "0.4379001",
"text": "def list()\n _params = {}\n return @master.call 'senders/list', _params\n end",
"title": ""
},
{
"docid": "dd7475496704d2166eda27a5b7560435",
"score": "0.4373784",
"text": "def index\n @forwarders = Forwarder.all\n end",
"title": ""
},
{
"docid": "a7e9578069bb252f98d3d3d531b1d90b",
"score": "0.4364361",
"text": "def peers(options = {})\n ret = send_get_request(@conn, ['/v1/status/peers'], options)\n JSON.parse(ret.body)\n end",
"title": ""
},
{
"docid": "c99ef736e96c3e25d17361c0783b204a",
"score": "0.43619162",
"text": "def peers\n\t vDC = vDChref\n response = self.class.get(\"/api/vdc/#{vDC}/peers\")\n peersarray = [response['References']['Reference']].flatten\t \n\t \tpeerURI = Array.new\n\t \tsiteName = Array.new\n\t \tsiteID = Array.new\n\t \ti = 0\n if peersarray[0] != nil\n\t\tpeersarray.each do |peer| \n\t\t\t\t\tpeerhref = peer['href']\n\t\t\t\t\tpeerURI[i] = peerhref[51..124]\n\t\t\t\t\tresponse = self.class.get(\"/api/vr/peers/#{peerURI[i]}\")\n\t\t\t\t\tpeerinfo = response['Peer']\n\t\t\t\t\tsiteName[i] = peerinfo['SiteName']\n\t\t\t\t\tsiteID[i] = peerinfo['SiteUuid']\n\t\t\t\t\ti+= 1\n\t\tend\n\t\tend #if != NIL\n\t\treturn peerURI, siteName, siteID\n end",
"title": ""
},
{
"docid": "49a9666431eed938b87e748adbb4ca2f",
"score": "0.43599382",
"text": "def index\n @beacon_receivers = BeaconReceiver.all\n end",
"title": ""
},
{
"docid": "49a9666431eed938b87e748adbb4ca2f",
"score": "0.43599382",
"text": "def index\n @beacon_receivers = BeaconReceiver.all\n end",
"title": ""
},
{
"docid": "3b5b4d540c2a99e4843bc59d6cdb5794",
"score": "0.43589962",
"text": "def index\n @configs = Config.where(user_id: current_user.id)\n respond_to do |format|\n format.html {render partial: 'list', collection: @configs }\n format.json { render :json => @configs.to_json(:include => [:peers]) }\n end\n end",
"title": ""
},
{
"docid": "6143cf1a2cf8fca330fd2771d856327e",
"score": "0.43525237",
"text": "def create_static_hop_bfd_peer(logical_router_id, static_hop_bfd_peer, opts = {})\n data, _status_code, _headers = create_static_hop_bfd_peer_with_http_info(logical_router_id, static_hop_bfd_peer, opts)\n return data\n end",
"title": ""
},
{
"docid": "a770b5b5ff116a833c07b936b1f6d17f",
"score": "0.43472475",
"text": "def index\n @ra_messages = RaMessage.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "1d9985484c8f4d980c2cbf22b1621a6f",
"score": "0.43460697",
"text": "def index\n @fbs = Fb.all\n end",
"title": ""
},
{
"docid": "a548654f4bb078523cd6ee207ca35fd2",
"score": "0.43450725",
"text": "def list()\n _params = {}\n return @master.call 'senders/list', _params\n end",
"title": ""
},
{
"docid": "e59d51cc0c255056dcd2b630ac29610d",
"score": "0.4340347",
"text": "def index\n @destinations = Destination.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "ed462e2be8736af4ac42a77bc2fc4a8a",
"score": "0.43388745",
"text": "def index\n\t\t@fb_lead_destinations = current_admin.fb_lead_destinations.order(:created_at)\n\tend",
"title": ""
},
{
"docid": "83f1ef1f0327f91c0f4f5b4ad0bace23",
"score": "0.43308127",
"text": "def index\n pageparam = \"a\"\n unless params[:page].nil?\n pageparam = params[:page].to_s.downcase\n end\n\n #@contacts =\n # Contact.order(\"name\").starts_with(aa.chr).page(params[:page]).per(100)\n #@contacts = Contact.page(pageparam).order(\"name\")\n @contacts = Contact.order(\"name\")\n\n if $refresh_social\n linkedin_start\n fb_start\n twitter_start\n\n #create one big collection of all contacts\n cnns = AllConnections.new(:contacts => @contacts, :fbfriends => @fbfriends, :twfriends => @twfriends, :lifriends => @lifriends)\n @connections = cnns.connections\n #@connections = Kaminari.paginate_array(@connections).page(params[:page])\n @connections = @connections.find_all{|cnn| cnn.name.downcase.starts_with?(pageparam)}\n\n else\n @connections = @contacts.where(\"name like :prefix\", prefix: \"#{pageparam}%\")\n #@connections = @contacts\n end\n\n render stream: true\n \n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @contacts }\n #end\n \n end",
"title": ""
},
{
"docid": "70d09c58cbe44b5e6c991b9a984fc18e",
"score": "0.4319587",
"text": "def peers\n @peers.clone\n end",
"title": ""
},
{
"docid": "d7cd6518dcf7394531106d28baa0f2bf",
"score": "0.43189335",
"text": "def peered_networks(name)\n raise ArgumentError, 'network does not exist' unless network?(name)\n\n list = []\n (network(name).peerings || []).each do |x|\n options = {\n direction: 'incoming',\n peering_name: x.name,\n region: @region\n }\n @compute.list_network_peering_routes(@project, name, options).items.each do |p|\n list.push(p)\n end\n end\n list\n end",
"title": ""
},
{
"docid": "153cc768115810c6d1d5de8f5bba695c",
"score": "0.4316291",
"text": "def index\n @directions = Direction.all\n @directions = @directions.page(params[:page] || 1)\n end",
"title": ""
},
{
"docid": "9b6c699244b851b8bf399f3fe5fda201",
"score": "0.43110788",
"text": "def conversations_list(options = {})\n if block_given?\n Pagination::Cursor.new(self, :conversations_list, options).each do |page|\n yield page\n end\n else\n post('conversations.list', options)\n end\n end",
"title": ""
},
{
"docid": "964aafbeedd6788dd8b2715e2f22d91a",
"score": "0.43074644",
"text": "def index\n @static_pages = StaticPage.all\n end",
"title": ""
},
{
"docid": "27782da9813604c82375bbe4db19fff7",
"score": "0.43038476",
"text": "def list_fiber()\n fiber = Fiber.new do\n loop do\n url = (@base_url + '/ping/list');\n response = send_to_server(url,Net::HTTP::Get,true,false,false);\n @list_json = json_parser(response.body) if response\n #avoiding shallow copy issues\n @overview = json_parser(response.body) if response\n Fiber.yield(response)\n end\n end\n return fiber;\n end",
"title": ""
},
{
"docid": "381f83bd01fc673abef3f6cb775c198c",
"score": "0.43021214",
"text": "def index\n @friend_links = FriendLink.find_all_by_published_and_level(1,0)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friend_links }\n end\n end",
"title": ""
},
{
"docid": "da6873c71e0124a20d322494e6863ccb",
"score": "0.4299067",
"text": "def findPossibleRoutes\n @possibleRoutes=[]\n currNode=circuit.start\n @possibleRoutes.push([currNode])\n findRoutes\n end",
"title": ""
},
{
"docid": "e4665d554b7d4968a4895bb3a9842448",
"score": "0.4297719",
"text": "def find_peer_tasks(running_count, peers, now)\n node = @server.bootstrap_nodes[0]\n return [] if @cache.include?(node)\n @cache << node\n [Task.new(name: 'find peer') {\n @server.setup_connection(node)\n }]\n end",
"title": ""
},
{
"docid": "327ad52e401ea55e15a076bbeb2f3e5e",
"score": "0.42920795",
"text": "def peer_list_with_port\n if new_resource.peer\n peer_list = []\n new_resource.peer.each do |p|\n peer_list << if !/.*:.*/.match?(p)\n p + \":9632\"\n else\n p\n end\n end\n peer_list\n end\n end",
"title": ""
},
{
"docid": "145b1aad5ee6e5d23143a0336a632a5a",
"score": "0.42833072",
"text": "def index\n @driver_trip_routes = DriverTripRoute.all\n end",
"title": ""
},
{
"docid": "e99641293ffcc6ff0e7523a3d217a0c1",
"score": "0.42830968",
"text": "def list\r\n if params[:bats]\r\n @bats = Bat.find(params[:bats])\r\n else\r\n @bats = Bat.active\r\n end\r\n end",
"title": ""
},
{
"docid": "b45ece508ea890a123578e933a635dfe",
"score": "0.42826766",
"text": "def index\n @bike_routes = BikeRoute.all\n end",
"title": ""
},
{
"docid": "6c29998957bb11f88cf1f360f6f24406",
"score": "0.42826447",
"text": "def list_all\n __log_activity\n __debug_route\n prm = paginator.initial_parameters.except(*Paginator::NON_SEARCH_KEYS)\n sort = prm.delete(:sort) || { updated_at: :desc }\n found = find_or_match_records(sort: sort, **prm)\n @list = paginator.finalize(found, **prm)\n respond_to do |format|\n format.html { render 'manifest/index' }\n format.json { render 'manifest/index' }\n format.xml { render 'manifest/index' }\n end\n rescue Record::SubmitError => error\n error_response(error)\n rescue => error\n error_response(error, root_path)\n end",
"title": ""
},
{
"docid": "bf9192d7c5fa901a346503651a5019cd",
"score": "0.42762056",
"text": "def index\n # @flags = Flag.all\n @new_threads = NewThread.all\n @replies = Reply.all\n @users = User.all.where(blocked: true)\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "b71de8a7e91940d5f91e42e5e049852e",
"score": "0.42738548",
"text": "def index\n @friends = Friend.all\n end",
"title": ""
},
{
"docid": "97a4cd351ab6433125b917f1d4f35319",
"score": "0.42716154",
"text": "def index\n @conversations = Mailbox.as_guest(current_user).paginate(page: params[:page], per_page: 10)\n end",
"title": ""
},
{
"docid": "54cc6bdb22c82e986214a4dadb454f46",
"score": "0.4270382",
"text": "def friends\n\t cursor = -1\n \t page = 0\n \t friends = []\n \t begin \n \t friendspage = one_page_friends(cursor)\n \t page +=1\n \t friends += friendspage[\"users\"] if friendspage\n \t cursor = friendspage[\"next_cursor\"] \n \t end until cursor == 0\n \t friends\n rescue => err\n \t RAILS_DEFAULT_LOGGER.error \"exception in getting user's friends #{err}\"\n raise err\n return\n\tend",
"title": ""
},
{
"docid": "703f5eecd29d393044ad04400738be81",
"score": "0.42680863",
"text": "def list_friends\n Friendship.where(recipient: self)\n end",
"title": ""
},
{
"docid": "963f8762e2c7c1dacdeb72a7b055391a",
"score": "0.42677975",
"text": "def index\n @boulder_routes = BoulderRoute.all\n end",
"title": ""
},
{
"docid": "6453ff49b9799415ad4f2c36c3529d21",
"score": "0.42667967",
"text": "def index\n\t\t@conversations = @mailbox.inbox.paginate(page: params[:page], per_page: 10)\n\tend",
"title": ""
},
{
"docid": "92ec92b05893d2bbd838ee2482b9a6a4",
"score": "0.42653462",
"text": "def index\n @friends = Friendship.paginate(:all, :conditions => {:user_id => current_user.id}, :page => params[:page], :per_page => 10)\n end",
"title": ""
},
{
"docid": "3f8be5d15b570016b5e059dc99d77d00",
"score": "0.42619362",
"text": "def index\n @cb_relationships = CbRelationship.all\n end",
"title": ""
}
] |
fc2b82a7c693a9745be49e6ed0307e53
|
GET /diver_reviews/1 GET /diver_reviews/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "e4c7c210ee719ddeb085ebb853ea226f",
"score": "0.76640004",
"text": "def get_reviews\n {\n \"reviews\" => Glassdoor.scrape(@name)\n }\n end",
"title": ""
},
{
"docid": "c6f6d0ddb7e225970c84d349820d0ac1",
"score": "0.7638905",
"text": "def reviews_of_a_book\n resp=get_access_token().get(\"/#{params[:type]}/subject/#{params[:id]}/reviews\")\n doc=REXML::Document.new(resp.body)\n @reviews=[]\n REXML::XPath.each(doc,\"//entry\") do |entry|\n @reviews << Douban::Review.new(entry.to_s)\n end\n \n render :json => @reviews.to_json\n\tend",
"title": ""
},
{
"docid": "9537122a27d68b6ea128e8d65cfa0858",
"score": "0.7619102",
"text": "def get_reviews\n @review = Review.find(params[:proposal_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "93de6ec59735daf31c2bf1692e44c55f",
"score": "0.75918895",
"text": "def get_review(id)\n get(\"1/reviews/#{id}\")\n end",
"title": ""
},
{
"docid": "c8b59323e47519a6d4b8948b3af42cdf",
"score": "0.75086737",
"text": "def index\n @diver_reviews = DiverReview.all\n end",
"title": ""
},
{
"docid": "65faade885828a58f963a57fb216fab2",
"score": "0.74888384",
"text": "def index\n @reviews = @reviewable.reviews\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "65faade885828a58f963a57fb216fab2",
"score": "0.74888384",
"text": "def index\n @reviews = @reviewable.reviews\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "e6828ab6f62994adb61858be55a44271",
"score": "0.7408252",
"text": "def get_reviews\n proceed_data_with(Fetchers::ReviewsFetcher.new(@doc))\n end",
"title": ""
},
{
"docid": "b73f9aab91721de6de090751f68892bf",
"score": "0.73015624",
"text": "def index\n render json: @product.reviews\n end",
"title": ""
},
{
"docid": "5476f72d517c456652aa8a19828f9319",
"score": "0.7258747",
"text": "def get_review(params)\n review_id = params[:id]\n utoken = params[:utoken]\n get(\"/reviews/#{review_id}\", { utoken: utoken })\n end",
"title": ""
},
{
"docid": "f187423c293bc66d60b36e7b6ace29ec",
"score": "0.7237048",
"text": "def index\n @product = Product.find(params[:product_id])\n @reviews = @product.reviews\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "60c9a13ae9f3beaa84f5d19d8af5f496",
"score": "0.71682423",
"text": "def index\n @reviews = Review.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "60c9a13ae9f3beaa84f5d19d8af5f496",
"score": "0.71682423",
"text": "def index\n @reviews = Review.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "60c9a13ae9f3beaa84f5d19d8af5f496",
"score": "0.71682423",
"text": "def index\n @reviews = Review.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "1e1e8e93902191c9a142c0682c5f4ab0",
"score": "0.7156623",
"text": "def index\n @reviews = Review.all\n render json: @reviews\n end",
"title": ""
},
{
"docid": "7965178044d229bbcc1636a766513c7d",
"score": "0.7152583",
"text": "def index\n @reviews = @book.reviews.includes(:user)\n reviews_serializer = parse_json(@reviews)\n json_response('Index Reviews', true, { reviews: reviews_serializer }, :ok)\n end",
"title": ""
},
{
"docid": "352a5028ee8b07ede466629a216d4dce",
"score": "0.7099528",
"text": "def index\n @reviews = @book.reviews\n respond_to do |format|\n format.html { redirect_to @book }\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "350ae61572189d712f7c1f81baae7204",
"score": "0.7078996",
"text": "def get_review(params, headers = {})\n review_id = params[:id]\n get(\"/reviews/#{review_id}\", {},headers)\n end",
"title": ""
},
{
"docid": "8bc39f41db0cb46b05042cf2eb9bcce6",
"score": "0.7071774",
"text": "def show\n @reviews = Review.where(resturent_id: @resturent.id)\n end",
"title": ""
},
{
"docid": "4b98c835d6599e16256a52da44201613",
"score": "0.7050551",
"text": "def getUserReviews()\n r = User.find_by(id: params[:user_id]).reviews\n if(r == nil)\n render json: {status: false, data: \"\", reason: \"User not found\"}\n return\n end\n ret = []\n r.find_each do |rev|\n ret << {user_id: rev.user_id, product_id: rev.product_id, title: rev.title, body: rev.body, rating: rev.rating}\n end\n render json: {status: true, data: ret.to_json, reason: \"\"}\n end",
"title": ""
},
{
"docid": "30cf59add65f104ad236b3ef1c2d0c38",
"score": "0.7039077",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "d1e426851027e1a5921408e83501d868",
"score": "0.7025598",
"text": "def getProductReviews\n r = Product.find_by(id: params[:product_id]).reviews\n if(r == nil)\n render json: {data: \"\", status: false, reason: \"Product not found!\"}\n return\n end\n ret = []\n r.find_each do |rev|\n ret << {user_id: rev.user_id, product_id: rev.product_id, title: rev.title, body: rev.body, rating: rev.rating}\n end\n render json: {data: ret.to_json, status: true, reason: \"\"}\n end",
"title": ""
},
{
"docid": "6dfe199c6f72e107412fbb0403b59709",
"score": "0.69841176",
"text": "def index\n @reviews\n end",
"title": ""
},
{
"docid": "e22f3bcedc4d3dea5cdcdc0561d8b88e",
"score": "0.69589716",
"text": "def index\n @reviews = params[:page] == 'all' ? @reviewable.reviews.kept : @reviewable.reviews.kept.page(params[:page]).per(params[:per_page])\n render json: @reviews, methods: [:company, :likes_count, :comments_count, :aspects], has_type: false\n end",
"title": ""
},
{
"docid": "685fbf607ef7f1198de891c0a44c9d63",
"score": "0.69540596",
"text": "def show\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "e3273b1aa7eb8e700506ca91095a2a83",
"score": "0.69378084",
"text": "def index\n @item_reviews = ItemReview.all\n\n render json: @item_reviews\n end",
"title": ""
},
{
"docid": "11b0d3a1173366547c14ad6741dc55b6",
"score": "0.69203174",
"text": "def fetch_reviews\n puts \"Fetching reviews for #{@reviewed_restaurants_count} restaurants...\"\n rest_ids = []\n @restaurants_array.sample(@reviewed_restaurants_count).each do |restaurant|\n rest_ids << restaurant['restaurant']['R']['res_id']\n end\n\n reviews_responses = []\n rest_ids.each do |restaurant_id|\n reviews_responses << api_fetch('reviews', {:res_id => restaurant_id})\n end\n\n reviews_array = []\n reviews_responses.each do |reviews_response|\n reviews_response['user_reviews'].each do |review|\n reviews_array << review\n end\n end\n\n save_json({:reviews => reviews_array}, Constants::REVIEWS_FILENAME)\n end",
"title": ""
},
{
"docid": "dd4b01d29c281978de3a51562cea449d",
"score": "0.69112194",
"text": "def reviews\n business_id = yelp_params(:business_id)[\"business_id\"]\n render :json => YelpApiAdapter.business_reviews(business_id)\n end",
"title": ""
},
{
"docid": "fbd148ef75a9983941baac78c1507d5d",
"score": "0.6908936",
"text": "def new\n @review=Recipe.find(params[:id]).reviews.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "a3ee79aea569c8fc2cd5de4684dcd0a7",
"score": "0.69077706",
"text": "def index\n @reviews = Review.all\n render \"index.json.jb\"\n end",
"title": ""
},
{
"docid": "656a4f0b12f08d0a6964e0ca0f6b6889",
"score": "0.6907514",
"text": "def index\n @reviews = Review.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "b1b8904dca539ace99bf8e8324045483",
"score": "0.68973476",
"text": "def index\n @reviews = Review.all(params[:refrigerator_id])\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.68858874",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "0a7961d9531b0764012137a851572b3b",
"score": "0.6885648",
"text": "def self_reviews\n if authenticate\n reviews = @user.reviews\n \n render :json => reviews\n else\n error_message(\"Wrong account credentials\")\n end\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "2890c5e7f4c2f157d2f62ee5397a410f",
"score": "0.688485",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "14da921aa7c8c8f4bd8de070ba8e8c36",
"score": "0.68796647",
"text": "def index\n\t\t@reviews = Review.all\n\tend",
"title": ""
},
{
"docid": "5f5d2afa7953d6f98f5f62927b3da0d0",
"score": "0.6878693",
"text": "def show\n @review = Review.find(params[:review_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "1f62d13d538f688180800cb6bd44e075",
"score": "0.68753654",
"text": "def index\n \n @@hotel_id=params[:hotel_id]\n \n @reviews = Review.where(:myreview_id=>params[:hotel_id])\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews}\n end\n end",
"title": ""
},
{
"docid": "402d9f5403bd45320ac8c1edf631e04c",
"score": "0.68513846",
"text": "def index\n reviews = Review.all\n\n render json: reviews.to_json\n end",
"title": ""
},
{
"docid": "a67f8a921ad6b12ae4673d1a2fd71f1c",
"score": "0.68504316",
"text": "def index\n @program = Program.find(params[:program_id])\n @reviews = @program.reviews\n end",
"title": ""
},
{
"docid": "0e06a98401cba4663da043a445d4da71",
"score": "0.68477637",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "3a0d3c88780382ed126cebf4ebd57979",
"score": "0.6838827",
"text": "def index\n @reviews = Review.all \n end",
"title": ""
},
{
"docid": "e41bca7b95781e1c8359249ac3d8180b",
"score": "0.68377984",
"text": "def reviews\n data = JSON.parse(@badfruit.get_movie_info(@id, \"reviews\"))\n reviews = Array.new\n data[\"reviews\"].each do |review|\n reviews.push(Review.new(review))\n end\n return reviews \n end",
"title": ""
},
{
"docid": "c752899205820ecb55b6c95c749443f2",
"score": "0.6831453",
"text": "def reviews(client, options = {})\n link = self.links.find { |link| link.rel == 'http://schemas.qype.com/reviews' }\n throw :reviews_not_found if link.nil?\n\n response = client.get(link.href, :query => options)\n Review.parse(response)\n end",
"title": ""
},
{
"docid": "f7e99578b3c224428d124d645102b703",
"score": "0.6810458",
"text": "def index\n @user_reviews = UserReview.find_all_by_reviewed_user_id(params[:user_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_reviews }\n end\n end",
"title": ""
},
{
"docid": "865a5632b2668a618abd8a2cf2263b84",
"score": "0.6808184",
"text": "def reviews\n load if @reviews.empty?\n @reviews\n end",
"title": ""
},
{
"docid": "865a5632b2668a618abd8a2cf2263b84",
"score": "0.6808184",
"text": "def reviews\n load if @reviews.empty?\n @reviews\n end",
"title": ""
},
{
"docid": "fb813a2c9e7f970dfebae1bc01513746",
"score": "0.6803657",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.6800836",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.68007135",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "4e332acab47989be36b61489590e1f9a",
"score": "0.6797699",
"text": "def new\n @review = @reviewable.reviews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "43af23d42f4a2553081ae8fa4da45468",
"score": "0.67976797",
"text": "def index \n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "ae7ed48f6b79c8c6bc65ee51220d90c7",
"score": "0.67973185",
"text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end",
"title": ""
},
{
"docid": "1e59fc1b1e5f6422fc46988e2af6d045",
"score": "0.6795837",
"text": "def index\n @recipe_reviews = RecipeReview.all\n end",
"title": ""
},
{
"docid": "f62ccb70f2d935807b41fd05c3e0f92c",
"score": "0.67934924",
"text": "def index\n @reviews = Review.all\n end",
"title": ""
},
{
"docid": "dc43492b3b9982ac49bc6f9c582a3c4f",
"score": "0.67875373",
"text": "def show\n render :json => @review.to_json(:except => :_id), status: :ok\n end",
"title": ""
},
{
"docid": "1dcf27fa3dc33f3b924d233dc8d5ad5b",
"score": "0.6775336",
"text": "def index\n @reviews = Review.paginate(page: params[:page], :per_page => 10, :order => \"created_at DESC\")#.joins(:user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "0552f3dde61f024df1e450f7b91765b9",
"score": "0.6769185",
"text": "def index\n reviews = Review.all\n # reviews = current_user.reviews\n render json: ReviewSerializer.new(reviews).serialized_json\n end",
"title": ""
},
{
"docid": "cbc05941c0cb91e8d8174fe05492afc5",
"score": "0.67690474",
"text": "def index\n @reviewable = find_reviewable\n @reviews = @reviewable.reviews\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reviews }\n end\n end",
"title": ""
},
{
"docid": "033dbda4a18c53ca96f0893edafa5b92",
"score": "0.67503697",
"text": "def index\n @reviews = @hotel.reviews\n end",
"title": ""
},
{
"docid": "d45403d982d56a902fabba38adde93b1",
"score": "0.6749599",
"text": "def index\n authorize! :index, Review\n \n @reviews = Review.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end",
"title": ""
},
{
"docid": "6b6fbdfb19c3673c4eceafbdc4651859",
"score": "0.67460877",
"text": "def index\n @course_reviews = CourseReview.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 => @course_reviews }\n end\n end",
"title": ""
},
{
"docid": "fee9410c79199765204fd4b9995bb885",
"score": "0.6741953",
"text": "def get_review(id=\"\")\n\t\t\t\t\tresp=get_access_token().get(\"/review/#{id.to_s}\")\n\t\t\t\t\tif resp.code==\"200\"\n\t\t\t\t\t\t\t\t\tatom=resp.body\n\t\t\t\t\t\t\t\t\tDouban::Review.new(atom)\n\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tputs resp\n\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\tend\n\tend",
"title": ""
},
{
"docid": "fb105659c5fd33a1953ca67f5a917e07",
"score": "0.67348844",
"text": "def index\n @serie_reviews = SerieReview.all\n end",
"title": ""
},
{
"docid": "173d80665f39fac174369e16a5a2fed2",
"score": "0.67332155",
"text": "def index\n @shop_reviews = ShopReview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_reviews }\n end\n end",
"title": ""
},
{
"docid": "3e542acf9e67e7763cae981721baaa88",
"score": "0.6732006",
"text": "def index\n @reviews = @user.reviews.all\n end",
"title": ""
},
{
"docid": "f23df13b558f93136f763697382dd14c",
"score": "0.67164147",
"text": "def show\n render json: @campground.as_json(include: {reviews: {only: [:id, :title, :description, :score]}})\n end",
"title": ""
},
{
"docid": "caaeb79b5fb7c14e9a13e6fd5e02113e",
"score": "0.6711463",
"text": "def show \n review = Review.find(params[:id])\n render json: review \n end",
"title": ""
},
{
"docid": "6e8525f5fd1450be529b3c7db189be6a",
"score": "0.6710659",
"text": "def index \n @reviews = Review.all \n end",
"title": ""
},
{
"docid": "ca2c365dc1ed7115a3773c7810786e80",
"score": "0.6699018",
"text": "def show\n @recipe_review = @recipe.recipe_reviews.find_by(id: params[:id])\n authorize @recipe_review\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @recipe_reviews }\n end\n end",
"title": ""
},
{
"docid": "a608a32aeca06c69d4584d22a1257834",
"score": "0.6696667",
"text": "def reviews\n @reviews\n end",
"title": ""
},
{
"docid": "b8877b632489a322fe27545bdbf418e2",
"score": "0.66941",
"text": "def show\n @reviews = @user.reviewed_reviews\n end",
"title": ""
},
{
"docid": "50fd92f688ec3e56a54e5c903fbd4996",
"score": "0.66919434",
"text": "def index\n current_user.reviews\n end",
"title": ""
}
] |
37935f224909ff4b193986637871700e
|
has_many :merchant_types, :dependent => :destroy serialize :merchant_type_ids, ActiveRecord::Coders::Hstore serialize :merchant_type_ids
|
[
{
"docid": "60577710d77236215145822f7a86fa0e",
"score": "0.62747806",
"text": "def merchant_types\n MerchantType.find merchant_type_ids\n end",
"title": ""
}
] |
[
{
"docid": "99ff35264da9028ed3c834694f8c0cd8",
"score": "0.5785172",
"text": "def collection_serialization_options\n {:except => [:site_id, :email_address, :type], :methods => :variant}\n end",
"title": ""
},
{
"docid": "1c47480a9f475d3105a4660e51130a5c",
"score": "0.56416315",
"text": "def merchant_list\n @merchant_list ||= @api.associations\n end",
"title": ""
},
{
"docid": "010da9559f18f4c802de2a1c70c3afad",
"score": "0.5522445",
"text": "def object_serialization_options\n {:except => [:site_id, :email_address, :type], :methods => :variant}\n end",
"title": ""
},
{
"docid": "d4ba872cacd2b27e00e4a3de44a9f5b9",
"score": "0.5474393",
"text": "def serialize(model)\n end",
"title": ""
},
{
"docid": "cae101aaceddc09b39892b3c4f7fcf02",
"score": "0.5344",
"text": "def sproutcore_json(record)\n hash = record.as_json(:except => [:id, :created_at, :updated_at])\n \n hash[:guid] = polymorphic_path(record)\n \n associations = record.class.reflect_on_all_associations\n \n associations.each do |association|\n records = case association.macro\n when :has_many, :has_and_belongs_to_many\n record.send(association.name).to_a\n when :has_one, :belongs_to\n record.send(association.name)\n end\n\n unless records.nil?\n if records.is_a?(Enumerable)\n hash[association.name] = records.map { |r| polymorphic_path(r) } \n else\n hash[association.name] = polymorphic_path(records)\n end\n end\n end\n \n hash\n end",
"title": ""
},
{
"docid": "e5abc9a168a5174ed953e5f16483efdc",
"score": "0.5227104",
"text": "def collection_serialization_options\n {:except => [:variant_id, :type, :position], :methods => [:classification, :options]}\n end",
"title": ""
},
{
"docid": "8cc3bfb68089c2a887519ff4672a94d2",
"score": "0.5224026",
"text": "def before_save\n deserialized_values.each{|k,v| @values[k] = serialize_value(k, v)}\n super\n end",
"title": ""
},
{
"docid": "d58a2692b8f5d49990e4fe315db0b243",
"score": "0.5180739",
"text": "def merchant_type_params\n params.require(:merchant_type).permit(:name, :key)\n end",
"title": ""
},
{
"docid": "af46cd4d22bcd9c9abb48624e0d87c08",
"score": "0.5126039",
"text": "def serialize_new_records(serialized, collection_proxy)\n new_records = collection_proxy.reject(&:persisted?)\n return unless new_records.any?\n\n parent_key = collection_proxy.parent.class.demodulized_name.foreign_key.to_sym\n\n serialized[collection_proxy.association_name] = new_records.map do |record|\n record.serializable_hash.except(parent_key)\n end\n end",
"title": ""
},
{
"docid": "9e45f6610540a54d0647be8c892a69b0",
"score": "0.51234525",
"text": "def to_jaxb_json_hash\n _h = super\n _h['merchantSubscriptionId'] = merchantSubscriptionId.to_jaxb_json_hash unless merchantSubscriptionId.nil?\n _h['merchantPaymentMethodId'] = merchantPaymentMethodId.to_jaxb_json_hash unless merchantPaymentMethodId.nil?\n return _h\n end",
"title": ""
},
{
"docid": "4afa09806a5360debd13f10350b2b1e0",
"score": "0.51119995",
"text": "def active_record_has_and_belongs_to_many(model, relation)\n return [] unless relation.macro == :has_and_belongs_to_many\n\n dump_proxy_table(model, relation)\n end",
"title": ""
},
{
"docid": "15c870c85722cb277acf6b504b6f10b9",
"score": "0.50676125",
"text": "def get_field_deserializers()\n return super.merge({\n \"clientId\" => lambda {|n| @client_id = n.get_string_value() },\n \"consentType\" => lambda {|n| @consent_type = n.get_string_value() },\n \"principalId\" => lambda {|n| @principal_id = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "eb802f5408b6a69a853bd94a0542fdc7",
"score": "0.5026129",
"text": "def get_field_deserializers()\n return super.merge({\n \"certificateData\" => lambda {|n| @certificate_data = n.get_string_value() },\n \"developerId\" => lambda {|n| @developer_id = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_string_value() },\n \"serviceId\" => lambda {|n| @service_id = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "345e4c0b97cac37e9fe8853505231796",
"score": "0.5009146",
"text": "def associated_records\n []\n end",
"title": ""
},
{
"docid": "b3c087c8070db355c0c3cadd12e53629",
"score": "0.50008196",
"text": "def auto_generate_serializer\n model_class = self.class\n @auto_generated_serializer ||=\n Class.new(ActiveModel::Serializer) do\n embed :ids\n attributes(*model_class.column_names.map(&:to_sym))\n model_class.reflections.each_pair do |name, reflection|\n options = reflection.options\n case reflection.macro\n when :has_one, :belongs_to\n has_one name, key: options[:foreign_key], through: options[:through]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a5c1a7c989e02472144b7464f373870b",
"score": "0.4990888",
"text": "def associated_with_supplier\n self.contact_types = [ContactType.supplier.id]\n end",
"title": ""
},
{
"docid": "9183eafb68048b79ec763dd1e62394dd",
"score": "0.49827448",
"text": "def users\n ActiveModel::Serializer::CollectionSerializer.new(object.users.uniq, each_serializer: UserSerializer)\n end",
"title": ""
},
{
"docid": "1cd84b8a26a7317ce072a11332cddaaa",
"score": "0.49721885",
"text": "def associated_saves\n @associated_saves ||= HashWithIndifferentAccess.new\n end",
"title": ""
},
{
"docid": "46a5f5b553deff14757e0be17dfb1714",
"score": "0.49715373",
"text": "def get_field_deserializers()\n return super.merge({\n \"androidManagedAppProtections\" => lambda {|n| @android_managed_app_protections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AndroidManagedAppProtection.create_from_discriminator_value(pn) }) },\n \"defaultManagedAppProtections\" => lambda {|n| @default_managed_app_protections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DefaultManagedAppProtection.create_from_discriminator_value(pn) }) },\n \"iosManagedAppProtections\" => lambda {|n| @ios_managed_app_protections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IosManagedAppProtection.create_from_discriminator_value(pn) }) },\n \"isEnabledForMicrosoftStoreForBusiness\" => lambda {|n| @is_enabled_for_microsoft_store_for_business = n.get_boolean_value() },\n \"managedAppPolicies\" => lambda {|n| @managed_app_policies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppPolicy.create_from_discriminator_value(pn) }) },\n \"managedAppRegistrations\" => lambda {|n| @managed_app_registrations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppRegistration.create_from_discriminator_value(pn) }) },\n \"managedAppStatuses\" => lambda {|n| @managed_app_statuses = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppStatus.create_from_discriminator_value(pn) }) },\n \"managedEBooks\" => lambda {|n| @managed_e_books = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedEBook.create_from_discriminator_value(pn) }) },\n \"mdmWindowsInformationProtectionPolicies\" => lambda {|n| @mdm_windows_information_protection_policies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MdmWindowsInformationProtectionPolicy.create_from_discriminator_value(pn) }) },\n \"microsoftStoreForBusinessLanguage\" => lambda {|n| @microsoft_store_for_business_language = n.get_string_value() },\n \"microsoftStoreForBusinessLastCompletedApplicationSyncTime\" => lambda {|n| @microsoft_store_for_business_last_completed_application_sync_time = n.get_date_time_value() },\n \"microsoftStoreForBusinessLastSuccessfulSyncDateTime\" => lambda {|n| @microsoft_store_for_business_last_successful_sync_date_time = n.get_date_time_value() },\n \"mobileAppCategories\" => lambda {|n| @mobile_app_categories = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppCategory.create_from_discriminator_value(pn) }) },\n \"mobileAppConfigurations\" => lambda {|n| @mobile_app_configurations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDeviceMobileAppConfiguration.create_from_discriminator_value(pn) }) },\n \"mobileApps\" => lambda {|n| @mobile_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileApp.create_from_discriminator_value(pn) }) },\n \"targetedManagedAppConfigurations\" => lambda {|n| @targeted_managed_app_configurations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TargetedManagedAppConfiguration.create_from_discriminator_value(pn) }) },\n \"vppTokens\" => lambda {|n| @vpp_tokens = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::VppToken.create_from_discriminator_value(pn) }) },\n \"windowsInformationProtectionPolicies\" => lambda {|n| @windows_information_protection_policies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::WindowsInformationProtectionPolicy.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "0064df7d9de67292ebf9b8c8a00db6f1",
"score": "0.49557567",
"text": "def collection_serialization_options\n {:except => [:site_id, :position, :ancestry, :published_on], :methods => [:parents, :data]}\n end",
"title": ""
},
{
"docid": "fcb5d922fd979171058d72a90682f602",
"score": "0.49554962",
"text": "def get_field_deserializers() \n return super.merge({\n \"categories\" => lambda {|o, n| o.categories = n.get_collection_of_primitive_values(String) },\n \"changeKey\" => lambda {|o, n| o.change_key = n.get_string_value() },\n \"createdDateTime\" => lambda {|o, n| o.created_date_time = n.get_date_value() },\n \"lastModifiedDateTime\" => lambda {|o, n| o.last_modified_date_time = n.get_date_value() },\n })\n end",
"title": ""
},
{
"docid": "bc2b76860075289d6f12e70b8b138e08",
"score": "0.49417028",
"text": "def map_data_to_uuids\n\t\[email protected]\n\tend",
"title": ""
},
{
"docid": "ffcace37b825ba1ba7383fcb00f68e42",
"score": "0.4923846",
"text": "def merchant_orders\n Order.where(merchant_id: self.id)\n end",
"title": ""
},
{
"docid": "0ec928061b478cd3aded95134bb1db5e",
"score": "0.49219692",
"text": "def serializable_hash options=nil\n \t\tsuper.merge \"type\" => type\n\tend",
"title": ""
},
{
"docid": "0ec928061b478cd3aded95134bb1db5e",
"score": "0.49219692",
"text": "def serializable_hash options=nil\n \t\tsuper.merge \"type\" => type\n\tend",
"title": ""
},
{
"docid": "392c8478fe1833999bdcde9510dcc007",
"score": "0.4920246",
"text": "def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "71cf3b56fe4d12eb6803be7768c4fd56",
"score": "0.49141955",
"text": "def object_serialization_options\n {:except => [:variant_id, :type, :position], :methods => [:classification, :options]}\n end",
"title": ""
},
{
"docid": "35325c591d151231497a093961c7000c",
"score": "0.4913416",
"text": "def associated_with_client\n self.contact_types = [ContactType.cliente.id]\n end",
"title": ""
},
{
"docid": "b0bfc7c130fee59ad37d80a7f71bdfb2",
"score": "0.49031466",
"text": "def serialized\n serializer_class.new(self).serializable_hash\n end",
"title": ""
},
{
"docid": "0925c5fdffd5db59c9129e6da3dfde40",
"score": "0.48962983",
"text": "def hash\n [searchable_id].hash\n end",
"title": ""
},
{
"docid": "2ac9563a295f5b438c78a9c4bd3b6ad6",
"score": "0.48941445",
"text": "def payment_data_types\n []\n end",
"title": ""
},
{
"docid": "f1daf0a613bf7a004368b69f0c5d2921",
"score": "0.48861906",
"text": "def hash_fk_model\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "f1daf0a613bf7a004368b69f0c5d2921",
"score": "0.48861906",
"text": "def hash_fk_model\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "a53c0fe9b3ab050ba96491d963f00252",
"score": "0.48658285",
"text": "def serialize\n \n end",
"title": ""
},
{
"docid": "29c0b01ef0e52aa43f7cf489bf9546a9",
"score": "0.4863657",
"text": "def serializable_hash options=nil\n super.merge \"type\" => type\n end",
"title": ""
},
{
"docid": "22d49123d02505af4429e012b71d7d30",
"score": "0.48617744",
"text": "def get_field_deserializers()\n return super.merge({\n \"certificateList\" => lambda {|n| @certificate_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Pkcs12CertificateInformation.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.4822246",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.4822246",
"text": "def serialize; end",
"title": ""
},
{
"docid": "3f5f67e4f344976715088afea1457789",
"score": "0.48210368",
"text": "def get_field_deserializers()\n return super.merge({\n \"recoveryKeys\" => lambda {|n| @recovery_keys = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::BitlockerRecoveryKey.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "12eec3da1ad26bcceffc428d43457751",
"score": "0.48194072",
"text": "def create_merchant_with_items\n merchant = Merchant.create(name: \"merchant name\")\n merchant.items << [ Item.create(name: \"item name\", description: \"item description\", unit_price: \"23.22\"),\n Item.create(name: \"item name\", description: \"item description\", unit_price: \"21.22\") ]\n merchant\n end",
"title": ""
},
{
"docid": "d0d49c4d581282c8277450244239caf1",
"score": "0.48165366",
"text": "def serialize_for_order_form\n serializable_hash(only: %i(id name))\n end",
"title": ""
},
{
"docid": "aacea7515261102f16a137f6159c2c37",
"score": "0.48114386",
"text": "def hash\n [id, name, address, timezone, capabilities, status, created_at, merchant_id, country, language_code, currency, phone_number, business_name, type, website_url].hash\n end",
"title": ""
},
{
"docid": "e2303d2ed1d2349ea2c5f07c149f1839",
"score": "0.48102364",
"text": "def serializable_hash(options = {})\n super(\n :include => {\n :photos => {},:customer => {}, :user => {}\n })\n end",
"title": ""
},
{
"docid": "77afc1b658155eab54e91d3a0dac47c5",
"score": "0.4810074",
"text": "def init_jaxb_json_hash(_o)\n super _o\n if !_o['merchantSubscriptionId'].nil?\n _oa = _o['merchantSubscriptionId']\n if(_oa.is_a? Hash)\n @merchantSubscriptionId = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @merchantSubscriptionId = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @merchantSubscriptionId = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @merchantSubscriptionId.push String.from_json(_item)\n else\n @merchantSubscriptionId.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @merchantSubscriptionId = _oa\n end\n end\n if !_o['merchantPaymentMethodId'].nil?\n _oa = _o['merchantPaymentMethodId']\n if(_oa.is_a? Hash)\n @merchantPaymentMethodId = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @merchantPaymentMethodId = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @merchantPaymentMethodId = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @merchantPaymentMethodId.push String.from_json(_item)\n else\n @merchantPaymentMethodId.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @merchantPaymentMethodId = _oa\n end\n end\n end",
"title": ""
},
{
"docid": "9f5bb230b5e4e731ed04fa451cd6e36d",
"score": "0.47981763",
"text": "def get_field_deserializers()\n return super.merge({\n \"clientApplicationIds\" => lambda {|n| @client_application_ids = n.get_collection_of_primitive_values(String) },\n \"clientApplicationPublisherIds\" => lambda {|n| @client_application_publisher_ids = n.get_collection_of_primitive_values(String) },\n \"clientApplicationTenantIds\" => lambda {|n| @client_application_tenant_ids = n.get_collection_of_primitive_values(String) },\n \"clientApplicationsFromVerifiedPublisherOnly\" => lambda {|n| @client_applications_from_verified_publisher_only = n.get_boolean_value() },\n \"permissionClassification\" => lambda {|n| @permission_classification = n.get_string_value() },\n \"permissionType\" => lambda {|n| @permission_type = n.get_enum_value(MicrosoftGraph::Models::PermissionType) },\n \"permissions\" => lambda {|n| @permissions = n.get_collection_of_primitive_values(String) },\n \"resourceApplication\" => lambda {|n| @resource_application = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "9af701b6a805cf259c475044c65d8205",
"score": "0.4794299",
"text": "def hash; [searchable_id, searchable_type].hash; end",
"title": ""
},
{
"docid": "9af701b6a805cf259c475044c65d8205",
"score": "0.4794299",
"text": "def hash; [searchable_id, searchable_type].hash; end",
"title": ""
},
{
"docid": "2592aae03dee3e592b6a0e6d4ee4284c",
"score": "0.47927254",
"text": "def make_store_unknown\n self.store_id = nil\n save!\n end",
"title": ""
},
{
"docid": "2627206ad5b362b322e4a06c8fa451b1",
"score": "0.47899586",
"text": "def create_types\n\t[]\nend",
"title": ""
},
{
"docid": "2627206ad5b362b322e4a06c8fa451b1",
"score": "0.47899586",
"text": "def create_types\n\t[]\nend",
"title": ""
},
{
"docid": "d3404277a92a5c675aa66824eeed00dd",
"score": "0.4789001",
"text": "def get_field_deserializers()\n return super.merge({\n \"appConsentRequests\" => lambda {|n| @app_consent_requests = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AppConsentRequest.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "fcccdb3d20197de44525baba414deeb0",
"score": "0.47880846",
"text": "def serializable_hash(options=nil)\n super.merge 'type' => type\n end",
"title": ""
},
{
"docid": "fcccdb3d20197de44525baba414deeb0",
"score": "0.47880846",
"text": "def serializable_hash(options=nil)\n super.merge 'type' => type\n end",
"title": ""
},
{
"docid": "9bb20983a25b627aed7da9f6ea80b1bb",
"score": "0.4787759",
"text": "def stores_foreign_key?; true; end",
"title": ""
},
{
"docid": "e90050fec509955eba42174534b760ac",
"score": "0.4783893",
"text": "def serialize_record_data?; collect_keys.present? || collect_only_keys.present?; end",
"title": ""
},
{
"docid": "e697567ad029b688157357296e605343",
"score": "0.47774747",
"text": "def associations_to_ids hash\n to_ids = {}\n hash.each_pair do |key, type|\n key_name = ['references', 'belongs_to'].include?(type.downcase) ? \"#{key}_id\" : key\n to_ids[key_name] = type\n end\n to_ids\n end",
"title": ""
},
{
"docid": "d202af7e70a9e41755df8e2720abd507",
"score": "0.47698087",
"text": "def bed_types_attributes=(attributes)\n attr_array = attributes.collect {|item| item[1][:id] }\n self.bed_type_ids = attr_array\n super\n end",
"title": ""
},
{
"docid": "a112b992c2cb3ee3d037e9412ec6aa28",
"score": "0.4768732",
"text": "def test_can_save_and_load_options\n identity = Factory(:email_identity)\n identity.serialized = { \"a\" => \"b\" }\n identity.save!\n \n r = identity.reload\n assert_equal({ \"a\" => \"b\" }, r.serialized)\n\n identity.serialized = nil\n identity.save!\n\n r = identity.reload\n assert_equal({}, r.serialized)\n end",
"title": ""
},
{
"docid": "69d27721cecd42b61246246fb13e10a0",
"score": "0.47576323",
"text": "def get_field_deserializers()\n return super.merge({\n \"assignments\" => lambda {|n| @assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedEBookAssignment.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"deviceStates\" => lambda {|n| @device_states = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DeviceInstallState.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"informationUrl\" => lambda {|n| @information_url = n.get_string_value() },\n \"installSummary\" => lambda {|n| @install_summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EBookInstallSummary.create_from_discriminator_value(pn) }) },\n \"largeCover\" => lambda {|n| @large_cover = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MimeContent.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"privacyInformationUrl\" => lambda {|n| @privacy_information_url = n.get_string_value() },\n \"publishedDateTime\" => lambda {|n| @published_date_time = n.get_date_time_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"userStateSummary\" => lambda {|n| @user_state_summary = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserInstallStateSummary.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "49ee227571d4392230d0b66d76258ec1",
"score": "0.47495657",
"text": "def serializable_hash(options=nil)\n super.merge \"type\" => type\n end",
"title": ""
},
{
"docid": "4824dc01c82cb660e7373b3557366f95",
"score": "0.47482914",
"text": "def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "1ec19f60af898e34ac0c26634371e397",
"score": "0.47324026",
"text": "def pstore_save\n # Les métadonnées\n store_metadata\n # Scenes\n store_data :scene\n # Personnages\n store_data :personnage\n # Décors\n store_data :decor\n # Brins\n store_data :brin\n # Notes\n store_data :note\n end",
"title": ""
},
{
"docid": "b11122951438919f6dd0a44cb3d95566",
"score": "0.47319424",
"text": "def object_serialization_options\n {:except => [:site_id, :position, :ancestry, :published_on], :methods => [:parents, :data]}\n end",
"title": ""
},
{
"docid": "ecc17f82c08e4e4b709b3fd922c55a2a",
"score": "0.47298348",
"text": "def includes_for_serializer\n {}\n end",
"title": ""
},
{
"docid": "f5a31776702f92614b08f91b970383aa",
"score": "0.47293344",
"text": "def initialize_set(values)\n super\n serialize_deserialized_values\n end",
"title": ""
},
{
"docid": "dda0719fa33ae80f3c98524b57366eba",
"score": "0.47249302",
"text": "def _all\n out = {}\n ids.each {|i| @store.transaction(true) {out[i] = @store[i]}}\n out\n end",
"title": ""
},
{
"docid": "18e141d2c4d515d619daa83e5cc76ec9",
"score": "0.47178116",
"text": "def ids\n storage.keys\n end",
"title": ""
},
{
"docid": "f733b51aebbb907651312d2397bc672c",
"score": "0.47175997",
"text": "def serialized_models\n serialize_model(work)\n end",
"title": ""
},
{
"docid": "6eef369fa1440e7d775acf9fc5cdfde6",
"score": "0.47084117",
"text": "def save_model\n refresh_catalog_record_id_from_form = catalog_record_ids.find { |id| id.refresh && id._destroy != \"1\" }&.value\n non_refresh_catalog_record_ids_from_form = catalog_record_ids.filter_map { |id| id.value if id.refresh != true && id._destroy != \"1\" }\n catalog_record_ids_from_form = [refresh_catalog_record_id_from_form].compact + non_refresh_catalog_record_ids_from_form\n\n new_catalog_links = CatalogRecordId.serialize(model, catalog_record_ids_from_form, refresh: refresh_catalog_record_id_from_form.present?)\n\n # now store everything in the cocina object\n updated_object = model\n identification_props = updated_object.identification.new(catalogLinks: new_catalog_links)\n updated_object = updated_object.new(identification: identification_props)\n Repository.store(updated_object)\n end",
"title": ""
},
{
"docid": "9747fbdbf77ce1ebcdc9d8349ed39241",
"score": "0.47082433",
"text": "def associated_with_executive\n self.contact_types = [ContactType.employee.id]\n end",
"title": ""
},
{
"docid": "5ed14c78bbd6ae7584d1a9c380c7bd07",
"score": "0.4706321",
"text": "def stores_foreign_key?; false; end",
"title": ""
},
{
"docid": "5ed14c78bbd6ae7584d1a9c380c7bd07",
"score": "0.4706321",
"text": "def stores_foreign_key?; false; end",
"title": ""
},
{
"docid": "83f7be26c49e1a572d1ed0eaeb7a705b",
"score": "0.47005627",
"text": "def get_field_deserializers()\n return super.merge({\n })\n end",
"title": ""
},
{
"docid": "83f7be26c49e1a572d1ed0eaeb7a705b",
"score": "0.47005627",
"text": "def get_field_deserializers()\n return super.merge({\n })\n end",
"title": ""
},
{
"docid": "83f7be26c49e1a572d1ed0eaeb7a705b",
"score": "0.47005627",
"text": "def get_field_deserializers()\n return super.merge({\n })\n end",
"title": ""
},
{
"docid": "cd42c3dae0b252305a5a224e231f3640",
"score": "0.4697029",
"text": "def collection_serialization_options\n {\n :except => [:site_id, :node_type, :position],\n :include => {\n :fields => {\n :except => [:variant_id, :position],\n :methods => [:classification, :options]\n }\n }\n }\n end",
"title": ""
},
{
"docid": "ccd7dff032578db1e1f59a1e50abd752",
"score": "0.4695288",
"text": "def id_types\n identifiers.map(&:type).uniq\n end",
"title": ""
},
{
"docid": "dfd9b6d446ad63a8220e83fc36e81d53",
"score": "0.46948183",
"text": "def hash\n [merchant_ref, transaction_type, original_transaction_type, original_transaction_id, amount, currency_code, customer, billing_address, device, loyalty, payment, merchant, order, user_defined].hash\n end",
"title": ""
},
{
"docid": "e943ed4abaced3f25c32c527d7c26895",
"score": "0.4690195",
"text": "def test_should_associate_products_by_ids\n # Load some products and see if it really don't have any related products.\n a_coat = items(:chinchilla_coat)\n a_towel = items(:towel)\n a_stuff = items(:the_stuff)\n assert_equal a_coat.related_products.count, 0\n assert_equal a_towel.related_products.count, 0\n assert_equal a_stuff.related_products.count, 0\n\n# # Associate one with the others and all must know about that.\n# # TODO: a_soap.related_product_ids should receive ids but its not doing that.\n# a_coat.related_product_ids = [ a_towel.id, a_stuff.id ]\n# assert_equal a_coat.related_products.count, 2\n# assert_equal a_towel.related_products.count, 1\n# assert_equal a_stuff.related_products.count, 1\n\n # Clear all and verify.\n a_coat.related_products.clear\n assert_equal a_coat.related_products.count, 0\n assert_equal a_towel.related_products.count, 0\n assert_equal a_stuff.related_products.count, 0\n end",
"title": ""
},
{
"docid": "4cd136176dcff97623ed0cd37643353f",
"score": "0.46897945",
"text": "def get_field_deserializers()\n return super.merge({\n \"appIdentifier\" => lambda {|n| @app_identifier = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MobileAppIdentifier.create_from_discriminator_value(pn) }) },\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"appliedPolicies\" => lambda {|n| @applied_policies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppPolicy.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"deviceTag\" => lambda {|n| @device_tag = n.get_string_value() },\n \"deviceType\" => lambda {|n| @device_type = n.get_string_value() },\n \"flaggedReasons\" => lambda {|n| @flagged_reasons = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppFlaggedReason.create_from_discriminator_value(pn) }) },\n \"intendedPolicies\" => lambda {|n| @intended_policies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppPolicy.create_from_discriminator_value(pn) }) },\n \"lastSyncDateTime\" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },\n \"managementSdkVersion\" => lambda {|n| @management_sdk_version = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppOperation.create_from_discriminator_value(pn) }) },\n \"platformVersion\" => lambda {|n| @platform_version = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "a0bdd3429f610427ec2f2de9aee1b1cc",
"score": "0.46838757",
"text": "def serialize_array\n `self.serializeArray()`.map { |e| Hash.new(e) }\n end",
"title": ""
},
{
"docid": "89e625c1245fbea2d8b2286adce45e05",
"score": "0.4679772",
"text": "def set_store\n @store = Store.find(params[:id])\n @store.books = StoreBook.joins(\"JOIN books ON store_books.book_id = books.id\").where(store_id: params[:id]).select(\"books.*\")\n end",
"title": ""
},
{
"docid": "725db716a7a1a010c55e1c2b5add50e4",
"score": "0.4678466",
"text": "def _many_to_many_hash\n @_many_to_many_hash ||= {}\n end",
"title": ""
},
{
"docid": "6bcff25d8e9e1914e3b523c92e7d75c8",
"score": "0.4675382",
"text": "def to_key\n persisted? ? [id] : nil\n end",
"title": ""
},
{
"docid": "6bcff25d8e9e1914e3b523c92e7d75c8",
"score": "0.4675382",
"text": "def to_key\n persisted? ? [id] : nil\n end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.4672844",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.4672844",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.4672844",
"text": "def store; end",
"title": ""
},
{
"docid": "fff0d80ada7679c51739e5694b36beeb",
"score": "0.46722138",
"text": "def dissect_to_record_hashes\n end",
"title": ""
},
{
"docid": "a329cbbf181651e52f9721812b750e2e",
"score": "0.46718967",
"text": "def get_field_deserializers()\n return super.merge({\n \"assignments\" => lambda {|n| @assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppAssignment.create_from_discriminator_value(pn) }) },\n \"categories\" => lambda {|n| @categories = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppCategory.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"developer\" => lambda {|n| @developer = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"informationUrl\" => lambda {|n| @information_url = n.get_string_value() },\n \"isFeatured\" => lambda {|n| @is_featured = n.get_boolean_value() },\n \"largeIcon\" => lambda {|n| @large_icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MimeContent.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"notes\" => lambda {|n| @notes = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"privacyInformationUrl\" => lambda {|n| @privacy_information_url = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"publishingState\" => lambda {|n| @publishing_state = n.get_enum_value(MicrosoftGraph::Models::MobileAppPublishingState) },\n })\n end",
"title": ""
},
{
"docid": "076161b2076842444ea805647f990f19",
"score": "0.4670104",
"text": "def as_indexed_json(_options = {})\n as_json methods: [:purchased_product_ids]\n end",
"title": ""
},
{
"docid": "bca1a1619d94fa64c0c898617ceb39c4",
"score": "0.46687084",
"text": "def representation_ids\n (Array.wrap(representations) + Array.wrap(additional_representation)).uniq.delete_if(&:empty?)\n end",
"title": ""
},
{
"docid": "845df1853f199d2f956274913f40d730",
"score": "0.466242",
"text": "def encodeWithCoder(coder)\n columns.each do |attr|\n # Serialize attributes except the proxy has_many and belongs_to ones.\n unless [:belongs_to, :has_many].include? column(attr).type\n value = self.send(attr)\n unless value.nil?\n coder.encodeObject(value, forKey: attr.to_s)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "370b986e8ac022e848cef68d865041ac",
"score": "0.46588796",
"text": "def to_key\n _persisted_obj ? [id] : nil\n end",
"title": ""
},
{
"docid": "e9d57c974ebf69c287bf3e22404682f0",
"score": "0.4652752",
"text": "def seed_bank_card_types\n\tdata = ActiveSupport::JSON.decode(File.read('db/seeds/bank_card_types.json'))\n\tdata.each do |d|\n\t\tBankCardType.create!(d)\n\tend\nend",
"title": ""
},
{
"docid": "301bb0c97b6153e153abc6af86979ea5",
"score": "0.46500254",
"text": "def serializable_hash(options={})\n data = super(options)\n data.delete('ingest_state')\n if options.has_key?(:include) && options[:include].include?(:ingest_state)\n if self.ingest_state.nil?\n data['ingest_state'] = 'null'\n else\n state = JSON.parse(self.ingest_state)\n data.merge!(ingest_state: state)\n end\n end\n data['intellectual_object_identifier'] = self.intellectual_object.identifier\n if options.has_key?(:include)\n data.merge!(checksums: serialize_checksums) if options[:include].include?(:checksums)\n data.merge!(premis_events: serialize_events) if options[:include].include?(:premis_events)\n end\n data\n end",
"title": ""
},
{
"docid": "e847a5a24ad3d9a1b5b4d554e5feea7e",
"score": "0.46495295",
"text": "def custom_entity_types\n @_custom_entity_types ||= {}\n end",
"title": ""
},
{
"docid": "e847a5a24ad3d9a1b5b4d554e5feea7e",
"score": "0.46495295",
"text": "def custom_entity_types\n @_custom_entity_types ||= {}\n end",
"title": ""
},
{
"docid": "887e71cbdba70f8aafe0a52504835a22",
"score": "0.46491903",
"text": "def get_field_deserializers()\n return super.merge({\n \"reviewSet\" => lambda {|n| @review_set = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityEdiscoveryReviewSet.create_from_discriminator_value(pn) }) },\n \"search\" => lambda {|n| @search = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityEdiscoverySearch.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "56a079835e044f3b6e0eda08af0046bf",
"score": "0.46447244",
"text": "def get_field_deserializers()\n return super.merge({\n \"bundles\" => lambda {|n| @bundles = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"following\" => lambda {|n| @following = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"list\" => lambda {|n| @list = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::List.create_from_discriminator_value(pn) }) },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"quota\" => lambda {|n| @quota = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Quota.create_from_discriminator_value(pn) }) },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"sharePointIds\" => lambda {|n| @share_point_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"special\" => lambda {|n| @special = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"system\" => lambda {|n| @system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SystemFacet.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
}
] |
3d1b4ef3f5293ef5fcc1e56ac3d1d26d
|
POST /api/messages/delete?id=:id Returns: JSON Requires authorization: yes
|
[
{
"docid": "c542774c2fdbed1e693050a501a3506d",
"score": "0.8501238",
"text": "def delete\n msg = @user.messages.find(params[:id])\n if msg.nil?\n render json_status_response(404, \"Message not found\")\n return\n end\n\n msg.destroy\n render json_status_response(200, \"Message deleted successfully\")\n end",
"title": ""
}
] |
[
{
"docid": "3447d31144a498a496398f240bff8820",
"score": "0.83081275",
"text": "def destroy\n @message = authenticate!.messages.find_by(id: message_params[:id])\n if @message\n @message.destroy\n render json: success('Delete Success', 202), status: 202\n else\n render json: error('Error', 400), status: 400\n end\n end",
"title": ""
},
{
"docid": "b741485479019540be90a46709a849c3",
"score": "0.8300055",
"text": "def delete_message(message_id)\n if message_id.integer?\n RestClient.post \"https://#{@username}:#{@password}@convore.com/api/messages/#{message_id}/delete.json\", {}\n end\n end",
"title": ""
},
{
"docid": "ee3b36d94e9fa9123f5e7ac28e6d7020",
"score": "0.82941234",
"text": "def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"title": ""
},
{
"docid": "b4357bb26225801b5e574ee0a8ed91d9",
"score": "0.8179892",
"text": "def destroy\n authorize! :manage, :all\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0bacbc79debf6fd9955abdd6486c186",
"score": "0.8109381",
"text": "def delete\n client.post('/api/del_msg', id: read_attribute(:name))\n end",
"title": ""
},
{
"docid": "a16b6056168da05bf98dc592272eb259",
"score": "0.80923975",
"text": "def delete_message(id)\n @client.raw('delete', \"/content/messages/#{id}\")\n end",
"title": ""
},
{
"docid": "3a5cdfb25bdd9bc406143b97a97bffdf",
"score": "0.80856407",
"text": "def destroy\n current_user.delete_message( params[:id] )\n\n respond_to do |format|\n format.html { redirect_to(user_messages_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7a43921ee6ffb466eafc389a1eb45682",
"score": "0.8035519",
"text": "def destroy\n @message = current_user.received_messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7a43921ee6ffb466eafc389a1eb45682",
"score": "0.8035519",
"text": "def destroy\n @message = current_user.received_messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9f51385a8bd7bf9ced201d0ca2b9435",
"score": "0.79647",
"text": "def destroy\n if Message.find(params[:id]).destroy\n render status: :ok,\n json: {\n status: :ok\n }\n end\n end",
"title": ""
},
{
"docid": "9d6f284505c398aa77ec202a50afc215",
"score": "0.79173684",
"text": "def destroy\n authorize @message\n @message.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "9e033352dfbc1773f46f4af77b11b1e6",
"score": "0.7893864",
"text": "def destroy\n message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff64ab9068e38704ef98b1a757b79cc8",
"score": "0.7886731",
"text": "def delete_message(token, id, user = nil)\n request_url = \"/api/v2.0/\" << (user.nil? ? \"Me\" : (\"users/\" << user)) << \"/Messages/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n JSON.parse(delete_response)\n end",
"title": ""
},
{
"docid": "67a404a8eec409cf68880b798911d51f",
"score": "0.7880253",
"text": "def destroy\n @message = current_user.messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_path }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fd3f7b6fd7a91a5c1506404ff0c83375",
"score": "0.78781104",
"text": "def destroy\n @message = Message.find_by_uuid(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_path(params[:domain], params[:endpoint])) }\n end\n end",
"title": ""
},
{
"docid": "59d612c5a8287ced6d58bba85af237c9",
"score": "0.7873032",
"text": "def destroy\n @message.delete\n render json: {message: \"Message successfully deleted.\"}, status: 204\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4417e40c743ab02cd6129b813183b70",
"score": "0.78645134",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "add30ad937fdb7bb983b0ef7eef25bd8",
"score": "0.7847477",
"text": "def destroy\n message = Message.find(params[:id])\n message.destroy!\n head :ok\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.7843834",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "781360dbd316f10a33e9b7fa7544b07e",
"score": "0.78430015",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0823cc2d31f039041751355b874ae8a",
"score": "0.7841394",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "59cd9fc00e0e6fdf6bef893a40034a81",
"score": "0.7835899",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to user_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "91009053d1bc2b89ceb88af145aa724d",
"score": "0.7834513",
"text": "def delete(id)\n @y.message(:delete, :id => id)\n @messages.delete_if do |msg|\n msg.id == id\n end\n render_messages\n end",
"title": ""
},
{
"docid": "6bf30f5c5af13e09cc4a79801819b715",
"score": "0.7822654",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d0968ce5eaf52858356bb69280c1e85",
"score": "0.7818643",
"text": "def destroy\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "445d85ecb466792eb6a3fc5430366e1c",
"score": "0.78102374",
"text": "def destroy\r\n @message = Message.find(params[:id])\r\n @message.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to messages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "f1049911db897e151fdb60c5ebcd349d",
"score": "0.7807168",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to my_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3de438bb01176300bc1cfe9fe5c2f822",
"score": "0.77968955",
"text": "def destroy\n @message = Message.find(params[:id])\n authorize! :destroy, @message\n @message.destroy\n\n redirect_to messages_path\n end",
"title": ""
},
{
"docid": "c03391e282255b8e73009ba787231a19",
"score": "0.7790776",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to mymessages_path(current_user.id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c03391e282255b8e73009ba787231a19",
"score": "0.7790776",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to mymessages_path(current_user.id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.7788281",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72cc5f39b54f930f64901ecbb149a9b1",
"score": "0.77881044",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f3c46a66ce5edd16c83a76e4af45f10",
"score": "0.7763191",
"text": "def delete!\n response = client.quill.post \"/api/v3.0/message/#{id}/delete\", {:lftoken => @client.system_token}\n if response.success?\n true\n else\n raise APIException.new(response.body)\n end\n end",
"title": ""
},
{
"docid": "7d1ad6a6266c464499254183d592912c",
"score": "0.7753043",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f5cde076319e026536f3254e0f83d89",
"score": "0.77507997",
"text": "def destroy\n message = Message.find(params[:id])\n if message.destroy\n head :no_content\n return\n else\n response_data = {\n txt: ['削除できませんでした!'],\n }\n render json: response_data, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7511a7fb2869743567916abf37309580",
"score": "0.7743752",
"text": "def destroy\n # TODO Add paranoid gem to soft delete messages? and have a before delete to save current user_id\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "479a3545f0cb3ee07af1a64771d3f22d",
"score": "0.7736575",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_messages_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8fde93eb1e1af53bbb07346311feb586",
"score": "0.7736307",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Your message was deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bc93f287be39e5e3620aaf93ecfbdc58",
"score": "0.77341384",
"text": "def destroy\n @msg = Msg.find(params[:id])\n @msg.destroy\n\n respond_to do |format|\n format.html { redirect_to msgs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c79e04878419166100195ae99f018062",
"score": "0.7719142",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to inbox_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c926e841c287ad5c3cc8852d4873a695",
"score": "0.7717205",
"text": "def destroy\n message = Message.find_by(id: params[:id])\n message.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "12e321b949296e56c70eb13a077d6673",
"score": "0.7701156",
"text": "def destroy\n \t\n @message = Message.find(params[:id])\n @message.destroy if current_user.id == @message.user_id\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9082dc5c2aa580253362418af71ac44a",
"score": "0.7695224",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "13a1f3a2600de206a44fc220c40c737f",
"score": "0.7692764",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: \"Message was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd91dc0da1756380346eec9b9891ba09",
"score": "0.769205",
"text": "def destroy\n @message = @user.messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.js { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b5ee87d20cb3d23d98deb75c0109ec18",
"score": "0.76900005",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to admin_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1eed101435b147ad8f75317e6bcc41b",
"score": "0.76895875",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n respond_to do |format|\n format.html { redirect_to user_messages_path(@user), notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ababe04c5b14cf0464963129675393bd",
"score": "0.76865107",
"text": "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_back_or messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93186687361458cbff3dc75eed0c6939",
"score": "0.7684912",
"text": "def destroy\n if (current_user && current_user.role == BackOfficeRoles::ADMIN)\n @message = Message.find(params[:id])\n @message.destroy\n end\n\n begin\n @message = Message.find(params[:id])\n # check if the owner of the message\n if (@message.user_id == get_auth_token_user_id())\n @message.destroy\n @data = {:responseCode => 0, :responseMessage => \"success\", :result => {:message => \"Message deleted\"}}\n else\n @data = {:responseCode => -1, :responseMessage => \"Must be the owner\", :result => nil}\n end\n rescue ActiveRecord::RecordNotFound => e\n @data = {:responseCode => -1, :responseMessage => \"Record not found\", :result => {:error => e.message}}\n end\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { render json: @data }\n end\n end",
"title": ""
},
{
"docid": "785730dafa39ca3f334902293c444a19",
"score": "0.76688355",
"text": "def destroy\n @message = current_user.messages.find(params[:id])\n if @message.destroy\n flash[:notice] = \"All ok\"\n else\n flash[:error] = \"Fail\"\n end\n end",
"title": ""
},
{
"docid": "000cbc044b8f66e3bd6aa004e2401f60",
"score": "0.76619554",
"text": "def destroy\n @message.destroy\n respond_with @message, location: messages_path\n end",
"title": ""
},
{
"docid": "ec2385942540203cca1d197b844d8187",
"score": "0.7653471",
"text": "def destroy\n @user_message = UserMessage.find(params[:id])\n @user_message.destroy\n\n respond_to do |format|\n format.html { redirect_to user_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec2385942540203cca1d197b844d8187",
"score": "0.7653471",
"text": "def destroy\n @user_message = UserMessage.find(params[:id])\n @user_message.destroy\n\n respond_to do |format|\n format.html { redirect_to user_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9148b7a683f410ed4ec305b7e6d06142",
"score": "0.7650981",
"text": "def destroy\n @message = current_user.received_messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_messages_path(current_user)) }\n end\n end",
"title": ""
},
{
"docid": "a5af7998be063d921d453f1760286a3f",
"score": "0.7629157",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n head :no_content\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "435e1fb05fc516ea581d98f21d079ef4",
"score": "0.0",
"text": "def cryptos_tracker_params\n params.require(:cryptos_tracker).permit(:symbol, :user_id, :cost_per, :amount_owned)\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": ""
}
] |
665df4869e4a54b6822e4c8b2eef9b6b
|
PUT /itinerarios/1 PUT /itinerarios/1.xml
|
[
{
"docid": "e3ce8064b29b2ab8ed3e86897b81732a",
"score": "0.6709361",
"text": "def update\n @itinerario = Itinerario.find(params[:id])\n\n respond_to do |format|\n if @itinerario.update_attributes(params[:itinerario])\n format.html { redirect_to(@itinerario, :notice => 'Itinerario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @itinerario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b44fcca808470030b0d4a8ca0e32b4b7",
"score": "0.67482156",
"text": "def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e872f999e2b3a543968d235cfc8259a",
"score": "0.6724612",
"text": "def update\n @itinerario = Itinerario.find(params[:id])\n\n respond_to do |format|\n if @itinerario.update_attributes(params[:itinerario])\n flash[:notice] = 'ITINERÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@itinerario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @itinerario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb3474e1d26ed3f6b6a32c3f3a1ea64d",
"score": "0.66491026",
"text": "def update\n @estagiario = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiario.update_attributes(params[:estagiario])\n flash[:notice] = 'Estagiario foi atualizado com sucesso.'\n format.html { redirect_to(@estagiario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dabaaacc799019b0211d250061f3be92",
"score": "0.6505616",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n\n format.html { redirect_to(servicos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07fa3cbcf5213639acd53c0571b24d87",
"score": "0.63880783",
"text": "def update\n @itinerario = Itinerario.find(params[:id])\n\n respond_to do |format|\n if @itinerario.update_attributes(params[:itinerario])\n format.html { redirect_to @itinerario, notice: 'Itinerario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @itinerario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.6380139",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "177a19f7f85a31ed8cc5bc04c10f899d",
"score": "0.6375269",
"text": "def update\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n if @tipo_osexterna.update_attributes(params[:tipo_osexterna])\n flash[:notice] = 'ATUALIZADO COM SUCESSO.'\n format.html { redirect_to(@tipo_osexterna) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_osexterna.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6325f2e2e62b25217396922d58c82a9",
"score": "0.6325251",
"text": "def update\n @roteiro = Roteiro.find(params[:id])\n\n respond_to do |format|\n if @roteiro.update_attributes(params[:roteiro])\n flash[:notice] = 'Roteiro was successfully updated.'\n format.html { redirect_to(@roteiro) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @roteiro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1daa346ca5649d5c5d7c73f90bc00e7",
"score": "0.6282298",
"text": "def update\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n if @idioma.update_attributes(params[:idioma])\n format.html { redirect_to(@idioma, :notice => 'Idioma actualizado con exito.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idioma.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "587dc9f0563ef0779bc576eb3ad41199",
"score": "0.6259054",
"text": "def update\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n if @inventario.update_attributes(params[:inventario])\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ce6a72d58aaec141d460944e9fb68aa",
"score": "0.6243619",
"text": "def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ce6a72d58aaec141d460944e9fb68aa",
"score": "0.6243619",
"text": "def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c9228c1eb1c686a2e19251740ccabc5",
"score": "0.62259847",
"text": "def update\n @inscripcion = Inscripcion.find(params[:id])\n\n respond_to do |format|\n if @inscripcion.update_attributes(params[:inscripcion])\n format.html { redirect_to(@inscripcion, :notice => 'Inscripcion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inscripcion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c03435802a94654b085bf64176af84a",
"score": "0.6221471",
"text": "def update\n @tipos = Tipo.find(params[:id])\n\n respond_to do |format|\n if @tipos.update_attributes(params[:tipo])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@tipos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95f0b1f721f3983658da1fa3bd6d7f4c",
"score": "0.62047994",
"text": "def update\n @estados_usuario = EstadosUsuario.find(params[:id])\n\n respond_to do |format|\n if @estados_usuario.update_attributes(params[:estados_usuario])\n format.html { redirect_to(@estados_usuario, :notice => 'EstadosUsuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estados_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.6200538",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "c4589bd5377d8e8928267dbe5341b4fb",
"score": "0.62004",
"text": "def update\n @tipo_juicio = TipoJuicio.find(params[:id])\n\n respond_to do |format|\n if @tipo_juicio.update_attributes(params[:tipo_juicio])\n format.html { redirect_to(@tipo_juicio, :notice => 'TipoJuicio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_juicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbcce0c9fe00969e6209ea8127104e6c",
"score": "0.6191613",
"text": "def update\n @movimientos_inventario = MovimientosInventario.find(params[:id])\n\n respond_to do |format|\n if @movimientos_inventario.update_attributes(params[:movimientos_inventario])\n format.html { redirect_to(@movimientos_inventario, :notice => 'MovimientosInventario was successfully updated.') }\n format.xml { head :ok }\n else\n @tipos_movimientos = TiposMovimiento.all\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @movimientos_inventario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b91e5b955d9fc0e34ecbc629c1e4ebe9",
"score": "0.6183284",
"text": "def update\n @noticia = Noticia.find(params[:id])\n\n respond_to do |format|\n if @noticia.update_attributes(params[:noticia])\n format.html { redirect_to(@noticia, :notice => 'Noticia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @noticia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0451d48b60c995d80dcec0e792ed42a",
"score": "0.6176678",
"text": "def update\n @tipoespacio = Tipoespacio.find(params[:id])\n\n respond_to do |format|\n if @tipoespacio.update_attributes(params[:tipoespacio])\n flash[:notice] = 'Tipo actualizado correctamente.'\n format.html { redirect_to(@tipoespacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipoespacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8722989642f1507474ef135d9b4a2612",
"score": "0.61731386",
"text": "def update\n @iguanastipo = Iguanastipo.find(params[:id])\n\n respond_to do |format|\n if @iguanastipo.update_attributes(params[:iguanastipo])\n format.html { redirect_to(@iguanastipo, :notice => 'Iguanastipo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @iguanastipo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "389fe7635f955f048f449abe44320497",
"score": "0.6165375",
"text": "def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to(@asiento, :notice => 'Asiento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.6162159",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "67b0d51a055ccb895b19eef170a96c0a",
"score": "0.61447835",
"text": "def update\n @espacio = Espacio.find(params[:id])\n\n respond_to do |format|\n if @espacio.update_attributes(params[:espacio])\n flash[:notice] = 'Espacio actualizado correctamente.'\n format.html { redirect_to(@espacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @espacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a332eea2cdd3c7d7a321d907be53b19",
"score": "0.6143795",
"text": "def update\n @notacredito = Notacredito.find(params[:id])\n\n respond_to do |format|\n if @notacredito.update_attributes(params[:notacredito])\n format.html { redirect_to(@notacredito, :notice => 'Notacredito was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @notacredito.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "751b40364ff9660c1c678ae6d5798635",
"score": "0.61422783",
"text": "def update\n @atribuicao = Atribuicao.find(params[:id])\n\n respond_to do |format|\n if @atribuicao.update_attributes(params[:atribuicao])\n flash[:notice] = 'Atribuicao was successfully updated.'\n format.html { redirect_to(@atribuicao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atribuicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a8f3bd2ba616b8da54593325a755a34",
"score": "0.6142271",
"text": "def update\n @interbitacora = Interbitacora.find(params[:id])\n\n respond_to do |format|\n if @interbitacora.update_attributes(params[:interbitacora])\n format.html { redirect_to(@interbitacora, :notice => 'Interbitacora was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interbitacora.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.6141029",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "8030b6a3a618d66537d0f1f7e1a4175e",
"score": "0.6136889",
"text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9939d104cc69ee0603b44e21eac25e30",
"score": "0.6134444",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435377281e9674fdb115facd334097a2",
"score": "0.6131066",
"text": "def update\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n if @inscrito.update_attributes(params[:inscrito])\n format.html { redirect_to(@inscrito, :notice => 'Inscrito was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inscrito.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b745ecd87ccfb4ea474d782737395730",
"score": "0.6119027",
"text": "def update\n @interacao = Interacao.find(params[:id])\n\n respond_to do |format|\n if @interacao.update_attributes(params[:interacao])\n format.html { redirect_to(@interacao, :notice => 'Interacao was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df3490df2ae7eae4454f015488b5a605",
"score": "0.61168647",
"text": "def update\n @oier = Oier.find_by_name(params[:id])\n\n respond_to do |format|\n if @oier.update_attributes(params[:oier])\n format.html { redirect_to(@oier, :notice => 'Oier was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @oier.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05ea17c98e44cddbeef3eb53041a3cf1",
"score": "0.6111087",
"text": "def update\n @enquete = Enquete.find(params[:id])\n\n respond_to do |format|\n if @enquete.update_attributes(params[:enquete])\n format.html { redirect_to(@enquete, :notice => 'Enquete atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enquete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1732a35780d9a4e1161ef4df202001b",
"score": "0.6111002",
"text": "def update\n @topico = Topico.find(params[:id])\n\n respond_to do |format|\n if @topico.update_attributes(params[:topico])\n format.html { redirect_to(@topico, :notice => 'Topico was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7aea2f924bd551cef167754fca54a735",
"score": "0.61086535",
"text": "def update\n @instituto = Instituto.find(params[:id])\n\n respond_to do |format|\n if @instituto.update_attributes(params[:instituto])\n flash[:notice] = ''\n format.html { redirect_to(institutos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instituto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.6107898",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "5d5a742ba7d500a5bea148fd0e712b71",
"score": "0.61074007",
"text": "def update\n @autorizador = Autorizador.find(params[:id])\n\n respond_to do |format|\n if @autorizador.update_attributes(params[:autorizador])\n format.html { redirect_to(@autorizador, :notice => 'Autorizador was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @autorizador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9190018f7b11e39e2d177190a0b4c098",
"score": "0.6092558",
"text": "def update\n @servicios = Servicios.find(params[:id])\n\n respond_to do |format|\n if @servicios.update_attributes(params[:servicios])\n flash[:notice] = 'Servicios was successfully updated.'\n format.html { redirect_to(@servicios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servicios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f04d59227a8528c801c095dda0482811",
"score": "0.6092128",
"text": "def update\n @torneotipo = Torneotipo.find(params[:id])\n\n respond_to do |format|\n if @torneotipo.update_attributes(params[:torneotipo])\n format.html { redirect_to @torneotipo, notice: 'Torneotipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @torneotipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.6091566",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.6091566",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4417bcf0efd306d590d68ddf03f5668a",
"score": "0.60871017",
"text": "def update\n @telefono = Telefono.find(params[:id])\n\n respond_to do |format|\n if @telefono.update_attributes(params[:telefono])\n format.html { redirect_to(@telefono, :notice => 'Telefono was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @telefono.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a4a6ec70371a63a53d9a2c72743d72f",
"score": "0.6086338",
"text": "def update\n @tipo_usuario = TipoUsuario.find(params[:id])\n\n respond_to do |format|\n if @tipo_usuario.update_attributes(params[:tipo_usuario])\n format.html { redirect_to(@tipo_usuario, :notice => 'Permissao alterada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb5e8963359d2ecd5ff52b1e341a1519",
"score": "0.6077997",
"text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n flash[:notice] = 'Objeto was successfully updated.'\n format.html { redirect_to(@objeto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @objeto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4510681d11f82492e84a893389caf9e",
"score": "0.6070455",
"text": "def update\n @orc_ata_iten = OrcAtaIten.find(params[:id])\n\n respond_to do |format|\n if @orc_ata_iten.update_attributes(params[:orc_ata_iten])\n flash[:notice] = 'SALVO COM SUCESSO'\n format.html { redirect_to(home_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_ata_iten.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3354e389d4a16b0d2e49e4251860e578",
"score": "0.60687256",
"text": "def update\n @exercicio = Exercicio.find(params[:id])\n\n respond_to do |format|\n if @exercicio.update_attributes(params[:exercicio])\n format.html { redirect_to(@exercicio, :flash => { :success => 'Exercicio alterado com sucesso.' }) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f55dbd332599acaea6b2860b8a70f54c",
"score": "0.6060399",
"text": "def update\n @instancia = Instancia.find(params[:id])\n\n respond_to do |format|\n if @instancia.update_attributes(params[:instancia])\n format.html { redirect_to(@instancia, :notice => 'Instancia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instancia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e418358cd766cf57276382c5f1d9af6",
"score": "0.6059976",
"text": "def update\n @solicitante = Solicitante.find(params[:id])\n\n respond_to do |format|\n if @solicitante.update_attributes(params[:solicitante])\n format.html { redirect_to(@solicitante, :notice => 'Solicitante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.6056793",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "6bf505e66f8c8e67bd756756115f56e8",
"score": "0.60529107",
"text": "def update\n @serviciorepuesto = Serviciorepuesto.find(params[:id])\n\n respond_to do |format|\n if @serviciorepuesto.update_attributes(params[:serviciorepuesto])\n format.html { redirect_to(@serviciorepuesto, :notice => 'Serviciorepuesto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serviciorepuesto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba39d0fa374658cb9542d1d5849415cf",
"score": "0.604992",
"text": "def update\n @nome = Nome.find(params[:id])\n\n respond_to do |format|\n if @nome.update_attributes(params[:nome])\n format.html { redirect_to(@nome, :notice => 'Nome was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nome.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef0c5e68037eb2d68c7a3cc951b7bd2e",
"score": "0.6044299",
"text": "def update\n @nuevo_usuario = NuevoUsuario.find(params[:id])\n\n respond_to do |format|\n if @nuevo_usuario.update_attributes(params[:nuevo_usuario])\n format.html { redirect_to(@nuevo_usuario, :notice => 'Nuevo usuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nuevo_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "078576715977ec8ae1fc57ca12029516",
"score": "0.60385174",
"text": "def update\n @indicadorescodigo = Indicadorescodigo.find(params[:id])\n\n respond_to do |format|\n if @indicadorescodigo.update_attributes(params[:indicadorescodigo])\n format.html { redirect_to(@indicadorescodigo, :notice => 'Indicadorescodigo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @indicadorescodigo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f56ec95a12bf54ed0335b4595e3bdf18",
"score": "0.6030128",
"text": "def update\n @titulo = Titulo.find(params[:id])\n\n respond_to do |format|\n if @titulo.update_attributes(params[:titulo])\n flash[:notice] = ''\n format.html { redirect_to(autor_path(session[:id])) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @titulo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d0a53c6b19758b91ca2ede0b8e3a091",
"score": "0.6026907",
"text": "def update\n @autorizacion = Autorizacion.find(params[:id])\n\n respond_to do |format|\n if @autorizacion.update_attributes(params[:autorizacion])\n format.html { redirect_to(@autorizacion, :notice => 'Autorizacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @autorizacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "626af91271495ade9fd5601fc2a240fe",
"score": "0.6026151",
"text": "def update\n @orden_servicio = OrdenServicio.find(params[:id])\n\n respond_to do |format|\n if @orden_servicio.update_attributes(params[:orden_servicio])\n format.html { redirect_to @orden_servicio, notice: 'Orden servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0245d13dd3a733501972ea4ec63f98bc",
"score": "0.6009215",
"text": "def update\n @registro = Registro.find(params[:id])\n\n respond_to do |format|\n if @registro.update_attributes(params[:registro])\n flash[:notice] = 'REGISTRO INDIVIDUAL DE ALUNO CADASTRADO.'\n format.html { redirect_to(@registro) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @registro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05fc06a2d1a4df09a0db2e6bdc1509b5",
"score": "0.6009048",
"text": "def update\n @estado = Estado.find(params[:id])\n\n respond_to do |format|\n if @estado.update_attributes(params[:estado])\n flash[:notice] = 'Estado foi atualizado com sucesso.'\n format.html { redirect_to(@estado) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc9e0bc5c524996d0c9efc9685f8fd9e",
"score": "0.6002663",
"text": "def update\n @emissora = Emissora.find(params[:id])\n\n respond_to do |format|\n if @emissora.update_attributes(params[:emissora])\n format.html { redirect_to(@emissora, :notice => 'Emissora was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @emissora.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19603df4992ea344cc3c0dd17e56c298",
"score": "0.60001606",
"text": "def update\n @tipostramite = Tipostramite.find(params[:id])\n\n respond_to do |format|\n if @tipostramite.update_attributes(params[:tipostramite])\n format.html { redirect_to(@tipostramite, :notice => 'Tipostramite was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipostramite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f782f3f6e20040bd20c960aa9c7ca2d",
"score": "0.5999213",
"text": "def update\n @contato_interno = ContatoInterno.find(params[:id])\n\n respond_to do |format|\n if @contato_interno.update_attributes(params[:contato_interno])\n flash[:notice] = 'ContatoInterno was successfully updated.'\n format.html { redirect_to(@contato_interno) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contato_interno.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5494946e311f840bac5a88c54becb14",
"score": "0.5995825",
"text": "def update\n @tipo_suelo = TipoSuelo.find(params[:id])\n\n respond_to do |format|\n if @tipo_suelo.update_attributes(params[:tipo_suelo])\n flash[:notice] = 'TipoSuelo was successfully updated.'\n format.html { redirect_to(@tipo_suelo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_suelo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "736d298cd2f7293ceea7d622b6d31a5e",
"score": "0.599554",
"text": "def update\n @episodio = get_by_numero(params[:id])\n\n respond_to do |format|\n if @episodio.update_attributes(params[:episodio])\n flash[:notice] = 'Episodio was successfully updated.'\n format.html { redirect_to(@episodio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @episodio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50b39f321f99c2d2a02d4e084bf29755",
"score": "0.59939694",
"text": "def update\n @existencia = Existencia.find(params[:id])\n\n respond_to do |format|\n if @existencia.update_attributes(params[:existencia])\n format.html { redirect_to(@existencia, :notice => 'Existencia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @existencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec89eeb30cbff973eb2db70677f747ca",
"score": "0.59933156",
"text": "def update\n @asiento = Asiento.find(params[:id])\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "316eadcc186ae4f7f6f6ec06f506be8b",
"score": "0.59923524",
"text": "def update\n @entrega = Entrega.find(params[:id])\n\n respond_to do |format|\n if @entrega.update_attributes(params[:entrega])\n format.html { redirect_to(@entrega, :notice => 'Entrega was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entrega.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95e464d5df3dd95910e7ceea9d2c0169",
"score": "0.59889483",
"text": "def update\n @registro = Registro.find(params[:id])\n\n respond_to do |format|\n if @registro.update_attributes(params[:registro])\n flash[:notice] = 'Registro was successfully updated.'\n format.html { redirect_to(@registro) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @registro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5",
"score": "0.5986468",
"text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/api/v1/tasks/#{params[:id]}.xml\", @access_token, {:scheme => :query_string},\n {'task[title]' => 'Updated Valid Task'})\n render :xml => @response.body\n end",
"title": ""
},
{
"docid": "e4f005403f749a7cd2e207c0220fcac3",
"score": "0.5986347",
"text": "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35277bf1b8be128aba37c29809f0c45d",
"score": "0.5984932",
"text": "def update\n @especialista = Especialista.find(params[:id])\n\n respond_to do |format|\n if @especialista.update_attributes(params[:especialista])\n flash[:notice] = 'Especialista se ha actualizado con exito.'\n format.html { redirect_to(admin_especialistas_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @especialista.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1459eb2d2f18d95153cf8a78fff6628b",
"score": "0.5984748",
"text": "def update\n @depositario = Depositario.find(params[:id])\n\n respond_to do |format|\n if @depositario.update_attributes(params[:depositario])\n format.html { redirect_to(@depositario, :notice => 'Depositario atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @depositario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf3533a6036de4111a4655c2ebce7a8a",
"score": "0.5979185",
"text": "def update\n @informativo = Informativo.find(params[:id])\n\n respond_to do |format|\n if @informativo.update_attributes(params[:informativo])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@informativo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @informativo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ed52a5c0bf2b64592e74e74f4170431",
"score": "0.59784514",
"text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(usuarios_url, :notice => '') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "989c1f5eec5f7c33d62ab102ae620528",
"score": "0.5977325",
"text": "def update\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n if @aluno.update_attributes(params[:aluno])\n format.html { redirect_to(alunos_path, :notice => 'Registro alterado com sucesso!') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aluno.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "580ae6f45e88a2250d389aa69a5ac918",
"score": "0.59759474",
"text": "def update\n @missionario = Missionario.find(params[:id])\n\n respond_to do |format|\n if @missionario.update_attributes(params[:missionario])\n flash[:notice] = 'Missionario was successfully updated.'\n format.html { redirect_to(@missionario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @missionario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3352fa8c0e09ee4756724419e94e1712",
"score": "0.59755456",
"text": "def update\n @transportista = Transportista.find(params[:id])\n\n respond_to do |format|\n if @transportista.update_attributes(params[:transportista])\n flash[:notice] = 'Transportista was successfully updated.'\n format.html { redirect_to(@transportista) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @transportista.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbf6b702fbe842f89477964196882992",
"score": "0.5973296",
"text": "def update\n @seguimiento = Seguimiento.find(params[:id])\n\n respond_to do |format|\n if @seguimiento.update_attributes(params[:seguimiento])\n format.html { redirect_to(@seguimiento, :notice => 'Seguimiento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seguimiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea4940fa240db97932409ce4e1f979b5",
"score": "0.59709",
"text": "def update\n @appunto_riga = AppuntoRiga.find(params[:id])\n\n respond_to do |format|\n if @appunto_riga.update_attributes(params[:appunto_riga])\n flash[:notice] = 'Appunto riga was successfully updated.'\n format.html { redirect_to @appunto_riga }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appunto_riga.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6d8fdf1269afb4c52022e93c35345c9",
"score": "0.5968959",
"text": "def update\n @tconexion = Tconexion.find(params[:id])\n\n respond_to do |format|\n if @tconexion.update_attributes(params[:tconexion])\n format.html { redirect_to(@tconexion, :notice => 'Tconexion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tconexion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44f4c73e929d9d1df0928b53c7bb76a2",
"score": "0.5968851",
"text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c235a91b3cdcb20ebcfa6ff1fa58a2df",
"score": "0.59633213",
"text": "def update\n @relatorio = Relatorio.find(params[:id])\n\n respond_to do |format|\n if @relatorio.update_attributes(params[:relatorio])\n format.html { redirect_to(@relatorio, :notice => 'Relatorio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @relatorio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8f0ca92ccd488d4678cfd10dd8f0415",
"score": "0.5958925",
"text": "def update\n @tipo_viatura = TipoViatura.find(params[:id])\n\n respond_to do |format|\n if @tipo_viatura.update_attributes(params[:tipo_viatura])\n format.html { redirect_to(@tipo_viatura, :notice => 'Tipo viatura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_viatura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82b286ed9737de4df09adcef178aeac8",
"score": "0.5956952",
"text": "def update\n @itens_minuta = ItensMinuta.find(params[:id])\n\n respond_to do |format|\n if @itens_minuta.update_attributes(params[:itens_minuta])\n flash[:notice] = 'ItensMinuta was successfully updated.'\n format.html { redirect_to(@itens_minuta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @itens_minuta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05181065105c2fbe54c8c57b8f360ccc",
"score": "0.59549344",
"text": "def update\n @documento_intere = DocumentoIntere.find(params[:id])\n\n respond_to do |format|\n if @documento_intere.update_attributes(params[:documento_intere])\n flash[:notice] = 'DocumentoIntere se ha actualizado con exito.'\n format.html { redirect_to(admin_documento_interes_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @documento_intere.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "644c5dad5867186557f6d3865d9e3789",
"score": "0.5953433",
"text": "def update_usuario\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(@usuario, :notice => 'Datos del usuario fueron actualizados de forma correcta.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ccfe2e3f8c58d3857d2cf11c91ce226",
"score": "0.59481233",
"text": "def update\n @kitaitoi = Kitaitoi.find(params[:id])\n\n respond_to do |format|\n if @kitaitoi.update_attributes(params[:kitaitoi])\n flash[:notice] = 'Kitaitoi was successfully updated.'\n format.html { redirect_to(@kitaitoi) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kitaitoi.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "949f658911d9f238f8772be6670a25b2",
"score": "0.59479487",
"text": "def update\n @naciona = Naciona.find(params[:id])\n\n respond_to do |format|\n if @naciona.update_attributes(params[:naciona])\n flash[:notice] = 'Naciona was successfully updated.'\n format.html { redirect_to(@naciona) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @naciona.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53198564bdbe0b3e5aecde64cb9159df",
"score": "0.59474194",
"text": "def update\n respond_to do |format| \n if @paquete_turistico.update(paquete_turistico_params) then\n Itinerario.where(paquete_turistico_id: @paquete_turistico).destroy_all\n arrItinerarios = params[:itinerario][:dia]\n \n arrItinerarios.each do |t|\n if t != \"\" then\n itinerario = Itinerario.new\n itinerario.paquete_turistico_id = @paquete_turistico.id\n itinerario.itnr_actividad = t\n itinerario.itnr_estadoRegistro = \"A\"\n itinerario.save\n end\n end\n \n format.html { redirect_to @paquete_turistico, notice: 'Paquete turistico actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @paquete_turistico }\n else\n format.html { render :edit }\n format.json { render json: @paquete_turistico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc987805db221132b11244853dd1f5a2",
"score": "0.5946747",
"text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(usuarios_path, notice: 'usuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26038fe278a3a8cb38d0cebce2ba8444",
"score": "0.5944412",
"text": "def update\n @solicitudrecurso = Solicitudrecurso.find(params[:id])\n \n\n respond_to do |format|\n \n if @solicitudrecurso.update_attributes(:motivos => params[:motivos])\n \n getIndexView\n format.html { render :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitudrecurso.errors, :status => :unprocessable_entity }\n end\n \n end\n end",
"title": ""
},
{
"docid": "b32a76fbeb4e3530baa3000dd13e3952",
"score": "0.5940213",
"text": "def update\n @tipo_contato = TipoContato.find(params[:id])\n\n respond_to do |format|\n if @tipo_contato.update_attributes(params[:tipo_contato])\n format.html { redirect_to(@tipo_contato, :notice => 'Tipo contato was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_contato.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3b11177f936790fda9152eb8a1a9da6",
"score": "0.5932227",
"text": "def update\n @tipo_de_notificacao = TipoDeNotificacao.find(params[:id])\n\n respond_to do |format|\n if @tipo_de_notificacao.update_attributes(params[:tipo_de_notificacao])\n format.html { redirect_to(@tipo_de_notificacao, :notice => 'TipoDeNotificacao atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_de_notificacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b4bb6a876a505ed18cdb4591c1f541f",
"score": "0.59299994",
"text": "def update\n @indicador = Indicador.find(params[:id])\n\n respond_to do |format|\n if @indicador.update_attributes(params[:indicador])\n format.html { redirect_to(@indicador, :notice => 'Indicador was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @indicador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37521cae727d0a18502df197cfe0f34",
"score": "0.59281826",
"text": "def update\n @solicitud = Solicitud.find(params[:id])\n respond_to do |format|\n if @solicitud.update_attributes(params[:solicitud])\n flash[:notice] = 'La solicitud a sido correctamente actualizada.'\n format.html { redirect_to(@solicitud) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.59248984",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "dcbc859c1626b7f3ec4a2395e7fafeab",
"score": "0.59223855",
"text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n flash[:notice] = 'El usuario fue correctamente actualizado.'\n format.html { redirect_to(@usuario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66e3e568993c7a5d37b2d60927e6ad0c",
"score": "0.59212285",
"text": "def update\n @torneio = Torneio.find(params[:id])\n\n respond_to do |format|\n if @torneio.update_attributes(params[:torneio])\n format.html { redirect_to @torneio, notice: 'Torneio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @torneio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "458b370d98b713f4cdadfd92aa610bca",
"score": "0.59174883",
"text": "def update\n @tiporesolucion = Tiporesolucion.find(params[:id])\n\n respond_to do |format|\n if @tiporesolucion.update_attributes(params[:tiporesolucion])\n format.html { redirect_to(@tiporesolucion, :notice => 'Tiporesolucion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tiporesolucion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f903a31a2a4ea0da45dc02b277ee14b",
"score": "0.59100735",
"text": "def update\n @tipo_elemento = TipoElemento.find(params[:id])\n\n respond_to do |format|\n if @tipo_elemento.update_attributes(params[:tipo_elemento])\n flash[:notice] = 'TipoElemento was successfully updated.'\n format.html { redirect_to(@tipo_elemento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_elemento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
b7e6cd78214f670d49b35dbdc6fd2704
|
GET /stockroom_removals/1 GET /stockroom_removals/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "8a232b45f90a0da381f3afb9fc651bcc",
"score": "0.67641926",
"text": "def destroy\n @stockroom_removal.destroy\n respond_to do |format|\n format.html { redirect_to stockroom_removals_url, notice: 'Stockroom removal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d25e2533a098dfba9f2980b4e9c1556b",
"score": "0.6407198",
"text": "def index\n @filter = StockroomRemovalFilter.new({\n start_date: params.fetch(:stockroom_removal_filter, nil).try(:fetch, :start_date, nil),\n end_date: params.fetch(:stockroom_removal_filter, nil).try(:fetch, :end_date, nil),\n user: params.fetch(:stockroom_removal_filter, nil).try(:fetch, :user, nil)\n })\n\n @stockroom_removals = @filter.search\n end",
"title": ""
},
{
"docid": "54391006842d3d80490646c65fa750c8",
"score": "0.63759047",
"text": "def set_stockroom_removal\n @stockroom_removal = StockroomMovimentation.find(params[:id])\n end",
"title": ""
},
{
"docid": "abd6943a852157254b55e3f05dad2457",
"score": "0.6086871",
"text": "def destroy\n @stock_interval.destroy\n respond_to do |format|\n format.html { redirect_to stock_intervals_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5cad1d44a6b4d39b8f4c27c0e8fb1f66",
"score": "0.59343904",
"text": "def destroy\n @restroom.destroy\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41cebf15050f649e14ca31a666e637f7",
"score": "0.5918844",
"text": "def destroy\n @roomrate = Roomrate.find(params[:id])\n @roomrate.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_roomrates_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dee36ed462106566d79e5ac747fa2317",
"score": "0.5901176",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dee36ed462106566d79e5ac747fa2317",
"score": "0.5901176",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "396395a37b436a47a038251681319eed",
"score": "0.5899649",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc7710e3a2204fde699ba1800852085e",
"score": "0.58383554",
"text": "def destroy\n @room_rate = RoomRate.find(params[:id])\n @room_rate.destroy\n\n respond_to do |format|\n format.html { redirect_to room_rates_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1149bf7e60113549dd98245a1d5df213",
"score": "0.58323073",
"text": "def refresh\n @room = Room.find(params[:room_id])\n respond_to do |format|\n format.json { render :json => @room }\n format.html\n end\n end",
"title": ""
},
{
"docid": "118954912c415b3c0e71cfe1f968c04d",
"score": "0.582892",
"text": "def destroy\r\n @watched_stock = WatchedStock.find_by(watchlist_id: watched_stocks_params[:watchlist_id], stock_symbol: watched_stocks_params[:stock_symbol])\r\n if @watched_stock.destroy\r\n render \"api/watched_stocks/show\"\r\n else\r\n render json: \"Stock was not removed from the watchlist\", status: 422\r\n end \r\n end",
"title": ""
},
{
"docid": "c561055e7ad325b1d6bb0a209d84e0fb",
"score": "0.5792854",
"text": "def destroy\n @stock_resource = StockResource.find(params[:id])\n @stock_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_resources_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "130f9315eb44c1cecc30f21b76ad38d4",
"score": "0.57797134",
"text": "def destroy\n @uniform_stock_received.destroy\n respond_to do |format|\n format.html { redirect_to uniform_stock_receiveds_url, notice: (t 'uniform_stock_receiveds.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbc4068cdbc9433480868163d7794724",
"score": "0.5773372",
"text": "def destroy\n @purchased_stock = PurchasedStock.find(params[:id])\n @purchased_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to purchased_stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbc4068cdbc9433480868163d7794724",
"score": "0.5773372",
"text": "def destroy\n @purchased_stock = PurchasedStock.find(params[:id])\n @purchased_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to purchased_stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c6dc66a7786f30f78233ffceb7b1bd3",
"score": "0.5729511",
"text": "def destroy\n @stock = Stock.find( params[:id] )\n @stock.delete_status = 1\n @stock.save\n #@stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_edit_all_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3c14f07b790fe37378eae917357aba7",
"score": "0.57272166",
"text": "def destroy\n @total_stock = TotalStock.find(params[:id])\n @total_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to total_stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "953c383058d78eb2180c3820135fb9fa",
"score": "0.57186645",
"text": "def destroy\n @stock_price = StockPrice.find(params[:id])\n @stock_price.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_prices_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5e5bd4ac747c7af9bcd832c1cf4a9caa",
"score": "0.5712806",
"text": "def vaciarRecepcionBodega\n ProveedorDespacharProductos.new.vaciarRecepcion\n render json: 'Almacen.find_by(recepcion: true).stocks'\nend",
"title": ""
},
{
"docid": "17f22c3e6f642b7cf2847f96449ec83a",
"score": "0.5696731",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully deleted from watchlist.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4b97673bee321fab171ca5722771cfa7",
"score": "0.56778324",
"text": "def destroy\n @product_stock = ProductStock.find(params[:id])\n @product_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to product_stocks_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4c6a8191019e3abbcff18dd6b358b1c0",
"score": "0.5670347",
"text": "def destroy\n @rum = Rum.find(params[:id])\n @rum.destroy\n\n respond_to do |format|\n format.html { redirect_to rums_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0036844f40d8fd7bca1327764aa36da2",
"score": "0.5659863",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa63e553758eaa3b10b9a47379556ac0",
"score": "0.5646643",
"text": "def destroy\n @reserved_room.destroy\n respond_to do |format|\n format.html { redirect_to reserved_rooms_url, notice: 'Reserved room was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98505fe84d1b571223274be6d00d2523",
"score": "0.5640797",
"text": "def destroy\n @product_stock = ProductStock.find(params[:id])\n @product_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to product_stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38ed7fa6955c6bdfe4ca7bde9187db1b",
"score": "0.56368154",
"text": "def destroy\n new_quantity = Stock.where(:user_id => current_user.id, :drug_id => @prescription.drug_id).order(\"updated_at DESC\").first.quantity_available - @prescription.quantity\n @stock = Stock.new(user_id: current_user.id, quantity_available: new_quantity, drug_id: @prescription.drug_id)\n @stock.save\n \n @prescription.destroy\n respond_to do |format|\n format.html { redirect_to prescriptions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7cb26f8c7d0112f08666922df9c2b8e",
"score": "0.5630967",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2b937eaa6d3441519a72a91c2676f7c",
"score": "0.5620227",
"text": "def destroy\n @ridol = Ridol.find(params[:id])\n @ridol.destroy\n\n respond_to do |format|\n format.html { redirect_to ridols_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "20940f68cd6b9b2609a3cd422d1d3baa",
"score": "0.56061065",
"text": "def destroy\n @rrange.destroy\n respond_to do |format|\n format.html { redirect_to rranges_url, notice: 'Rrange was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f87881aa70e4d170edf16cf780fcbf0",
"score": "0.5598408",
"text": "def destroy\n @model_stock.destroy\n respond_to do |format|\n format.html { redirect_to model_stocks_url, notice: t('common.message.destroyed_success')}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4cd7cb2342946e9a450d6bb9c40d0a7e",
"score": "0.55937475",
"text": "def index\n @user = User.find(params[:user_id])\n @rooms = @user.rooms.all\n render json: @rooms if stale?(etag: @rooms.all, last_modified: @rooms.maximum(:updated_at))\n end",
"title": ""
},
{
"docid": "6e59de78c0411c8c94d65981790442b7",
"score": "0.5591776",
"text": "def index\n @rooms = Room.where(\"status != 'CANCELLED'\").order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end",
"title": ""
},
{
"docid": "6be5a0aee5332554527640da03ec12fb",
"score": "0.55670094",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to(stocks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6be5a0aee5332554527640da03ec12fb",
"score": "0.55670094",
"text": "def destroy\n @stock = Stock.find(params[:id])\n @stock.destroy\n\n respond_to do |format|\n format.html { redirect_to(stocks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "98c73292f50189de46f7d6ac922d64e1",
"score": "0.5561929",
"text": "def destroy\n @stocklist = Stocklist.find(params[:id])\n @stocklist.destroy\n\n respond_to do |format|\n format.html { redirect_to stocklists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3c28f2fefa07ebc43c96366b5e255912",
"score": "0.5558611",
"text": "def destroy\n @restroom = Restroom.find(params[:id])\n authorize @restroom\n @restroom.destroy\n respond_to do |format|\n format.html { redirect_to restrooms_path, notice: 'Restroom deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "339a7059220af27ba2e196a944269b1a",
"score": "0.5553277",
"text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url, notice: 'Stock was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a916e2dc584622696b3d9315c9d03056",
"score": "0.554557",
"text": "def destroy\n @stocktake.destroy\n respond_to do |format|\n format.html { redirect_to stocktakes_url, notice: 'Stocktake was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7261f2c97e4889e533e63cfaab89e2c4",
"score": "0.5535307",
"text": "def destroy\n @sp500_stock = Sp500Stock.find(params[:id])\n @sp500_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to sp500_stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e70ebe26219522c6ec4dffc55a5582f",
"score": "0.5530827",
"text": "def destroy\n @recipy = Recipy.find(params[:id])\n @recipy.destroy\n\n respond_to do |format|\n format.html { redirect_to recipies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5fb761009c55d2fae3771c4f7d9656e1",
"score": "0.55173045",
"text": "def destroy\n @stock_type = StockType.find(params[:id])\n @stock_type.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0a16539e0e9a62e65ad898781c8607dc",
"score": "0.5514871",
"text": "def destroy\n @stockstatus.destroy\n respond_to do |format|\n format.html { redirect_to stockstatuses_url, notice: 'Stockstatus was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e88ed6a66c463ebc4abf09cd19ace0f1",
"score": "0.5511135",
"text": "def destroy\n @restroom = Restroom.find(params[:id])\n @restroom.destroy\n authorize! :destroy, @restroom\n\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e88ed6a66c463ebc4abf09cd19ace0f1",
"score": "0.5511135",
"text": "def destroy\n @restroom = Restroom.find(params[:id])\n @restroom.destroy\n authorize! :destroy, @restroom\n\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7a28671649c72986ea4ee14610af240",
"score": "0.54895115",
"text": "def destroy\n @reservation = Reservation.find(params[:id])\n [email protected]_xml\n [email protected]_json\n @reservation.make_historical\n\n respond_to do |format|\n format.html { redirect_to(reservations_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"title": ""
},
{
"docid": "94171f1f926b2cd948504713a59a8109",
"score": "0.5478225",
"text": "def destroy\n @company_inventory_stock.destroy\n respond_to do |format|\n format.html { redirect_to company_inventory_stocks_url, notice: 'Company inventory stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f0abf7fab49474cd813c53152ec5700",
"score": "0.5477331",
"text": "def destroy\n @asset_stock.destroy\n respond_to do |format|\n format.html { redirect_to asset_stocks_url, notice: 'Asset stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9a5f133a3d9f0c0ec9fb4b596c65400",
"score": "0.5475024",
"text": "def destroy\n @qty_range.destroy\n respond_to do |format|\n format.html { redirect_to qty_ranges_url, notice: \"Qty range was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4c1061c735e1879c73580f32442606d",
"score": "0.54663455",
"text": "def destroy\n @stock_entry = StockEntry.find(params[:id])\n @stock_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a08a017f4fee4a2b511e810330bc4a6e",
"score": "0.5437452",
"text": "def destroy\n @rate_change_history = RateChangeHistory.find(params[:id])\n @rate_change_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(rate_change_histories_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ea0e63bcbcf97c4efe4a2457aa1bf798",
"score": "0.5435956",
"text": "def destroy\n @room_history.destroy\n respond_to do |format|\n format.html { redirect_to room_histories_url, notice: 'Room history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "801b4fe8722690e2c9f05f916280de92",
"score": "0.54327136",
"text": "def destroy\n @stock_product.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6467f3ae4dcea5c287c3bcc4fdd262ff",
"score": "0.54304457",
"text": "def destroy\n @stock_collection.destroy\n respond_to do |format|\n format.html { redirect_to stock_collections_url, notice: 'Stock collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "329e1f779973a76bf70f01b565525bff",
"score": "0.541932",
"text": "def destroy\n @stock_price.destroy\n respond_to do |format|\n format.html { redirect_to stock_prices_url, notice: 'Stock price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee214b7cc35c3cf8346b7778aab705ab",
"score": "0.5418131",
"text": "def destroy\n @reservation_room.destroy\n respond_to do |format|\n format.html { redirect_to reservation_rooms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d95e045aa8535cc5e055dfd2f622ee17",
"score": "0.54143345",
"text": "def destroy\n @distributor_stock_book.destroy\n respond_to do |format|\n format.html { redirect_to distributor_stock_books_url, notice: 'Distributor stock book was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14a76af3f92c0482c193cd2923ecab8e",
"score": "0.5411462",
"text": "def destroy\n @asset_stock_status.destroy\n respond_to do |format|\n format.html { redirect_to asset_stock_statuses_url, notice: 'Asset stock status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82578a1c2cb26af1d99604fb5949a2d4",
"score": "0.54066014",
"text": "def destroy\n @freerange.destroy\n respond_to do |format|\n format.html { redirect_to current_user}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2b5c70db7081a2f9ca5ab0fbd535d5c",
"score": "0.5402476",
"text": "def destroy\n @addstock.destroy\n respond_to do |format|\n format.html { redirect_to addstocks_url, notice: 'Addstock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "02058ccdd594d5ff1e24642d7bd2b35b",
"score": "0.5399616",
"text": "def destroy\n @goods_stock = GoodsStock.find(params[:id])\n @goods_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to goods_stocks_url }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "ac77c1e9db50702822f5a0ffe4cb88e3",
"score": "0.53819394",
"text": "def destroy\n @stock.destroy\n redirect_to user_path(current_user)\n end",
"title": ""
},
{
"docid": "1075d87db0249a02db50561f266a3942",
"score": "0.53818667",
"text": "def destroy\n new_quantity = Stock.where(:user_id => current_user.id, :drug_id => @dosing.drug_id).order(\"updated_at DESC\").first.quantity_available + 1\n @stock = Stock.new(user_id: current_user.id, quantity_available: new_quantity, drug_id: @dosing.drug_id)\n @stock.save\n @dosing.destroy\n respond_to do |format|\n format.html { redirect_to dosings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "42b65cfba53c8a68242ef9cc2f7b5b29",
"score": "0.5374234",
"text": "def destroy\n @feedstock = Feedstock.find(params[:id])\n @feedstock.destroy\n\n respond_to do |format|\n format.html { redirect_to feedstocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "522ad6916e37310212f7de6a62078f7e",
"score": "0.5368679",
"text": "def destroy\n @incomestock = Incomestock.find(params[:id])\n @incomestock.destroy\n\n respond_to do |format|\n format.html { redirect_to incomestocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a999c1c307ac931a065cb3e570802ca9",
"score": "0.53669703",
"text": "def destroy\n @stock_ticker.destroy\n respond_to do |format|\n format.html { redirect_to stock_tickers_url, notice: 'Stock ticker was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3583307e2e3d8030a1a87b5f4a3bc67a",
"score": "0.5364903",
"text": "def destroy\n @stock_transaction = StockTransaction.find(params[:id])\n @stock_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_transactions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87343d05b21d79c9be7a6c41bf511c3b",
"score": "0.53581464",
"text": "def destroy\n @stock_audit = StockAudit.new\n @stock_audit.user = current_user\n @stock_audit.stock = @stock\n @stock_audit.comment = \"destroyed stock unit with an ID of #{@stock.id}\"\n @stock_audit.save\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff3bfb8a70e4918072bee53dc025705d",
"score": "0.5355955",
"text": "def destroy\n @paperstock.paperstock_items.each do |paperstock_item|\n paperstock_item.destroy\n end\n @paperstock.destroy\n respond_to do |format|\n format.html { redirect_to paperstocks_url, notice: 'Paperstock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "659709ca9d468bc50aa4e3f4b4d3bea3",
"score": "0.5355455",
"text": "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "308495a55dd1bdb58b74dc6935b68c10",
"score": "0.53428525",
"text": "def destroy\n #Ao apagar uma sala, suas cartas devem ser apagadas.\n Poker.where(room: @room).destroy_all\n \n @room.destroy\n \n respond_to do |format|\n format.html { redirect_to rooms_url, notice: \"Sala '\" + @room.name + \"' foi apagada com sucesso!\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1dc1fc196a5a51d6b190794853f1df12",
"score": "0.5342587",
"text": "def destroy\n @rent = Rent.find(params[:id])\n @rent.destroy\n\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "913d36c4fcf5dd3f30a251907d3d5241",
"score": "0.53416604",
"text": "def destroy\n @chore = Chore.find(params[:id])\n #Check if the chore has a scheduler with a nonzero respawn time\n #If it does, take the user to the recurring chore deletion page\n if(@chore.chore_scheduler != nil and @chore.chore_scheduler.respawn_time != 0)\n puts \"DEBUG: This is a recurring chore!\"\n respond_to do |format|\n format.html\n format.json { render :json => @chore }\n end\n #If not, just destroy it, and take it to the chores url\n else\n @chore.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'home', action: 'chore_market' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "0be5a6c50515d96df06d3c8d363787af",
"score": "0.53375226",
"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": "54ad310d01e84897b4484cf34ec21692",
"score": "0.5314619",
"text": "def destroy\n @stockist = Stockist.find(params[:id])\n @stockist.destroy\n\n respond_to do |format|\n format.html { redirect_to(stockists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8453d7a4dff10812770c1fb98969602f",
"score": "0.53102666",
"text": "def destroy\n @red.destroy\n respond_to do |format|\n format.html { redirect_to reds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4507bf485d99274c44b7f8d95ba9188",
"score": "0.5304634",
"text": "def destroy\n @schedules_history = SchedulesHistory.find(params[:id])\n @schedules_history.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_histories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b667f68d26cc96060ccf4079d46edade",
"score": "0.5297167",
"text": "def destroy\n @distributor_stock_ledger_type.destroy\n respond_to do |format|\n format.html { redirect_to distributor_stock_ledger_types_url, notice: 'Distributor stock ledger type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c286bb17d22404f112c60c2b52ef5ec0",
"score": "0.52971125",
"text": "def destroy\n @rush = Rush.find(params[:id])\n @rush.destroy\n\n respond_to do |format|\n format.html { redirect_to rushes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "71a9958e59cbe3826eba432717e5840a",
"score": "0.528986",
"text": "def index\n @restrooms = Restroom.all\n end",
"title": ""
},
{
"docid": "159ad741436e40daae5381ee21e8e19b",
"score": "0.5288673",
"text": "def destroy\n @readied_item_slot.destroy\n respond_to do |format|\n format.html { redirect_to readied_item_slots_url, notice: 'Readied item slot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8745625bd3eadbc8afadfa6038a28051",
"score": "0.5280546",
"text": "def rm_get path, entity, msg\n\n rmp = nil\n re = rm_request path\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n rmp = JSON.parse(re.body)[entity] rescue nil\n chk !rmp, msg + \"\\n#{re.body.inspect}\\n\\n\"\n return rmp\n\nend",
"title": ""
},
{
"docid": "edbbb3284c999b87560a482ad772a23f",
"score": "0.5277045",
"text": "def destroy\n @stock_item = StockItem.find(params[:id])\n @stock_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(stock_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fb8ef170ca6d7cf7b8232fc76bb1a2b1",
"score": "0.526722",
"text": "def index\n @product = Product.find(params[:product_id])\n @product_stocks = @product.product_stocks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_stocks }\n end\n end",
"title": ""
},
{
"docid": "5b89de76d740ff07346c4c9e1a7f38f6",
"score": "0.5265387",
"text": "def destroy\n @stock_option.destroy\n respond_to do |format|\n format.html { redirect_to stock_options_url, notice: 'Stock option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47219624b8aaf81a789c4b97a29a4660",
"score": "0.5262508",
"text": "def get_rooms\n # DO NOT DELETE. Condition used for load testing\n @user_id = (params.has_key? :user_id) ? params[:user_id] : session[:user_id]\n @room_ids = Member.where(user_id: @user_id).pluck(:room_id)\n\n @rooms = Room.find(@room_ids)\n #render json: @rooms\n \n @roomList = []\n #@rooms.each { |room|\n for room in @rooms do\n #@room = Room.find_by(id: room_id)\n temp = {}\n temp.store(\"room_id\",room.id)\n temp.store(\"room_name\", room.name) \n temp.store(\"room_token\", room.token)\n @roomList.push(temp)\n end\n render json: {rooms: @roomList}, status: 200\n end",
"title": ""
},
{
"docid": "184064ddd28fecc991fb4166dcdd5a87",
"score": "0.5258201",
"text": "def destroy\n @rally.destroy\n respond_to do |format|\n format.html { redirect_to rallies_url, notice: 'Rally was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
e60e151fb544266a13f7a96a30dfbcc1
|
TIME_COMPLEXITY = n! space_complexity = n
|
[
{
"docid": "5677c2b1ff8b3433e04918dfe14d9470",
"score": "0.0",
"text": "def second_anagram?(string1, string2)\n return false if string2.length < string1.length\n string1.chars.each do |letter|\n string2.each_char.with_index do |letter2, idx|\n if letter == letter2\n string2[idx] = \"\"\n end\n end\n end\n string2.empty? ? true : false\nend",
"title": ""
}
] |
[
{
"docid": "030234aef0ea3f2c4e2d26b18bf76b15",
"score": "0.59061503",
"text": "def bench n\n t = Time.now\n n.times{ yield }\n cost = Time.now - t\n\n t = Time.now\n n.times{}\n baseline = Time.now - t\n\n cost - baseline\nend",
"title": ""
},
{
"docid": "ac6944a7d6c29e5efc89131ce2dc3640",
"score": "0.5904183",
"text": "def maximum_complexity(n)\n estimated_complexity = @scale * @options[:level].call(n)\n estimated_complexity + (estimated_complexity * @options[:approximation])\n end",
"title": ""
},
{
"docid": "820f6b300f0a46fe74fa30ae3ea35f5a",
"score": "0.580217",
"text": "def timeSpeed (n,a)\n n.times do\n\ta += a\n end\nend",
"title": ""
},
{
"docid": "81c08265c0c7206e4253bb53ae140aba",
"score": "0.57111096",
"text": "def solve( n = 1_000_000 )\n sum = limit = 0\n \n while sum < n\n limit += 1\n limit2 = limit * limit\n \n 2.upto( limit << 1 ) do |bc|\n d = Math.sqrt( limit2 + bc*bc )\n sum += (bc > limit ? 1 + limit - (1 + bc)/2 : bc/2) if d.to_i == d\n end\n end\n\n limit\n end",
"title": ""
},
{
"docid": "2f643ea1655dbfac796dbdba2dc2c050",
"score": "0.56335205",
"text": "def bench_my_algorithm\r\n assert_performance_linear 0.9999 do |n| # n is a range value\r\n n.times do\r\n @obj.my_algorithm\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "e1711a678f3268f230ad85b4b026fcbe",
"score": "0.5526417",
"text": "def expensive_method n\n\t5000.times do \n\t\tn*n\n\tend\nend",
"title": ""
},
{
"docid": "1182dd0594ef4a8eb04bb707a7817594",
"score": "0.5519418",
"text": "def fast_duration\n 0.5\n end",
"title": ""
},
{
"docid": "dcefe2d205934d656ef75ef4734b926a",
"score": "0.54887986",
"text": "def bench_factorial\n assert_performance_linear do |n| # n is a range value\n Math.factorial(n)\n end\n end",
"title": ""
},
{
"docid": "b3929c54bbce28e89dd83fba60f7b4b0",
"score": "0.5373547",
"text": "def build_timing; end",
"title": ""
},
{
"docid": "d348b3849cc199c965307c7062b4db9c",
"score": "0.5371678",
"text": "def beta_nth_prime (n = 1)\n start_time = Time.now.to_f\n if !n.is_a?(Integer) || n < 1\n runtime = Time.now.to_f - start_time\n puts \"there is no #{n}th prime, runtime = #{runtime}s\" \n return runtime\n end\n start_time = Time.now.to_f\n ith_prime = 2\n i = 1\n if i == n \n runtime = Time.now.to_f - start_time\n puts \"the #{n}th prime is #{ith_prime}, runtime = #{runtime}s\" \n return runtime\n end\n ith_prime = 3\n ith_sqirt = 1\n i = 2\n while i < n\n # iter_time = Time.now.to_f\n next_prime = ith_prime + 2\n next_sqirt = beta_floorsqirt(next_prime,ith_sqirt)\n until beta_prime?(next_prime,next_sqirt)\n next_prime += 2 \n next_sqirt = beta_floorsqirt(next_prime,next_sqirt)\n end\n ith_prime = next_prime\n ith_sqirt = next_sqirt\n i += 1\n # if i % 1000 == 0 && i <= n - 1000\n # puts \"#{i}th iteration complete in #{Time.now.to_f - iter_time}\"\n # end\n end\n runtime = Time.now.to_f - start_time\n puts \"the #{n}th prime is #{ith_prime}, runtime = #{runtime}s\" if i == n #should always be true\n return runtime #ith_prime\nend",
"title": ""
},
{
"docid": "2a06bf1799744345acd1be0a4d283103",
"score": "0.5362668",
"text": "def solve( n = 2_000_000 )\n counts = Hash.new( 0 )\n\n # Guesstimate upper limit on grid dimensions. \n (1..100).each do |w|\n (1..100).each do |h|\n counts[[w, h]] = w * (w + 1) * h * (h + 1) >> 2\n end\n end\n\n counts.min_by {|k, v| (n - v).abs}[0].inject( :* )\n end",
"title": ""
},
{
"docid": "65e435dfd7a35c99336872e931b7c3a3",
"score": "0.5360167",
"text": "def solve( n = 1_000_000_000 )\n log10 = Math.log10( n )\n\n sum = (0...log10).map do |i|\n if 0 == (i % 4)\n 0\n elsif 0 != (i % 2)\n 20 * 30**((i - 1)/2)\n else\n 100 * 500**((i - 2)/4)\n end\n end\n\n sum.reduce( :+ )\n end",
"title": ""
},
{
"docid": "d45d411f74262d41ad851457afd5f575",
"score": "0.5343229",
"text": "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend",
"title": ""
},
{
"docid": "03e08b1b2be9f1297b1ec11948e1c7c7",
"score": "0.53428257",
"text": "def main\n\n sum = 0\n\n (0..999).each do |i|\n sum += check(i)\n end\n\n puts \"Total - O(n) #{sum}\"\n\n # Needed to refresh following: https://en.wikipedia.org/wiki/Arithmetic_progression\n sum2 = sum_multiples(3, 1000) + sum_multiples(5, 1000) - sum_multiples(15, 1000)\n\n # Refreshed Big O too : http://stackoverflow.com/questions/487258/plain-english-explanation-of-big-o \n puts \"Total - O(1) #{sum2}\"\n\nend",
"title": ""
},
{
"docid": "3f27cdadbb4e3f57d47c854920d668bc",
"score": "0.5324811",
"text": "def solve( n = 1_000_000_000_000 )\n # From the problem statement, n = dq + r and d = kr, q = kd for some k.\n # (We could set q = kr and d = kq instead, but it doesn't really matter\n # which convention we adopt.) From this we infer r < d < q. We also know\n # k must be rational or d, q wouldn't be integer values, so k = a/b. Then\n # d = ar/b and q = ad/b = (a^2)r/(b^2). Since a and b are coprime (other-\n # wise k could be reduced until they were), b^2 must divide r, which means\n # r = cb^2 for some c.\n #\n # Combining these facts, we have r = (b^2)c, d = ar/b = a(b^2)c/b = abc,\n # and q = (a^2)(b^2)c/(b^2) = (a^2)c. Substituting into n = dq + r we ob-\n # tain n = (abc)(a^2)c + (b^2)c = (a^3)b(c^2) + (b^2)c. The dominant term\n # is a^3, which must be < n, so use it as an outer limit as we search for\n # b, c values that generate perfect squares.\n\n # Create a hash of perfect squares to simplify future checks.\n sq = {}\n (1..Math.sqrt( n )).each {|i| sq[i*i] = i}\n\n # Upper bound on values of a.\n lim = Math.cbrt( n )\n sum = []\n\n (2...lim).each do |a|\n a3 = a*a*a\n (1...a).each do |b|\n m = b*(a3 + b)\n break if m > n\n next unless b.coprime?( a )\n\n c = 1\n while m < n\n sum << m if sq.has_key?( m )\n c += 1\n m = b*c*(a3*c + b)\n end\n end\n end\n\n sum.reduce( :+ )\n end",
"title": ""
},
{
"docid": "b7b674ddf3589873196cccd40498f1ed",
"score": "0.5324151",
"text": "def time_dilation(t0,v,c)\n dilation = t0 / Math.sqrt(1-((v/c)*(v/c)))\n return dilation\nend",
"title": ""
},
{
"docid": "a2dc0796e485e8bb1dec804966d9a947",
"score": "0.5308626",
"text": "def fast_factorial(n)\n ApproxFactorial.stieltjes_factorial(n)\n end",
"title": ""
},
{
"docid": "5895c34d5e8bba717ce9c13f4b502a93",
"score": "0.5282612",
"text": "def methods_time\n Benchmark::Tms.new\n end",
"title": ""
},
{
"docid": "2544a6326644cf128083beb8250902ba",
"score": "0.52537847",
"text": "def calculate_optimal_k\n k=0\n @k_optimal = Array.new(@size)\n (3..@size).each{|n|\n k+=1 while(cost(n,k)<cost(n,k+1))\n @k_optimal[n]=k\n }\n end",
"title": ""
},
{
"docid": "07567c2188da44d34b30774dc61df760",
"score": "0.5249788",
"text": "def measure (n=1)\n cnt=0\nelapsed_time=Time.now\n\nn.times {\n cnt+=1\n yield} \nelapsed_time=(Time.now-elapsed_time)/cnt\n\nend",
"title": ""
},
{
"docid": "f1f39fdf49183ff99d9767390d2dc961",
"score": "0.5217508",
"text": "def time_required\n @time_required ||= distribution.map(&:sum).max\n end",
"title": ""
},
{
"docid": "6d1a226a145dd596425c62092611394d",
"score": "0.5213439",
"text": "def measure(iterations = 1)\n time_elapsed = []\n\n iterations.times do\n @start = Time.now\n yield\n @stop = Time.now\n time_elapsed << (@stop - @start)\n end\n\n # reduce(:+) takes all elements in array, performs an operation, and keeps a running total\n time_elapsed.reduce(:+) / iterations.to_f\nend",
"title": ""
},
{
"docid": "0d7be73b70d10edacebd5a9fabc69ef9",
"score": "0.51890874",
"text": "def n_naught_brute_vs_recursive(a)\n time_brute = Benchmark.realtime { brute_force_maximum_subarray(a) }\n time_recursive = Benchmark.realtime { maximum_subarray(a, 0, a.length - 1) }\n\n while time_brute < time_recursive do\n a << a.sample\n time_brute = Benchmark.realtime { brute_force_maximum_subarray(a) }\n time_recursive = Benchmark.realtime { maximum_subarray(a, 0, a.length - 1) }\n end\n\n result = a.length\nend",
"title": ""
},
{
"docid": "ea09d6a8ab97be9b54110e64142d9959",
"score": "0.51690656",
"text": "def n_constant\n 1.0 / basis_functions.length\n end",
"title": ""
},
{
"docid": "ee949a433d5b1a5996d6e25d61cad81d",
"score": "0.51608056",
"text": "def dp_possible_trees(n)\n array = Array.new(n+2) { Array.new(n+1) { 0 } }\n (0...n+2).to_a.each do |i|\n array[i][0] = 1\n end\n\n sum = 0\n (1...n+1).to_a.each do |i|\n sum = 0\n (1..i).to_a.each do |j|\n array[j][i] = array[n+1][i-j] * array[n+1][j-1]\n sum += array[j][i]\n end\n array[n+1][i] = sum\n end\n array[n+1].last\nend",
"title": ""
},
{
"docid": "aff8160e3a30e6b13bac03dc30ac2238",
"score": "0.51447016",
"text": "def benchmark\n n = 349572681\n oldTime = Time.now\n 50.times do\n n = test(n)\n end\n puts \"1000 Tests took #{Time.now-oldTime}\"\n n = 123456789\n oldTime = Time.now\n 1000.times do\n n = test2(n)\n end\n puts \"1000 Test2s took #{Time.now-oldTime}\"\nend",
"title": ""
},
{
"docid": "02983d03c86b07f9bc219d4b66a6534d",
"score": "0.5143253",
"text": "def benchmark\n start_time = Time.now\n calculation = yield\n end_time = Time.now\n run_time = end_time - start_time\n run_time\nend",
"title": ""
},
{
"docid": "541aada5e94f29081d64ee80353a493e",
"score": "0.5139071",
"text": "def measure(n=0)\n if n == 0\n start = Time.now\n yield\n end_time = Time.now\n total = end_time - start\n else\n start = Time.now\n n.times { yield }\n end_time =Time.now\n total = end_time - start\n avg = total / n\n end\nend",
"title": ""
},
{
"docid": "8ec62b7225f877e82467b338ab53f349",
"score": "0.51239824",
"text": "def compute_need_bits; end",
"title": ""
},
{
"docid": "94224edeb82a3e41a1c61231e182e3b0",
"score": "0.5100893",
"text": "def cstime(*) end",
"title": ""
},
{
"docid": "5ab752c194dc279ef5ce5f0acec11400",
"score": "0.509844",
"text": "def compute_times\n @render_avg = 0.0\n @db_avg = 0.0\n @total_avg = 0.0\n @render_max = 0.0\n @db_max = 0.0\n @total_max = 0.0\n @error_avg = 0.0\n \n @log_entries.each do |la|\n if la.error?\n @error_avg += 1.0\n next\n end\n @render_avg += la.rendering\n @db_avg += la.db\n @total_avg += la.duration\n @render_max = la.rendering if la.rendering > @render_max\n @db_max = la.db if la.db > @db_max\n @total_max = la.duration if la.duration > @total_max\n end\n \n @render_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @db_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @total_avg /= @log_entries.size.to_f - @error_avg + 0.0001\n @error_avg /= @log_entries.size.to_f\n\n # using math.log allows us to smooth out the score between\n # infrequent and very frequent actions. 0.1 is added for a\n # non-0 result\n @render_cost = @render_avg * Math.log(@log_entries.size+0.1)\n @db_cost = @db_avg * Math.log(@log_entries.size+0.1)\n @total_cost = @total_avg * Math.log(@log_entries.size+0.1)\n end",
"title": ""
},
{
"docid": "316eb5edbf5bd1e3496835fc2eb0b299",
"score": "0.50954366",
"text": "def cstime=(*) end",
"title": ""
},
{
"docid": "6a63b32791a8d980b0227c08656d89fb",
"score": "0.509378",
"text": "def timebomb n, m, finis = nil, start = nil\n require \"time\"\n finis = Time.parse(finis || \"#{Time.now.year}-12-31\")\n start = Time.parse(start || \"#{Time.now.year}-01-01\")\n rest = (finis - Time.now)\n full = (finis - start)\n\n [((n - m) * rest / full).to_i + m, m].max\n end",
"title": ""
},
{
"docid": "a1fe43060a4407be5a71bafbaa1e36af",
"score": "0.5081046",
"text": "def solve( n = 10_000 )\n (1..n).select {|i| i.amicable?}.reduce( :+ )\n end",
"title": ""
},
{
"docid": "9206c133fa87a856a8007e500a00cb77",
"score": "0.5070915",
"text": "def main\n # GC::Profiler.enable\n # limit = 10 ** 6\n limit = 5 * (10 ** 7)\n prime_limit = (limit * Math.sqrt(2)).to_i\n prime_cache = Prime::Cache.new(prime_limit)\n primes = prime_cache.primes.select {|prime| prime % 8 == 1 || prime % 8 == 7}\n prime_cache = nil\n prime_length = primes.length\n puts \"Primes cached. Length: #{prime_length}\"\n\n # GC.disable\n sqrts = []\n tick = Time.new\n primes.each_with_index do |prime, prime_index|\n if prime_index % (10 ** 4) == 0\n tock = Time.new\n puts \"#{prime_index}/#{prime_length}\\t#{tock - tick}\"\n tick = tock\n end\n sqrts << modular_sqrt((prime + 1)/2, prime)\n end\n puts \"Square roots cached\"\n # GC.enable\n\n is_prime_per_n = [true] * (limit + 1)\n [0, 1].each do |exception_index|\n is_prime_per_n[exception_index] = false\n end\n\n primes.each_with_index do |prime, prime_index|\n puts \"#{prime_index}/#{prime_length}\" if prime_index % (10 ** 5) == 0\n sqrt1 = sqrts[prime_index]\n\n [sqrt1, prime - sqrt1].each do |sqrt|\n raise \"#{prime}'s sqrt is 0\" if sqrt == 0\n if sqrt == 1\n sqrt += prime\n end\n \n if sqrt <= limit && (2 * sqrt * sqrt - 1 != prime)\n is_prime_per_n[sqrt] = false\n end\n sqrt += prime\n\n while sqrt <= limit\n is_prime_per_n[sqrt] = false\n sqrt += prime\n end\n end\n end\n\n count = 0\n is_prime_per_n.each_with_index do |is_prime, n|\n if is_prime\n count += 1\n end\n end\n\n p count\n # puts GC::Profiler.result\nend",
"title": ""
},
{
"docid": "68f2a66e70624575effddaf65654c1de",
"score": "0.5070814",
"text": "def reciprocal_cycles n\n den = 1\n cache = Array.new\n loop do\n den *= 10\n point = den / n\n next if cache.empty? and point.zero?\n\n den = den % n\n return 0 if den.zero?\n\n break if cache.include? [point, den]\n cache << [point, den]\n end\n cache.map(&:first).size\nend",
"title": ""
},
{
"docid": "003b2454f965b214d21254f38a16e2da",
"score": "0.5066453",
"text": "def solve( n = 1_000, d = 10 )\n m = 10**d\n ((1..n).inject {|s, x| s + x.modular_power( x, m )}.to_s[-d, d]).to_i\n end",
"title": ""
},
{
"docid": "e1340be9eeeac0db5afd208e1e8f6f6f",
"score": "0.5058854",
"text": "def fast_solution(n, m)\n # eaten = c * n / m. Find c that makes (c * n) % m == 0.\n c = 0\n begin\n c += 1\n c = m / n if m == 1000000000\n end until (c * n) % m == 0\n c * n / m\nend",
"title": ""
},
{
"docid": "232e8ca0d378cb2032f5857b13d25224",
"score": "0.50554186",
"text": "def fds(n)\n\n # arr = []\n # (n + 1).times.each{|e| arr << e if e > 0}\n # arr.flat_map.reduce(:*)\n # arr.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n (1..n).to_a.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n\nend",
"title": ""
},
{
"docid": "d4dddb867fd18348853c499a8373f30a",
"score": "0.50470567",
"text": "def complexity_name\n COMPLEXITY[self.complexity_id-1][0]\n end",
"title": ""
},
{
"docid": "bdd5a19756e5b77c377131d39521a57b",
"score": "0.5046446",
"text": "def optimize_every; end",
"title": ""
},
{
"docid": "30ef12c61b98052a8ad2793a77711750",
"score": "0.5039378",
"text": "def solve2( n = 150_000_000 )\n # Brute force.\n sum = 10\n i = 20\n\n while i < n\n if 0 != i % 3\n i2 = i*i\n\n # Must verify that the primes are consecutive (i.e. there aren't any\n # primes hiding between entries).\n if (i2 + 1).miller_rabin? &&\n (i2 + 3).miller_rabin? &&\n (i2 + 7).miller_rabin? &&\n (i2 + 9).miller_rabin? &&\n !(i2 + 11).miller_rabin? &&\n (i2 + 13).miller_rabin? &&\n !(i2 + 17).miller_rabin? &&\n !(i2 + 19).miller_rabin? &&\n !(i2 + 21).miller_rabin? &&\n !(i2 + 23).miller_rabin? &&\n (i2 + 27).miller_rabin?\n \n sum += i\n i += 315410\n end\n end\n\n # From observation that 10 | a_n in similar sequences.\n i += 10\n end\n\n sum\n end",
"title": ""
},
{
"docid": "bf5676a56113c9b5ed2d83854c5bff57",
"score": "0.5034801",
"text": "def slow_solution(a)\n m = 0\n a.size.times do |i|\n a[i] = a[i].abs\n m = [a[i], m].max\n end\n maxsum = a.sum # sum of absolute val of all nums in array\n # maxsum = a.map(&:abs).sum <- Ruby shortcut\n\n # If dp = 1 at an index, it means some combo of elements in a add up to that index\n dp = [0] * (maxsum + 1)\n dp[0] = 1\n\n a.size.times do |j|\n maxsum.downto(0).each do |possible_sum|\n puts \"a[j]: #{a[j]}, possible sum: #{possible_sum}\"\n if (dp[possible_sum] == 1) and (possible_sum + a[j] <= maxsum)\n\n # if possible_sum + new element a[j] is possible sum, dp = 1!\n dp[possible_sum + a[j]] = 1\n puts \"Mark #{possible_sum + a[j]} as possible sum in dp\"\n end\n end\n puts \"row: #{j}, a[j]: #{a[j]}, dp: #{dp}\"\n puts\n end\n\n min_q_minus_p = maxsum\n\n # Divide array a into 2 parts, where P = sum of part 1 and Q = sum of part 2,\n # P + Q = maxsum, and P <= maxsum / 2 <= Q.\n # We want largest possible P to get smallest possible Q-P.\n\n # loop from 0 to maxsum / 2, covering every possible P, Q division\n (maxsum / 2 + 1).times do |possible_half_sum|\n # puts \"possible_half_sum: #{possible_half_sum}\"\n if dp[possible_half_sum] == 1 # means P or Q = possible_half_sum\n q_minus_p = maxsum - 2 * possible_half_sum\n # puts \"Q - P: #{q_minus_p}\"\n min_q_minus_p = [min_q_minus_p, q_minus_p].min\n # puts \"min Q - P: #{min_q_minus_p}\"\n end\n end\n\n min_q_minus_p\nend",
"title": ""
},
{
"docid": "c0059f41628d1f63dfe9da390f17a2c8",
"score": "0.50299704",
"text": "def blocks_time\n Benchmark::Tms.new\n end",
"title": ""
},
{
"docid": "034b369a6a4d2fb7b4420415908d3f71",
"score": "0.5029412",
"text": "def solution(n)\n x = (n**0.5).floor\n (1..x).reduce(0) { |s, i| n % i == 0 ? s += (i * i == n ? 1 : 2) : s }\nend",
"title": ""
},
{
"docid": "71dc132cbcbdea4f825ff78da99ed144",
"score": "0.5025089",
"text": "def omega(k, n)\n Math::E ** Complex(0, 2 * Math::PI * k / n)\nend",
"title": ""
},
{
"docid": "3b346b7c787554dcfde2470df7a10df3",
"score": "0.50168777",
"text": "def queue_time(customers, n)\n if n >= customers.length && !customers.empty?\n customers.max\n elsif customers.empty?\n 0\n else\n time_steps = []\n current_queue = customers[0..(n - 1)]\n addition_to_queue = []\n until current_queue.empty?\n customers.shift(n)\n time_steps << current_queue.min\n min_wait_time = current_queue.min\n current_queue.map! { |item| item - min_wait_time }\n n = current_queue.count(0)\n current_queue.reject! { |x| x == 0 }\n addition_to_queue = customers[0..(n - 1)]\n current_queue += addition_to_queue\n end\n time_steps.sum\n end\n end",
"title": ""
},
{
"docid": "0cff1dae64e2dcab757f53b36335cb0f",
"score": "0.5013463",
"text": "def compute_perf_model(s, d, t)\n a = 6.53\n b = 9.41\n c = 31.71\n\n delta = (c - t) * (c - t) - 4 * b * a * s * d\n delta = 0.0 if delta < 0\n vmc = (-(c - t) - Math.sqrt(delta)) / (2 * b)\n vmc = 1 if vmc <= 0\n vmc.ceil\n end",
"title": ""
},
{
"docid": "f659d02f29005764a9bbb612610e1b85",
"score": "0.50120944",
"text": "def can_factor_optimized?(n)\n ( not is_single_digit_prime?(n) ) && ( can_factor_by_single_digits?(n) || can_factor_by_primes?(n) )\n end",
"title": ""
},
{
"docid": "a787e3964ac4e6b604b948e275439669",
"score": "0.50010866",
"text": "def solve( n = 10_000_000 )\n sum = Array.new( n, 0 )\n limit, scale = 1, Math.log( n, 10 ).round - 1\n\n # Precompute single digits.\n (0...10).each {|i| sum[i] = i*i}\n\n # Use previously computed values to speed calculation.\n scale.times do\n limit *= 10\n (limit...10*limit).each do |i|\n j = i\n while 0 < j\n j, r = j / limit, j % limit\n sum[i] += sum[r]\n end\n end\n end\n\n # Cycle each slot until it reaches a terminal value.\n 1.upto( n - 1 ) do |i|\n until 1 == sum[i] || 89 == sum[i]\n sum[i] = sum[sum[i]]\n end\n end \n\n # Count may be computed directly from total sum.\n (sum.inject( :+ ) - n + 1) / 88\n end",
"title": ""
},
{
"docid": "279e45886b15f0a0f3153440efa3ffa1",
"score": "0.4998694",
"text": "def process n\n i = 1\n while (2**i <= n)\n i += 1\n end\n n == 2**(i-1)\nend",
"title": ""
},
{
"docid": "f0fd7a2ed4c384ff1e9010b2d94ee1a3",
"score": "0.49841982",
"text": "def problem_57a\n root2 = lambda do |depth|\n if depth == 0\n Rational(1,2) \n else\n Rational(1,(root2.call(depth - 1) + 2))\n end\n end\n ret = 0\n 1000.times do |n|\n r = root2.call(n) + 1\n ret += 1 if r.numerator.to_s.length > r.denominator.to_s.length\n end\n ret\nend",
"title": ""
},
{
"docid": "8bca2b88d26b6a0348888946f3a1fb0a",
"score": "0.4982233",
"text": "def perfect_power(n)\n\nend",
"title": ""
},
{
"docid": "0a9f488c42eae3cd8bb21ce0f331880a",
"score": "0.49819404",
"text": "def measure_overhead\n t=Benchmark::Tms.new\n cnt=0\n rep=0\n runs=OVERHEAD_CALC_RUNS\n while t.total<OVERHEAD_CALC_MIN_TIME && rep<OVERHEAD_CALC_MAX_REPETITIONS\n t+=Benchmark.measure do\n runs.times {measure(:a) {}}\n end\n rep += 1 # Count the repetitions\n cnt += runs # Count the total runs\n runs *= 2 # Increases the number of runs to quickly adapt to the speed of the machine\n end\n {:time=>t,:count=>cnt}\n end",
"title": ""
},
{
"docid": "6807ceb1b1201e02df21373c06a04ef3",
"score": "0.4969554",
"text": "def optimized_interval(start_time, end_time, skip_optimization = false)\n res_interval = interval\n return res_interval if skip_optimization\n timespan = end_time - start_time\n while timespan / res_interval > MAX_TIMESPAN_POINTS - 1\n res_interval *= 2\n end\n res_interval\n end",
"title": ""
},
{
"docid": "afad9d9848665f2f25c3f7ded8e044e7",
"score": "0.4966387",
"text": "def condition(i, j)\n # first solved the two equations for just i and j\n 500_000 - 1000*i - 1000*j + i*j == 0\nend",
"title": ""
},
{
"docid": "285a0a3355d1566128ae157ca27cfd6f",
"score": "0.49575132",
"text": "def euler028 n\n (4*n**3 + 3*n**2 + 8*n - 9) / 6\nend",
"title": ""
},
{
"docid": "b8bc5fce79a8f5203446d91f243f6392",
"score": "0.49534056",
"text": "def combinatory(n,i)\n t = 1.0\n 1.upto(i) do |j|\n t = t* (n-j+1) / j\n end\n return t\nend",
"title": ""
},
{
"docid": "2eaaa5a9ced6fc47a5a9dd7536dead9e",
"score": "0.49514222",
"text": "def complexity_level_number\n ComplexityLevelHelper::COMPLEXITIES.fetch(complexity_level)\n end",
"title": ""
},
{
"docid": "b27c38fcc98e2d2b145a7419f016f284",
"score": "0.4951161",
"text": "def bench type\n t1 = Time.now\n yield\n t2 = Time.now\n p \"#{type} used #{t2 - t1} seconds\"\nend",
"title": ""
},
{
"docid": "a8ff575e7eab56874936ad3fb7c034e6",
"score": "0.49488232",
"text": "def problem_80(size = 100)\n total = 0\n (2..100).each do |n|\n n,d = n.sqrt_frac(2*size)\n next unless n\n r = n * (10 ** (size * 1.1).to_i) / d\n r = r.to_s[0,size].split(//).map(&:to_i).reduce(&:+)\n total += r\n# puts r.inspect\n end\n total\nend",
"title": ""
},
{
"docid": "a4d9081ef499c3b016fc782dd2b42b5f",
"score": "0.494848",
"text": "def time(times = 1)\n require 'benchmark'\n ret = nil\n Benchmark.bm { |x| x.report { times.times { ret = yield } } }\n ret\nend",
"title": ""
},
{
"docid": "40f4ef8cc45a33b70ae229a3986fe6b9",
"score": "0.49381146",
"text": "def solve(n, m)\n m -= 1\n fac(n+m)/(fac(m)*fac(n)) % 1000000007\nend",
"title": ""
},
{
"docid": "25a13dc750508987d1b6eb04c6f3e362",
"score": "0.4931328",
"text": "def time_limit\n [2, problem.time_limit].min\n end",
"title": ""
},
{
"docid": "bf27c319e5040f44347db9df28ba2b4d",
"score": "0.49247533",
"text": "def test_runtime(size,bound,iterations)\n\n # table header\n puts(\" Arraygröße | ins_sort! | max_sort! | min_sort! \");\n puts(\"------------------------------------------------\");\n\n # measure runtime for the three sorting algorithms\n for i in 0..iterations-1 do\n\n array_size = (2**i) * size;\n # generate random array\n test_array = random_array(array_size,bound);\n # since all sorting functions are mutable\n # functions, we have to copy the generated\n # array in order to use the same array_size\n # for all sorting functions; otherwise\n # the second sorting function will work\n # on an already sorted array.\n\n # measure runtime for `ins_sort!`\n ins_sort_array = test_array.clone;\n ins_sort_time = Time.now;\n ins_sort!(test_array);\n ins_sort_time = Time.now - ins_sort_time;\n\n # measure runtime for `max_sort!`\n max_sort_array = test_array.clone;\n max_sort_time = Time.now;\n max_sort!(test_array);\n max_sort_time = Time.now - max_sort_time;\n\n # measure runtime for `min_sort!`\n min_sort_array = test_array.clone;\n min_sort_time = Time.now;\n min_sort!(test_array);\n min_sort_time = Time.now - min_sort_time;\n\n # pretty print table output\n tab1 = \" \" * 3;\n tab2 = \" \" * 4;\n print(tab1);\n print_array_size(array_size);\n print(tab2);\n print_float(ins_sort_time);\n print(tab2);\n print_float(max_sort_time);\n print(tab2);\n print_float(min_sort_time);\n print(\"\\n\");\n end;\nend",
"title": ""
},
{
"docid": "00869fa8636bd0521b83b45ee0d6a597",
"score": "0.49154174",
"text": "def sim_program(n)\n (1..n).reduce(0) do |acc, i|\n (n % i).zero? ? acc + i : acc\n end\n end",
"title": ""
},
{
"docid": "500edb8b87052ccb888165ac1d221113",
"score": "0.49129367",
"text": "def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend",
"title": ""
},
{
"docid": "9504849a215dc694b8e78abdb0e25b8d",
"score": "0.491263",
"text": "def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend",
"title": ""
},
{
"docid": "61cfdc3647f43f1c505f522e570dbf15",
"score": "0.49063814",
"text": "def solution(n)\n # write your code in Ruby 2.2\n a = Math.sqrt(n).floor\n a -= 1 while n % a != 0\n b = n / a\n (a + b) * 2\nend",
"title": ""
},
{
"docid": "95fd25155831f3d8765bcd48a57e852c",
"score": "0.48926342",
"text": "def complexity_level_number\n COMPLEXITIES.fetch(complexity_level)\n end",
"title": ""
},
{
"docid": "421ad335e7bf4db6b5282133a19bbb64",
"score": "0.48834476",
"text": "def largest_contiguous_subsum1(list)\n p Time.now\n sub_arrays = []\n list.each_index do |i|\n list.each_index do |j|\n next if j < i\n sub_arrays << list[i..j]\n end\n end\n sub_arrays.map{|numbers| numbers.inject(:+)}.max\n p Time.now\nend",
"title": ""
},
{
"docid": "e8d6f9094e2e89e8b3acc296069a3ff2",
"score": "0.48792604",
"text": "def q(n)\n if n == 1\n return 1\n else q(n-1) + (n*n*n)\n end\nend",
"title": ""
},
{
"docid": "e62d5f95a0f62e3c1a5380214ebada63",
"score": "0.48786393",
"text": "def run\n puts sum_of_primes_below(10)\n #=> 17\n\n puts sum_of_primes_below(2_000_000)\n #=> ??\nend",
"title": ""
},
{
"docid": "c4c1485930467489171d9dfd0d9afb82",
"score": "0.4875255",
"text": "def measure_execution_time(data = nil, repeat: 1, &work)\n inputs = data || range(1, 10_000)\n times = []\n\n inputs.each_with_index do |input, i|\n GC.start\n measurements = []\n\n repeat.times do\n measurements << Clock.measure { work.(input, i) }\n end\n\n times << measurements.reduce(&:+).to_f / measurements.size\n end\n [inputs, times]\n end",
"title": ""
},
{
"docid": "9b7b560a746197f077379c1032b528ba",
"score": "0.4865434",
"text": "def stepPerms(n)\n # dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]\n \n dp = Array.new(n + 1, 0)\n dp[0] = 1 # when number of steps are 0 there is only 1 way\n \n (1..n).each do |i|\n dp[i] += dp[i - 1] if i - 1 >= 0\n dp[i] += dp[i - 2] if i - 2 >= 0\n dp[i] += dp[i - 3] if i - 3 >= 0\n end\n\n dp[n]\nend",
"title": ""
},
{
"docid": "e163ec9ef691b59a06097f56cc0418cd",
"score": "0.48638263",
"text": "def problem_80b(size = 100)\n total = 0\n (2..100).each do |n|\n r = n.sqrt_digits(size+1)\n next if r.length == 1\n r = r[0,size].reduce(&:+)\n total += r\n# puts \"#{n} #{r.inspect}\"\n end\n total\nend",
"title": ""
},
{
"docid": "ab6a865a222f3426e750a131aa427943",
"score": "0.48577547",
"text": "def time_duration(mytime, start_time, end_time)\n # implement this\n return 9999999\n end",
"title": ""
},
{
"docid": "39e19cc2276aefbe4155f439e8f977a9",
"score": "0.48521137",
"text": "def fast_calc(n)\n\tr = n.to_s.reverse\n\ta = []\n\t[1] if n == 1\n\tr.length.times{|i|\n\t\tpower = 10**i\n\t\tleft = r[i + 1,r.length - i].reverse.to_i\n\t\tright = r[0,i].reverse.to_i\n\t\tcol = r[i,1].to_i\n\t\tcalc = left * power + (col > 1 ? power : (col == 1 ? power/10 * right + 1 : 0))\n\t\tputs \"#{n}[#{i}] power: #{power} col: #{col} left: #{left} right: #{right} calc: #{calc}\"\n\t\ta << calc\n\t}\n\ta.reverse\nend",
"title": ""
},
{
"docid": "9102d506bbcd091f311613792f64bd9f",
"score": "0.48495924",
"text": "def calculate_allowable_difference(n)\n # Todo: Does this give a decent behavior, or is there an intelligent\n # refinement to make here?\n Math.sqrt( (n / (Math.log(n) ** 2)) ).to_i\n end",
"title": ""
},
{
"docid": "52f9c6181c5686bfe8b12805dfdd5be0",
"score": "0.4847446",
"text": "def test_raw_performance\n assert_nothing_raised do\n # 20 seconds would seem to be far more than is necessary for this...\n Timeout::timeout(20) {CS::matrix_fibonacci(10000)}\n end\n end",
"title": ""
},
{
"docid": "9488d20a0fa962d389fc6194c27b1e42",
"score": "0.48387423",
"text": "def gf2_element_times(a, b)\n if (a == 0 || b == 0)\n return 0\n else\n logA = LOG_TABLE[a & 0xFF]\n logB = LOG_TABLE[b & 0xFF]\n logResult = logA + logB\n return EXP_TABLE[logResult]\n end\nend",
"title": ""
},
{
"docid": "cdefd70a1faef1d93615d89e8b40a7b1",
"score": "0.4830877",
"text": "def s1(n)\n (n*(n+1)/2)**2\nend",
"title": ""
},
{
"docid": "4a920e174b4e5cf5bcca16abae57a74d",
"score": "0.48294064",
"text": "def solve( n = 100_000_000 )\n # Assuming the largest valid sum of squares is S = a^2 + (a - 1)^2 < n,\n # first find a and set aside space to cache that many running sums.\n len = (1 + Math.sqrt( 2*n )) / 2\n sos = Array.new( len )\n\n seen = []\n sos[0] = 1\n\n (1...len).each do |i|\n # Precompute the ∑ i^2 for all i <= a. \n ds = i*i + 2*i + 1\n sos[i] = sos[i - 1] + ds\n\n seen << sos[i] if sos[i].palindrome?\n\n # Most of the sum of square values will exceed n, so subtract lower sums\n # to check shorter runs.\n (i - 2).downto( 0 ) do |j|\n diff = sos[i] - sos[j]\n break unless diff < n\n\n # Update our total if the shorter run a[j] + a[j + 1] + ... + a[i] is\n # a palindrome.\n seen << diff if diff.palindrome?\n end\n end\n\n seen.uniq.reduce( :+ )\n end",
"title": ""
},
{
"docid": "bf206da72bb9b46ff5dc5fea9f9aefa7",
"score": "0.48276967",
"text": "def benchmark\n start_time = Time.now\n yield\n end_time = Time.now\n running_time = end_time - start_time\nend",
"title": ""
},
{
"docid": "31785ea2f3203427a2514d2e6bd1268d",
"score": "0.48259443",
"text": "def factorialize(n)\n return 0 if n.zero?\n\n number_array = []\n\n n.times do |number|\n number_array << number + 1\n end\n\n number_array.reduce(:*)\nend",
"title": ""
},
{
"docid": "d83de2e148614a079fea4d1b4d3e85ce",
"score": "0.48177633",
"text": "def mystery(n)\n 0\nend",
"title": ""
},
{
"docid": "69c6ef3653edfb987a007b541ae7f530",
"score": "0.48130706",
"text": "def run(size)\n t = Time.now\n\n puts \"P4\\n#{size} #{size}\"\n\n byte_acc = 0\n bit_num = 0\n\n y = 0\n while y < size\n ci = (2.0*y/size)-1.0\n\n x = 0\n while x < size\n zrzr = zr = 0.0\n zizi = zi = 0.0\n cr = (2.0*x/size)-1.5\n escape = 0b1\n\n z = 0\n while z < 50\n tr = zrzr - zizi + cr\n ti = 2.0*zr*zi + ci\n zr = tr\n zi = ti\n # preserve recalculation\n zrzr = zr*zr\n zizi = zi*zi\n if zrzr+zizi > 4.0\n escape = 0b0\n break\n end\n z += 1\n end\n\n byte_acc = (byte_acc << 1) | escape\n bit_num += 1\n\n # Code is very similar for these cases, but using separate blocks\n # ensures we skip the shifting when it's unnecessary, which is most cases.\n if (bit_num == 8)\n print byte_acc.chr\n byte_acc = 0\n bit_num = 0\n elsif (x == size - 1)\n byte_acc <<= (8 - bit_num)\n print byte_acc.chr\n byte_acc = 0\n bit_num = 0\n end\n x += 1\n end\n y += 1\n end\n\n STDERR.puts(\"time(#{Time.now - t})\")\nend",
"title": ""
},
{
"docid": "30f089b3cb8b3758d771fd26c51d3595",
"score": "0.48123622",
"text": "def total_time=(_arg0); end",
"title": ""
},
{
"docid": "434aa1c4ef5c60ed6420e412f1810001",
"score": "0.48095518",
"text": "def stair_climb(n)\n end",
"title": ""
},
{
"docid": "c395a11700c2eaba2b8b1e26137f7f0f",
"score": "0.4807827",
"text": "def total (n=64)\n (2**n)-1\n end",
"title": ""
},
{
"docid": "f7f557f4d1b7196cbd56ef1cc018c222",
"score": "0.48061255",
"text": "def queue_time(customers, n)\n # n個の要素をもつ配列を作成する\n arr = Array.new(n, 0)\n # 配列の要素で最小の所にcustomerを入れていき、customersを全て格納した配列を作成する。\n # arr.index(arr.min)で配列内で最小の要素のインデックスを取得する\n customers.each do |customer|\n arr[arr.index(arr.min)] += customer \n end\n # 作成した配列の最大値(最大作業時間)を取得する\n arr.max\nend",
"title": ""
},
{
"docid": "3a9f1b2cfef63078b14d44b8ccfa43c0",
"score": "0.48061195",
"text": "def recessive k, m, n\n all = k + m + n\n mix = m + n\n total = 4.0 * triangle(all) # 2 * squareish all = 2 * 2 * triangle all\n\n lhs = triangle n\n mid = n * mix - n\n rhs = triangle mix\n\n 1 - (lhs+mid+rhs) / total\n end",
"title": ""
},
{
"docid": "f347717a52490b428e11add15eaa0ca4",
"score": "0.4801643",
"text": "def solution_slow_2(n, p, q)\n sieve = sieve_of_erathosteneses(n)\n # puts \"sieve:#{sieve}\"\n semi = semiprimes(n, sieve)\n # puts \"sp:#{semi}\"\n prefix = [0,0,0,0,1]\n 5.upto(n) do |x|\n if semi.include? x \n prefix << prefix.last + 1\n else\n prefix << prefix.last\n end\n end\n # puts \"prefix:#{prefix}\"\n\n queries = [p,q].transpose\n\n\n res = queries.map do |query|\n prefix[query.last] - prefix[query.first - 1]\n end\n\n # puts \"res:#{res}\"\n\n res\n end",
"title": ""
},
{
"docid": "b35e201763c9e3a474f00f1e31d594e6",
"score": "0.48000842",
"text": "def factTypical (n)\n\tif n == 0\n\t\treturn 1\n\telse\n\t\treturn n * factTypical(n-1)\n\tend\nend",
"title": ""
},
{
"docid": "82299bcf683c5d2a6c5be9329bedc708",
"score": "0.47985637",
"text": "def calculate_duration_of(task) ; 5 ; end",
"title": ""
},
{
"docid": "1079e4b857a157d229f3dc8f9bc35957",
"score": "0.47984293",
"text": "def cycles_per_100ms(iterations, elapsed_time)\n cycles = (iterations * (MICROSECONDS_PER_100MS / elapsed_time)).to_i\n cycles <= 0 ? 1 : cycles\n end",
"title": ""
},
{
"docid": "105475aa606d14347b26f3315af5aaec",
"score": "0.4797771",
"text": "def calc_iterations\n 2 * (2**(@premises.length - 1))\n end",
"title": ""
},
{
"docid": "44328c33e96907fb6ee3e31d56faf1b8",
"score": "0.47940537",
"text": "def sptriplet(n)\n divisors_of_500 = []\n1.upto(500) {|n| divisors_of_500 << n if 500 % n == 0}\ndivisors_of_500.inspect\n\n solutions = []\n for x in divisors_of_500\n for z in divisors_of_500\n if (x < z && z < 2*x) && n%(x*z) == 0\n y = z - x\n k = ((n/2) / x) / z\n\n a = k*(x*x-y*y)\n b = 2*k*x*y\n c = k*(x*x+y*y)\n\n solutions << [a,b,c]\n end\n end\n end\n\n product = 1\n solutions.map! {|arr| arr.sort}\n solutions.uniq!\n solutions[0].each {|num|product *= num}\n product\n\nend",
"title": ""
},
{
"docid": "d8ec01d41d8bc1303844934cc6ba4f62",
"score": "0.47920483",
"text": "def solution_1\n starting_time = Time.now\n\n total = 0\n\n all_primes(MAX_NUM).each { |prime| total += prime }\n\n p \"Sum of first #{MAX_NUM} primes: #{total}\"\n p \"In #{Time.now - starting_time} seconds\"\nend",
"title": ""
},
{
"docid": "01a2f946dad61262a008cf3ac201cf64",
"score": "0.4791111",
"text": "def litres(time)\n (time / 2).to_i\nend",
"title": ""
},
{
"docid": "5fcf4d85c57670a37f9ea18b5ba654a1",
"score": "0.47835746",
"text": "def time_passes(big_N, genome_size, gens, mutation_rate, mutations_to_track, prng, selection_coefficient)\n\t\tclasses = Array.new(genome_size) {0}\n\t\tclasses[0] = big_N\n\t\tratchet = Array.new(mutations_to_track) {0}\n\t\tmin = 0\n\t\tfitnesses = fitness_calc(genome_size, selection_coefficient)\n\t\tmut_probs = mut_probs_calc(genome_size, mutation_rate)\n\t\t(0...gens).each do |i|\n\t\t\tt = find_t(classes, fitnesses)\n\t\t\tbreak if (t < 1)\n\t\t\tclasses = mutate(big_N, classes, fitnesses, genome_size, mut_probs, prng, t)\n\t\t\tnew_min = classes.index{|m| !(m == 0)}\n\t\t\tputs \"#{@timer}\\ti #{i} \\tnew_min #{new_min}\" if @iteration \n\t\t\tif (new_min and new_min > min)\n\t\t\t\t((min)..(new_min)).each {|j| ratchet[j] = i}\n\t\t\t\tmin = new_min\n\t\t\tend\n\t\t\tbreak if (new_min and new_min > mutations_to_track)\n\t\tend\n\t\[email protected] \"\\n #{@ratchet} \\n\"\n\t\t@timer += 1\n\t\tratchet\n\tend",
"title": ""
}
] |
4b31d1df48097ff63e39dbaa0ededdf3
|
Returns the righthand sibling
|
[
{
"docid": "b6af940827dd7f75031bf6d34c892323",
"score": "0.0",
"text": "def right\n nested_set.first :conditions => { :lft => rgt + 1 }\n end",
"title": ""
}
] |
[
{
"docid": "f42ed38b8631d640badcf2b13aca83a9",
"score": "0.7921706",
"text": "def next_sibling()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f42ed38b8631d640badcf2b13aca83a9",
"score": "0.7921706",
"text": "def next_sibling()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b4d7e4c84cef767f8c5649aa01098da6",
"score": "0.78951925",
"text": "def sibling\n '/following-sibling::*[1]/self::'\n end",
"title": ""
},
{
"docid": "fdf82482d3557c878469f35a92a60ebc",
"score": "0.783971",
"text": "def next_sibling_node\n next_sibling\n end",
"title": ""
},
{
"docid": "6d2432f83329767e791ae38f66ec7a8c",
"score": "0.78274006",
"text": "def sibling\n fetch('relationship.sibling')\n end",
"title": ""
},
{
"docid": "ff0aea8321ba5d3e3aa791ca61540ecc",
"score": "0.78183126",
"text": "def siblingReal\r\n @parent.children.each do |child|\r\n \tif self != child\r\n \t\treturn child\r\n \tend\r\n end\r\n return self\r\n end",
"title": ""
},
{
"docid": "b57a379b62013d7afc693e8735fce87f",
"score": "0.7673537",
"text": "def next_sibling\n parent(false).mediant(self)\n end",
"title": ""
},
{
"docid": "05cf9972004c62265110066988f3dd83",
"score": "0.7639779",
"text": "def lowest_sibling\n self.siblings_and_self.last\n end",
"title": ""
},
{
"docid": "a59b17e3f276f9f1fd6f620c2de7eaa9",
"score": "0.7636635",
"text": "def get_sibling\n return nil if self.is_root?\n @parent.children.each {|child| return child unless (child == self) }\n end",
"title": ""
},
{
"docid": "70ee53d6e29ad378a90a761807a6bd85",
"score": "0.76019377",
"text": "def right_sibling; end",
"title": ""
},
{
"docid": "70ee53d6e29ad378a90a761807a6bd85",
"score": "0.76019377",
"text": "def right_sibling; end",
"title": ""
},
{
"docid": "85a253e45012dd07dd4a86246e5354b4",
"score": "0.7599993",
"text": "def right_sibling\n siblings.right_of(left).first\n end",
"title": ""
},
{
"docid": "2410bededb357b23cf8afc3c03ee8826",
"score": "0.7568911",
"text": "def next_sibling\n get_class.first(scope_and_parent_hash.merge(:lft.gt => rgt, :order => [:lft.asc]))\n end",
"title": ""
},
{
"docid": "81ea9538a65f356f0df50696fa3bb962",
"score": "0.7563511",
"text": "def sibling\n self.dup.sibling!\n end",
"title": ""
},
{
"docid": "942a97874c0e657b533f32933d8d903c",
"score": "0.7535205",
"text": "def previous_sibling()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c3bc534c093bd56c73e9dd677f82d120",
"score": "0.7532648",
"text": "def right_sibling\n self_and_siblings.find{|v| v.lft == rgt+1}\n end",
"title": ""
},
{
"docid": "c27c81da62d27b7b0f7747d1d334a9cc",
"score": "0.75252885",
"text": "def sibling_next\n @parent.get(index + 1) unless is_last_sibling?\n end",
"title": ""
},
{
"docid": "c00c7b6cb51fe71522563327a39d9a54",
"score": "0.744432",
"text": "def next_sibling\n return unless siblings.any?\n\n siblings[(siblings.to_a.index(self) + 1)...siblings.length]\n .try(&:first)\n end",
"title": ""
},
{
"docid": "0121f4527a343ccfad71b3a07f4446b3",
"score": "0.7411663",
"text": "def later_sibling\n parent && parent.children[sibling_index + 1]\n end",
"title": ""
},
{
"docid": "b67f84f0b02c3c848b5332571e9085fe",
"score": "0.73987675",
"text": "def left_sibling; end",
"title": ""
},
{
"docid": "b67f84f0b02c3c848b5332571e9085fe",
"score": "0.73987675",
"text": "def left_sibling; end",
"title": ""
},
{
"docid": "ca9e50aa3717a02fbc2a196746c0bd48",
"score": "0.73244166",
"text": "def right_sibling\n next_item\n end",
"title": ""
},
{
"docid": "22344d87d48cceb26515796d46b25077",
"score": "0.72628814",
"text": "def right_sibling\n siblings.where(\"#{q_left} > ?\", left).first\n end",
"title": ""
},
{
"docid": "fe4495bad431dba97f5df060133eee39",
"score": "0.7227966",
"text": "def highest_sibling\n self.siblings_and_self.first\n end",
"title": ""
},
{
"docid": "9bb8bccb98f154ce6904f522d49710cc",
"score": "0.72251636",
"text": "def following_siblings() \n sibs = parent.containers \n si = sibs.index(self) + 1 \n return Elements[*sibs[si...sibs.length]] \n end",
"title": ""
},
{
"docid": "1143939e7da4a51dbfdad51dca14b503",
"score": "0.7182525",
"text": "def right_sibling\n self_and_siblings.where(\"#{q_left} > ?\", right).first\n end",
"title": ""
},
{
"docid": "044ec38b1064c57b2883472fee98c7a6",
"score": "0.71715695",
"text": "def right_siblings; end",
"title": ""
},
{
"docid": "044ec38b1064c57b2883472fee98c7a6",
"score": "0.71715695",
"text": "def right_siblings; end",
"title": ""
},
{
"docid": "ecd54db6d7d4bae7910926b300c25779",
"score": "0.7148958",
"text": "def nextSibling\n return nil if !@parent\n nexts = nil\n @parent.childNodes.reverse.each do |child|\n return nexts if child == self\n nexts = child\n end\n nil\n end",
"title": ""
},
{
"docid": "ecd54db6d7d4bae7910926b300c25779",
"score": "0.7148958",
"text": "def nextSibling\n return nil if !@parent\n nexts = nil\n @parent.childNodes.reverse.each do |child|\n return nexts if child == self\n nexts = child\n end\n nil\n end",
"title": ""
},
{
"docid": "d2b3acfd3fdb658886e30ab8ec8040f8",
"score": "0.71426666",
"text": "def sibling_of?(node); end",
"title": ""
},
{
"docid": "c012c392774a797d9d7aaa900d7a0920",
"score": "0.71247256",
"text": "def next_sibling\n return nil if root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx + 1) if myidx\n end",
"title": ""
},
{
"docid": "c012c392774a797d9d7aaa900d7a0920",
"score": "0.71247256",
"text": "def next_sibling\n return nil if root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx + 1) if myidx\n end",
"title": ""
},
{
"docid": "2db36c2979c3603f3f6df3e4a73d759b",
"score": "0.71181226",
"text": "def sibling_prev\n @parent.get(index - 1) unless is_first_sibling?\n end",
"title": ""
},
{
"docid": "b3853c8a6f6c0e4d1250ae43ee7c141b",
"score": "0.7117206",
"text": "def left_sibling\n self_and_siblings.find{|v| v.rgt == lft-1}\n end",
"title": ""
},
{
"docid": "d5ec87934bc4c5b0da7d7276854c2167",
"score": "0.71164745",
"text": "def next_sibling\r\n find(:xpath, \"following-sibling::*[1]\")\r\n end",
"title": ""
},
{
"docid": "72671fda226775fb75d175d8e458658e",
"score": "0.7112342",
"text": "def left_sibling\n previous_item\n end",
"title": ""
},
{
"docid": "9fade86fdcf26f9c7803190b2f89c3e6",
"score": "0.7073841",
"text": "def left_sibling\n siblings.left_of(left).last\n end",
"title": ""
},
{
"docid": "626fd5cb51e8953828fd13acd931ceca",
"score": "0.7042681",
"text": "def right_sibling\n siblings.where(left_field_name => {\"$gt\" => left}).asc(left_field_name).first\n end",
"title": ""
},
{
"docid": "5ddadb679e74d3299f557856ae62a605",
"score": "0.7034876",
"text": "def next_sibling\n return nil if is_root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx + 1) if myidx\n end",
"title": ""
},
{
"docid": "bbbb50bb2d58be0dacf56ee78c982ca9",
"score": "0.7020385",
"text": "def nextSibling\n if myidx = parent.children.index(self)\n parent.children.at(myidx + 1)\n end\n end",
"title": ""
},
{
"docid": "f1e523397610261cb12d628ae228d8f7",
"score": "0.70051414",
"text": "def first_sibling_in_list\r\n siblings_and_self.first\r\n end",
"title": ""
},
{
"docid": "1d696a19f3d005145d6b873e7670732f",
"score": "0.69936043",
"text": "def next_sibling\n sib = parent.containers\n sib[sib.index(self) + 1] if parent\n end",
"title": ""
},
{
"docid": "fe9b7c692526a8e0f3ddf67b716b2fd0",
"score": "0.699159",
"text": "def nextSibling\r\n if myidx = parent.children.index(self)\r\n parent.children.at(myidx + 1)\r\n end\r\n end",
"title": ""
},
{
"docid": "c46196e1d7eda2c63721a852208ba136",
"score": "0.6974588",
"text": "def siblings\n SiblingsAccessor.new(self)\n end",
"title": ""
},
{
"docid": "3d77b7f37383a116a705ce514b58476a",
"score": "0.69572157",
"text": "def siblings\n end",
"title": ""
},
{
"docid": "3dbf2fa66bc57da77224e87afe5ea7bf",
"score": "0.69444007",
"text": "def previous_sibling\r\n find(:xpath, \"preceding-sibling::*[1]\")\r\n end",
"title": ""
},
{
"docid": "e5feb7f9b3f00e8b5759b9cfeb92e33c",
"score": "0.6937776",
"text": "def prior_sibling\n if parent\n first_child? ? nil : parent.children[sibling_index - 1]\n end\n end",
"title": ""
},
{
"docid": "af1851e6728359a0ff586bea0e97b171",
"score": "0.6928879",
"text": "def previous_sibling\n get_class.first(scope_and_parent_hash.merge(:rgt.lt => lft, :order => [:rgt.desc]))\n end",
"title": ""
},
{
"docid": "194caeb20119d8534f2cfe2848fe7eda",
"score": "0.692522",
"text": "def later_siblings\n parent && siblings[(sibling_index + 1)..]\n end",
"title": ""
},
{
"docid": "2c065f2b4f5a314903b6e54eb56e83af",
"score": "0.69114035",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "b5e9b7460ed5acdff610c34d027fcd80",
"score": "0.69066346",
"text": "def next_sibling\n peers[index_in_peers + 1]\n end",
"title": ""
},
{
"docid": "1f4be341e7563c74c2992101550c8834",
"score": "0.6881059",
"text": "def first_sibling_in_list\n siblings_and_self.first\n end",
"title": ""
},
{
"docid": "8a7684f8fb76893c01de0d18fd253b1a",
"score": "0.6871693",
"text": "def previous_sibling\n return nil if root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx - 1) if myidx && myidx > 0\n end",
"title": ""
},
{
"docid": "8a7684f8fb76893c01de0d18fd253b1a",
"score": "0.6871693",
"text": "def previous_sibling\n return nil if root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx - 1) if myidx && myidx > 0\n end",
"title": ""
},
{
"docid": "d5ab53f5b2c55c29a78002d82cfcc06d",
"score": "0.68677026",
"text": "def sibling= node\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6a239ee4bcd31c7d400df58402abe860",
"score": "0.68548554",
"text": "def nextSibling\n return nil if isRoot?\n if myidx = parent.children.index(self)\n parent.children.at(myidx + 1)\n end\n end",
"title": ""
},
{
"docid": "b4b569641c4832eb4265a0a630896261",
"score": "0.6854048",
"text": "def right_sibling\n return unless parent\n\n parent.children[sibling_index + 1].freeze\n end",
"title": ""
},
{
"docid": "d137e0a9fff47099de6dbbcc263d96e9",
"score": "0.6839423",
"text": "def sibling_index; end",
"title": ""
},
{
"docid": "d137e0a9fff47099de6dbbcc263d96e9",
"score": "0.6839423",
"text": "def sibling_index; end",
"title": ""
},
{
"docid": "e0e632edc6c4518d719e514e523265d1",
"score": "0.68327683",
"text": "def previous_sibling\n return unless siblings.any?\n\n siblings[0...siblings.to_a.index(self)].try(&:last)\n end",
"title": ""
},
{
"docid": "3a7ea37056879b32339ffa2915101267",
"score": "0.6801369",
"text": "def first_sibling\n root? ? self : @_node_parent.children.first\n end",
"title": ""
},
{
"docid": "7885c5e0d65c47def78f0c6083c3086c",
"score": "0.67892444",
"text": "def left_sibling\n siblings.where(\"#{q_left} < ?\", left).last\n end",
"title": ""
},
{
"docid": "cad0a5c6c02dfe11467784fd4ee3cabf",
"score": "0.6782186",
"text": "def sibling_index\n\t\t\tnode_maps = self.survey.node_maps\n\n\t\t\tif node_map = node_maps.select { |i| i.node == self }.first\n\t\t\t\tparent = node_map.parent\n\n\t\t\t\tchildren = node_maps.select { |i| i.parent && i.parent.node === parent.node }\n\n\t\t\t\tchildren.each_with_index { |nm, i|\n\t\t\t\t\tif nm == node_map\n\t\t\t\t\t\treturn i\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "dea1e7ae35d68894d2b9a8c297efae83",
"score": "0.6774968",
"text": "def preceding_siblings() \n sibs = parent.containers \n si = sibs.index(self) \n return Elements[*sibs[0...si]] \n end",
"title": ""
},
{
"docid": "bdb95e3920f8b190422139d238a77948",
"score": "0.6774955",
"text": "def previous_sibling\n sib = parent.containers\n x = sib.index(self) - 1\n sib[x] if sib and x >= 0\n end",
"title": ""
},
{
"docid": "5f9b7ed3f273fad284b2920d6dd6afc7",
"score": "0.67673534",
"text": "def siblings\n return [] if next_sibling.nil?\n [next_sibling] + next_sibling.siblings\n end",
"title": ""
},
{
"docid": "6849d7a0a5607390f032d95f7294ed54",
"score": "0.6766356",
"text": "def previous_sibling(child)\n index = @children.index(child)\n if index and index > 0\n @children[index - 1]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "8eb98f73f2303c83c3d1d6281d5f9253",
"score": "0.6760547",
"text": "def left_sibling\n siblings.where(left_field_name => {\"$lt\" => left}).remove_order_by.desc(left_field_name).first\n end",
"title": ""
},
{
"docid": "963f0e1a267b2c5c1c45e2fdbb28e85b",
"score": "0.675771",
"text": "def left_sibling\n self_and_siblings.where(\"#{q_right} < ?\", left).last\n end",
"title": ""
},
{
"docid": "789f04f3736a08498642b6299e4116d3",
"score": "0.6744091",
"text": "def get_siblings(sibling_xpath)\n element.find_elements(xpath:\"*//following-sibling::#{sibling_xpath}\")\n end",
"title": ""
},
{
"docid": "aefefc2e490c0659c41760f6bfc4e8eb",
"score": "0.67366123",
"text": "def right_sibling\n siblings.where(\"#{self.class.quoted_table_name}.#{connection.quote_column_name(Taxonomy.nested_set_options[:left_column])} > ?\", left).first\n end",
"title": ""
},
{
"docid": "3b79211bab3c903a00e93d46f8049116",
"score": "0.67214507",
"text": "def siblings\n without_self self_and_siblings\n end",
"title": ""
},
{
"docid": "7521218f71fa308be9dcf5a0902aa27c",
"score": "0.6714747",
"text": "def following_sibling(opt={})\n sibling = element.following_sibling(opt)\n druid_wrapper(sibling)\n end",
"title": ""
},
{
"docid": "d903c963e4002aab363e0179aeef7d37",
"score": "0.6701141",
"text": "def previous_sibling\n return nil if is_root?\n\n myidx = parent.children.index(self)\n parent.children.at(myidx - 1) if myidx && myidx > 0\n end",
"title": ""
},
{
"docid": "708a27a32a744094fa166e91e7afb4f4",
"score": "0.67001194",
"text": "def right_sibling\n if self[acts_as_nested_set_options[:parent_column]].nil? || self[acts_as_nested_set_options[:parent_column]].zero?\n nil\n else\n self.class.find(:first, :conditions => \"#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]} AND #{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} = #{self[acts_as_nested_set_options[:parent_column]]}\", :order => \"#{acts_as_nested_set_options[:left_column]}\")\n end\n end",
"title": ""
},
{
"docid": "dfe89069a781200ca4d5b07dbd0cbf5e",
"score": "0.6697113",
"text": "def siblings\n self.robject.siblings\n end",
"title": ""
},
{
"docid": "9736f4994ca405a1c06fd71543d69d4e",
"score": "0.6697033",
"text": "def next_sibling\n walker = System::Windows::Automation::TreeWalker.ControlViewWalker\n potential_next_sibling = walker.get_next_sibling(@automation_element)\n potential_next_sibling.nil? ? nil : Bewildr::Element.new(potential_next_sibling)\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "ca69ee57ffb488df22d476f719fbba48",
"score": "0.669209",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "b6b950ad68a75f746366824e9262e1e2",
"score": "0.6686452",
"text": "def left_siblings; end",
"title": ""
},
{
"docid": "b6b950ad68a75f746366824e9262e1e2",
"score": "0.6686452",
"text": "def left_siblings; end",
"title": ""
},
{
"docid": "b1e7b40a59cdc9e2bd03ce054de6f560",
"score": "0.66786164",
"text": "def nextSibling\n parent.childNodes[parent.childNodes.index(self) + 1] if parent\n end",
"title": ""
},
{
"docid": "2810a18520e20ab668f05648b76b8c5d",
"score": "0.66708404",
"text": "def siblings\n without_self self_and_siblings\n end",
"title": ""
},
{
"docid": "2810a18520e20ab668f05648b76b8c5d",
"score": "0.66708404",
"text": "def siblings\n without_self self_and_siblings\n end",
"title": ""
},
{
"docid": "0ec18b885454266bae51cf06c3762225",
"score": "0.66704637",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "0ec18b885454266bae51cf06c3762225",
"score": "0.66704637",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "0ec18b885454266bae51cf06c3762225",
"score": "0.66704637",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "0ec18b885454266bae51cf06c3762225",
"score": "0.66704637",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "0ec18b885454266bae51cf06c3762225",
"score": "0.66704637",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
},
{
"docid": "a70cd3c74b3d37582aeb1d7fd3c0a661",
"score": "0.6659151",
"text": "def last_sibling_in_list\r\n siblings_and_self.last\r\n end",
"title": ""
},
{
"docid": "8191dcf508735ac51ba76c26a0c2ae8d",
"score": "0.6644758",
"text": "def self_and_siblings\n end",
"title": ""
},
{
"docid": "12cf9eead7b62474fb654f50b137abb4",
"score": "0.66369843",
"text": "def is_sibling_of?(node)\n end",
"title": ""
},
{
"docid": "87151b9aae551c2ab5dc09c323080e54",
"score": "0.6631818",
"text": "def _get_sibling # get_sibling object -> (result) ?(label)\r\n obj_id = @operands[0]\r\n var = read_byte\r\n\r\n sibling = (zobj obj_id).sibling\r\n store var, sibling\r\n branch sibling != 0\r\n end",
"title": ""
},
{
"docid": "94bf77e2a387aea4489043ce1554067a",
"score": "0.662957",
"text": "def first_sibling\n root? ? self : parent.children.first\n end",
"title": ""
},
{
"docid": "276fbc22afc516760b742aa508264c9e",
"score": "0.66114146",
"text": "def previous_sibling()\n if siblings = parent.children\n siblings.each_with_index do |node, i|\n return siblings[i - 1] if node.equal?(self)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "90c9ff5d000dea215dba61a7166e3d89",
"score": "0.66081345",
"text": "def sibling(index)\n if left.include?(index)\n [:right, right.value]\n else\n right.include?(index) ? [:left, left.value] : EMPTY\n end\n end",
"title": ""
}
] |
e04aeab591d5d9c08b44d85da62dc0a9
|
Why does the following code...
|
[
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.0",
"text": "def execute(block)\n block.call\nend",
"title": ""
}
] |
[
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.6447258",
"text": "def private; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.6268393",
"text": "def probers; end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.6103502",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "0225a9f23a0fa436bcdab339adc872dd",
"score": "0.59942615",
"text": "def same; end",
"title": ""
},
{
"docid": "07684950591166c8d855b94ecc016f0c",
"score": "0.5990208",
"text": "def big_bad; end",
"title": ""
},
{
"docid": "acb84cf7ec5cb9f480913c612a384abb",
"score": "0.5975957",
"text": "def probers=(_arg0); end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5900665",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9513f65717ac53a33a487f6a1033b91d",
"score": "0.5877171",
"text": "def herald; end",
"title": ""
},
{
"docid": "264cacd22ec67ef709fab7ac35bc522c",
"score": "0.58601815",
"text": "def p15\n\t\nend",
"title": ""
},
{
"docid": "4f4133304fd70a9b4897c025a97ead61",
"score": "0.5858543",
"text": "def b; end",
"title": ""
},
{
"docid": "4f4133304fd70a9b4897c025a97ead61",
"score": "0.5858543",
"text": "def b; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.58536506",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "0268cfe9b7be3eb408810cd157c4566b",
"score": "0.58437836",
"text": "def explicit; end",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.5840383",
"text": "def y; end",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.5840383",
"text": "def y; end",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.5840383",
"text": "def y; end",
"title": ""
},
{
"docid": "4d6ea692afdddfd0b653ce63cae72745",
"score": "0.5824231",
"text": "def base=(_arg0); end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5823392",
"text": "def r; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5823392",
"text": "def r; end",
"title": ""
},
{
"docid": "aa42d70a3ce50db7898a79931a25559f",
"score": "0.5822126",
"text": "def origin=(_arg0); end",
"title": ""
},
{
"docid": "4ad19d3270d712a0b1427d62090e5438",
"score": "0.5782707",
"text": "def ibu; end",
"title": ""
},
{
"docid": "9eda565aac32e895c3d1f2eb16e95da8",
"score": "0.57718503",
"text": "def g; end",
"title": ""
},
{
"docid": "9eda565aac32e895c3d1f2eb16e95da8",
"score": "0.57718503",
"text": "def g; end",
"title": ""
},
{
"docid": "4e92bc73e3a3a62167e2eccd3d1b1761",
"score": "0.5770826",
"text": "def sld; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5746912",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5746912",
"text": "def isolated; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.5739156",
"text": "def schubert; end",
"title": ""
},
{
"docid": "10749bf157053d1d293efe8f78ec210b",
"score": "0.5719154",
"text": "def isolated=(_arg0); end",
"title": ""
},
{
"docid": "10749bf157053d1d293efe8f78ec210b",
"score": "0.5719154",
"text": "def isolated=(_arg0); end",
"title": ""
},
{
"docid": "b6c761dcff30de9855f816893326b89c",
"score": "0.57178664",
"text": "def y=(_); end",
"title": ""
},
{
"docid": "b6c761dcff30de9855f816893326b89c",
"score": "0.57178664",
"text": "def y=(_); end",
"title": ""
},
{
"docid": "255b128abb2eb262fd52b20ff68129b9",
"score": "0.5716728",
"text": "def escaper=(_); end",
"title": ""
},
{
"docid": "969cf6f86aae0712d4d9c47c3f342319",
"score": "0.5716335",
"text": "def code_point=(_); end",
"title": ""
},
{
"docid": "a790526dd722ee361b272bb70bacf11e",
"score": "0.5712451",
"text": "def -@; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.5696489",
"text": "def internal; end",
"title": ""
},
{
"docid": "06b284a85c524f4a33b3c8ae0947c53f",
"score": "0.56947845",
"text": "def silly_adjective; end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.56935364",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.56935364",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.56935364",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.56916803",
"text": "def terpene; end",
"title": ""
},
{
"docid": "126c2c552b724e98ef167fa2195be768",
"score": "0.5683349",
"text": "def overload; end",
"title": ""
},
{
"docid": "db32f67faae00a76975ba21cf3267479",
"score": "0.5681189",
"text": "def whiny=(_arg0); end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5662584",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5662584",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5662584",
"text": "def cops; end",
"title": ""
},
{
"docid": "4f0a4656cc8371322fe53a0792e78206",
"score": "0.56531554",
"text": "def offences_by=(_arg0); end",
"title": ""
},
{
"docid": "4f7de53693102b5d442ce9402a1533a9",
"score": "0.56522924",
"text": "def x; 1; end",
"title": ""
},
{
"docid": "20e9f05afb7ae4263f48f886bd6f2419",
"score": "0.5650689",
"text": "def y=(_arg0); end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.56295747",
"text": "def used?; end",
"title": ""
},
{
"docid": "2db49a06e81dc6f129cd052fb30f468d",
"score": "0.562367",
"text": "def intern() end",
"title": ""
},
{
"docid": "b7b0022fe8928c33981b2148469740b3",
"score": "0.56194013",
"text": "def outer; end",
"title": ""
},
{
"docid": "e521c21df6838b17405ee0e38c51c965",
"score": "0.5615599",
"text": "def cop=(_); end",
"title": ""
},
{
"docid": "e521c21df6838b17405ee0e38c51c965",
"score": "0.5615599",
"text": "def cop=(_); end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5599396",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5599396",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5599396",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5599396",
"text": "def specie; end",
"title": ""
},
{
"docid": "f312ff8380843a15eedf626c6645d5a7",
"score": "0.5586957",
"text": "def standalone=(_arg0); end",
"title": ""
},
{
"docid": "4e7f63d2e8327143b97af38c6fce7a24",
"score": "0.55863726",
"text": "def original; end",
"title": ""
},
{
"docid": "b6ea57868f70d34431fd3ddce643afcb",
"score": "0.55852985",
"text": "def hiss; end",
"title": ""
},
{
"docid": "d8216257f367748eea163fc1aa556306",
"score": "0.55722445",
"text": "def bs; end",
"title": ""
},
{
"docid": "95dd6918498422b6f9110e01fea30af9",
"score": "0.55579877",
"text": "def reserved; end",
"title": ""
},
{
"docid": "31b0dd4058f212c218b416e60de97f12",
"score": "0.5555579",
"text": "def reserved=(_arg0); end",
"title": ""
},
{
"docid": "b8903ea470da4aff13d096e26515327b",
"score": "0.5552652",
"text": "def specialty; end",
"title": ""
},
{
"docid": "6c40e7f891dc8aa22bba0831162b0f34",
"score": "0.5549336",
"text": "def strict_variables; end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.55462164",
"text": "def pass; end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.55462164",
"text": "def pass; end",
"title": ""
},
{
"docid": "cf862ee5a12d195b7c191da90773b8cf",
"score": "0.554133",
"text": "def another; return []; end",
"title": ""
},
{
"docid": "f441b8118e227a06e7a1c24b554ba9b4",
"score": "0.55380845",
"text": "def blg; end",
"title": ""
},
{
"docid": "4cb96e7400284847c384525647400eb5",
"score": "0.5536304",
"text": "def arg; end",
"title": ""
},
{
"docid": "3d9abab6384f891b3bc8138a5a311580",
"score": "0.5536161",
"text": "def op; end",
"title": ""
},
{
"docid": "05bcfa3ca95797d2625eeb08d92b5536",
"score": "0.5533944",
"text": "def result=(_); end",
"title": ""
},
{
"docid": "9ceaa5ebf65bc3523528e51bf8458508",
"score": "0.5526984",
"text": "def under_construction\n end",
"title": ""
},
{
"docid": "13dd0c523ffc3de3c969b06673576261",
"score": "0.55240595",
"text": "def *(p0) end",
"title": ""
},
{
"docid": "13dd0c523ffc3de3c969b06673576261",
"score": "0.55240595",
"text": "def *(p0) end",
"title": ""
},
{
"docid": "948e7e3b01c8cbb0d2f746460d221ebe",
"score": "0.55227286",
"text": "def x; end",
"title": ""
},
{
"docid": "948e7e3b01c8cbb0d2f746460d221ebe",
"score": "0.55227286",
"text": "def x; end",
"title": ""
},
{
"docid": "948e7e3b01c8cbb0d2f746460d221ebe",
"score": "0.55227286",
"text": "def x; end",
"title": ""
},
{
"docid": "948e7e3b01c8cbb0d2f746460d221ebe",
"score": "0.55227286",
"text": "def x; end",
"title": ""
},
{
"docid": "948e7e3b01c8cbb0d2f746460d221ebe",
"score": "0.55227286",
"text": "def x; end",
"title": ""
},
{
"docid": "13dd0c523ffc3de3c969b06673576261",
"score": "0.5522527",
"text": "def *(p0) end",
"title": ""
},
{
"docid": "d996063a1bda83fd8644c8cbac831e61",
"score": "0.5516648",
"text": "def rassoc(p0) end",
"title": ""
},
{
"docid": "8fe2ec19f782455c407b6b91ec673be9",
"score": "0.5516371",
"text": "def my955; end",
"title": ""
},
{
"docid": "65868f3890b7055ca6fbf5f330690d03",
"score": "0.55141085",
"text": "def method_731(base); end",
"title": ""
},
{
"docid": "e554c413ad3b5d2229689d5218c3a813",
"score": "0.55092865",
"text": "def awaken!\n\t\traise 'Not implemented'\n\tend",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.55073",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "01aa8a279f8410fe445f4355072d70e1",
"score": "0.5501145",
"text": "def local?; end",
"title": ""
},
{
"docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba",
"score": "0.5496224",
"text": "def trd; end",
"title": ""
},
{
"docid": "d3ab6dd90858f388fb5fce262c1d609d",
"score": "0.54955",
"text": "def sharp; accidental; end",
"title": ""
},
{
"docid": "cf72502a4e2c0f68e18d6476b6e4a919",
"score": "0.54937756",
"text": "def buzzword; end",
"title": ""
},
{
"docid": "cf72502a4e2c0f68e18d6476b6e4a919",
"score": "0.54937756",
"text": "def buzzword; end",
"title": ""
},
{
"docid": "a686c2902f0397781aa1ce9d2887aa42",
"score": "0.54887354",
"text": "def final; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54863375",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54863375",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54863375",
"text": "def loc; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.548386",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "3ce93b57ee4853b3d6d51561b770d0cd",
"score": "0.5481416",
"text": "def strict; end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.5476399",
"text": "def original_result; end",
"title": ""
},
{
"docid": "94587a4109fb8deb4e5c96586098d3a0",
"score": "0.54754263",
"text": "def x=(_arg0); end",
"title": ""
},
{
"docid": "94587a4109fb8deb4e5c96586098d3a0",
"score": "0.54754263",
"text": "def x=(_arg0); end",
"title": ""
},
{
"docid": "94587a4109fb8deb4e5c96586098d3a0",
"score": "0.54754263",
"text": "def x=(_arg0); end",
"title": ""
}
] |
043e78e25082b3e72ab62998d1080fae
|
could be better but this isn't horrible I guess
|
[
{
"docid": "00b02dc988275170d2758d177be79e80",
"score": "0.0",
"text": "def winner(left, right)\n if (WINNERS[left] == right)\n left.to_s.capitalize\n else\n right.to_s.capitalize\n end\n end",
"title": ""
}
] |
[
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6113009",
"text": "def desired; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.6103497",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58880484",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.58515",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.57998264",
"text": "def reaper; end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.57804555",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "bfc59ba4069006df84cd4e7d17c175e6",
"score": "0.57198256",
"text": "def first_fixed; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.568191",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "3caf4c824a6d6a4a5616c13fcab418da",
"score": "0.56322426",
"text": "def applied; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.55967796",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.55967796",
"text": "def used; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5585148",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5585148",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5585148",
"text": "def for; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.55497575",
"text": "def wedding; end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.54646087",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "85870341b530cc54336e2f1f78415cce",
"score": "0.5404145",
"text": "def rest; pos; end",
"title": ""
},
{
"docid": "8d1d77531cce0d12539ad149eebad454",
"score": "0.5399455",
"text": "def sub_from; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.53925806",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.53925806",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.53925806",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.53925806",
"text": "def preparable; end",
"title": ""
},
{
"docid": "5ffd4221c0adbb90a19d26836dc1440b",
"score": "0.53483516",
"text": "def parter; end",
"title": ""
},
{
"docid": "0e51b7bc662b6e57fc8b575fb9fcba40",
"score": "0.5342054",
"text": "def avail_out(*) end",
"title": ""
},
{
"docid": "8672de13a1a44a1af10d30ff911a50ca",
"score": "0.5336761",
"text": "def perp; end",
"title": ""
},
{
"docid": "8672de13a1a44a1af10d30ff911a50ca",
"score": "0.5336761",
"text": "def perp; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.53362095",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.53362095",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.53362095",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.53362095",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.53362095",
"text": "def pos; end",
"title": ""
},
{
"docid": "456acb6fbbfa8d19490feed3f145af4e",
"score": "0.53355044",
"text": "def deco_pos; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.53300375",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.53300375",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.53300375",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.53300375",
"text": "def first; end",
"title": ""
},
{
"docid": "e28593026497a2baf9c546a2da299bf7",
"score": "0.52994895",
"text": "def nonstpreason\nend",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5296539",
"text": "def advanced; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5296539",
"text": "def advanced; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.52887356",
"text": "def parts; end",
"title": ""
},
{
"docid": "b54c36b38e505bddc56a1497afe882f9",
"score": "0.5279243",
"text": "def min_lens; end",
"title": ""
},
{
"docid": "34112de52c0c813ee37be3cb2c235d6a",
"score": "0.527862",
"text": "def apply; end",
"title": ""
},
{
"docid": "34112de52c0c813ee37be3cb2c235d6a",
"score": "0.527862",
"text": "def apply; end",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.5275793",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "c2051d3271d7f70d2790c6e5e6fd2d11",
"score": "0.526215",
"text": "def uncountables; end",
"title": ""
},
{
"docid": "c2051d3271d7f70d2790c6e5e6fd2d11",
"score": "0.526215",
"text": "def uncountables; end",
"title": ""
},
{
"docid": "c2051d3271d7f70d2790c6e5e6fd2d11",
"score": "0.526215",
"text": "def uncountables; end",
"title": ""
},
{
"docid": "26da328e8cf814fdc197fd2d301c3d2b",
"score": "0.5253764",
"text": "def flipx\r\n end",
"title": ""
},
{
"docid": "c02301cc37eb652d9ce8a2f5939c82c4",
"score": "0.5251234",
"text": "def in_tight=(_arg0); end",
"title": ""
},
{
"docid": "153820cc7732d712d37a3bd65b4100c0",
"score": "0.5250471",
"text": "def preliminary_items; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.52499324",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.52499324",
"text": "def operations; end",
"title": ""
},
{
"docid": "b22b55ac75784dc3a9bcb40c0529af5d",
"score": "0.5246865",
"text": "def ss; end",
"title": ""
},
{
"docid": "b22b55ac75784dc3a9bcb40c0529af5d",
"score": "0.5246865",
"text": "def ss; end",
"title": ""
},
{
"docid": "2fbd1141a5d3803251f00ea5c01e38ba",
"score": "0.52435017",
"text": "def extract; end",
"title": ""
},
{
"docid": "2fbd1141a5d3803251f00ea5c01e38ba",
"score": "0.52435017",
"text": "def extract; end",
"title": ""
},
{
"docid": "fa686cdf1942762f7041d1fb7b0aacb0",
"score": "0.5235372",
"text": "def comofunciona\n\t\t\n\tend",
"title": ""
},
{
"docid": "4e3972712201f930425a392caa47fcd3",
"score": "0.5229578",
"text": "def composite?; end",
"title": ""
},
{
"docid": "d56bb8a6a87f6f876bb52ca3625ac3de",
"score": "0.522659",
"text": "def determinant_bareiss; end",
"title": ""
},
{
"docid": "5023dd8bfd6e70f0094ed299604fe8d3",
"score": "0.5222171",
"text": "def havings=(_arg0); end",
"title": ""
},
{
"docid": "5023dd8bfd6e70f0094ed299604fe8d3",
"score": "0.5222171",
"text": "def havings=(_arg0); end",
"title": ""
},
{
"docid": "5023dd8bfd6e70f0094ed299604fe8d3",
"score": "0.5222171",
"text": "def havings=(_arg0); end",
"title": ""
},
{
"docid": "ec78484e7aecbf4570de6a67b0c543d7",
"score": "0.52128345",
"text": "def avail_in(*) end",
"title": ""
},
{
"docid": "c07313e471ab5981041ecc64c80f3f01",
"score": "0.51982915",
"text": "def simplified; end",
"title": ""
},
{
"docid": "995b915898e500cc112b42e009bf205d",
"score": "0.5195422",
"text": "def nwo; end",
"title": ""
},
{
"docid": "995b915898e500cc112b42e009bf205d",
"score": "0.5195422",
"text": "def nwo; end",
"title": ""
},
{
"docid": "792be6eadacebdee265be975baeda2c7",
"score": "0.5187474",
"text": "def function; end",
"title": ""
},
{
"docid": "33132a7eeb29f49226df371b16429bee",
"score": "0.5184362",
"text": "def leftovers; end",
"title": ""
},
{
"docid": "99837c89d79de120580d8c11ec1a227a",
"score": "0.5183142",
"text": "def m214; 14; end",
"title": ""
},
{
"docid": "f2fd6044595f65eae59163cf6626acc4",
"score": "0.5180199",
"text": "def succ()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f2fd6044595f65eae59163cf6626acc4",
"score": "0.5180199",
"text": "def succ()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.51650214",
"text": "def transformations; end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.51650214",
"text": "def transformations; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5158152",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5158152",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5158152",
"text": "def loc; end",
"title": ""
}
] |
5b9841c168efef0a4a3db25e55c644a6
|
Get the root path of the application, optionally passing in additional folders to be joined and expanded e.g. PathUtils.root 'db', 'migrate' => /path/to/loudmouth/db/migrate
|
[
{
"docid": "574715e492d31f3aaf41df2e30169c12",
"score": "0.726847",
"text": "def root *folders\n File.expand_path(File.join(*([app_root, folders].flatten.uniq.tap{|path| path.delete(nil) })))\n end",
"title": ""
}
] |
[
{
"docid": "7ebd4375b07f6b3196d1d87fff6c00f2",
"score": "0.76857024",
"text": "def root_path(*args)\n relative = File.join(*args)\n return relative if relative.expand_path == relative\n root.expand_path / relative\n end",
"title": ""
},
{
"docid": "7ebd4375b07f6b3196d1d87fff6c00f2",
"score": "0.76857024",
"text": "def root_path(*args)\n relative = File.join(*args)\n return relative if relative.expand_path == relative\n root.expand_path / relative\n end",
"title": ""
},
{
"docid": "5f398c533e098e0e5d97283a3305dd79",
"score": "0.7432182",
"text": "def root_path(*args)\n File.join(ROOT_DIR, *args)\nend",
"title": ""
},
{
"docid": "5f398c533e098e0e5d97283a3305dd79",
"score": "0.7432182",
"text": "def root_path(*args)\n File.join(ROOT_DIR, *args)\nend",
"title": ""
},
{
"docid": "e7d8b84ca0821a5b3c69fbf7916efb4a",
"score": "0.7255655",
"text": "def root(*args)\n where = ''\n where = @config.send(\"#{args.shift.to_s}_path\") if args[0].class == Symbol\n path = args\n File.expand_path File.join([@root, where, path].reject { |s| s.empty? })\n end",
"title": ""
},
{
"docid": "3a9e40c7fbb9221242d620883fdd6242",
"score": "0.72261924",
"text": "def get_root\n return File.join('/root/path', SETTINGS[:project])\n end",
"title": ""
},
{
"docid": "01a986e539e2b02444e7fde6db0a9c2f",
"score": "0.72232515",
"text": "def root_path(full = true)\n\n if full\n path = Rails.root.join ProgramsDir\n else\n path = Pathname.new ProgramsDir\n end\n\n path.join self.name\n end",
"title": ""
},
{
"docid": "01c96543a36d66668a2d74037b10264e",
"score": "0.7043502",
"text": "def root_path(path) File.join(root, path) end",
"title": ""
},
{
"docid": "5bb7b2eb7b9f22bc652937a7265e8325",
"score": "0.70278066",
"text": "def root_path(*path)\n File.join(root, *path)\n end",
"title": ""
},
{
"docid": "bae5d98d3fefbceb747a30424fd65c60",
"score": "0.7022872",
"text": "def root(path = nil)\n base = File.expand_path(File.dirname(__FILE__))\n path ? File.join(base, path) : base\n end",
"title": ""
},
{
"docid": "fc8016113cedff578289c574ea023e3b",
"score": "0.6920544",
"text": "def root\n find_single_directory || @app_dir\n end",
"title": ""
},
{
"docid": "a112ad49a535327b6b90a34ac8f2af6d",
"score": "0.68968993",
"text": "def root\n root = ENV['JETS_ROOT'].to_s\n root = '.' if root == ''\n root = \"#{root}/\" unless root.ends_with?('/')\n Pathname.new(root)\n end",
"title": ""
},
{
"docid": "916abcd983d9ad52ba0f41425932436c",
"score": "0.68808925",
"text": "def root_path\n @root_path ||= File.expand_path(File.join('.', '../..'))\n end",
"title": ""
},
{
"docid": "aa99d9c9e3c437c956a2bae3687109f6",
"score": "0.6866535",
"text": "def root_path(*path) File.join(root, *path) end",
"title": ""
},
{
"docid": "d4332647679dd054b7704a8a5f9ca30c",
"score": "0.6861633",
"text": "def root_path(*paths)\n current = File.expand_path(File.dirname(__FILE__)) # current is the target folder\n File.expand_path File.join(current, \"..\", paths)\n end",
"title": ""
},
{
"docid": "af74362659d351e24662931d9cc99c96",
"score": "0.6807409",
"text": "def app_root\n if defined?(Rails)\n ::Rails.root\n else\n Dir.pwd\n end\n end",
"title": ""
},
{
"docid": "e17394821c180b2532365abeb6537e6d",
"score": "0.68015397",
"text": "def relativize_root_path(path)\n path.to_s.sub(/^#{Regexp.escape(@root)}/, '$root')\n end",
"title": ""
},
{
"docid": "51deb3e42a16317b3176578cbfecee85",
"score": "0.6797107",
"text": "def root\n return \".\".expand_path unless app_file?\n return @root if @root\n @guessed_root ||= begin\n dir = app_file.expand_path.dirname\n if dir.basename == \"lib\" and not (dir / \"lib\").directory?\n dir.dirname\n else\n dir\n end\n end\n end",
"title": ""
},
{
"docid": "0ed5742b0948cf02eaf6e28b0fe5cf41",
"score": "0.67685914",
"text": "def combined_app_root(include_gen_root=true)\n local_app_root = File.expand_path('../../../app', __FILE__)\n app_root = [@ctx_app_root ||= @context.app_root]\n app_root << @context.gen_root if include_gen_root\n app_root << local_app_root if local_app_root != @ctx_app_root\n app_root\n end",
"title": ""
},
{
"docid": "ff854d958e4af414ab64b6b5a839050f",
"score": "0.6733224",
"text": "def root_path\n defined?(Rails) && Rails.root ||\n defined?(Sinatra::Application) && Pathname.new(Sinatra::Application.root) ||\n defined?(ROOT_DIR) && Pathname.new(ROOT_DIR)\n end",
"title": ""
},
{
"docid": "6a4214d24df6802b4938979f98f9d8e9",
"score": "0.6719293",
"text": "def root\n File.expand_path(options[:root] || Dir.pwd)\n end",
"title": ""
},
{
"docid": "0eb1e03bde43bef927adf4fd61966bc5",
"score": "0.66733646",
"text": "def install_root\n self.class.install_root.join(name)\n end",
"title": ""
},
{
"docid": "6158c0e6ae055d5cef93928e079eb898",
"score": "0.6666527",
"text": "def root_dir\n is_rails? ? Rails.root.to_s : Dir.pwd.to_s\n end",
"title": ""
},
{
"docid": "35f89c1cc3d88038912f36aceae812de",
"score": "0.6658573",
"text": "def root\n Pathname.new(ENV[\"RAILS_ROOT\"] || Dir.pwd)\n end",
"title": ""
},
{
"docid": "5828a95b3cde462a49e22ac86b468962",
"score": "0.66380215",
"text": "def controll_root\n root = '/'\n if defined?(\"::Rails\")\n if Rails.respond_to?(:root)\n root = ::Rails.root\n end\n end\n root = File.join(root, PATH)\n unless File.exist?(root)\n Dir.mkdir(root)\n end\n Dir.open(root)\n end",
"title": ""
},
{
"docid": "7304413317687997b70bb0e801ed48cd",
"score": "0.66364056",
"text": "def root_path(basename = nil)\n join(root, basename)\n end",
"title": ""
},
{
"docid": "f0b6e8d9d768067fe218e9e2bef082dd",
"score": "0.66334605",
"text": "def root_path\n Pathname.new(File.expand_path(File.join(__dir__, '..', '..')))\nend",
"title": ""
},
{
"docid": "b58b8328ef083a1454c715b127704e30",
"score": "0.662948",
"text": "def root_path\n ENV['TM_PROJECT_DIRECTORY'] || File.join(ENV['TM_DIRECTORY'], \"..\")\n end",
"title": ""
},
{
"docid": "a24a6f3ef356c76f292e9a8853631a43",
"score": "0.66229343",
"text": "def set_root_path!\n raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)\n raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)\n\n @root_path =\n # Pathname is incompatible with Windows, but Windows doesn't have\n # real symlinks so File.expand_path is safe.\n if RUBY_PLATFORM =~ /(:?mswin|mingw)/\n File.expand_path(::APP_ROOT)\n\n # Otherwise use Pathname#realpath which respects symlinks.\n else\n Pathname.new(::APP_ROOT).realpath.to_s\n end\n\n Object.const_set(:RELATIVE_APP_ROOT, ::APP_ROOT.dup) unless defined?(::RELATIVE_APP_ROOT)\n ::APP_ROOT.replace @root_path\n end",
"title": ""
},
{
"docid": "02a44d3314a52fcc13acd23d930e9bb3",
"score": "0.6621532",
"text": "def app_path\n \"#{root}/app\"\n end",
"title": ""
},
{
"docid": "02a44d3314a52fcc13acd23d930e9bb3",
"score": "0.6621532",
"text": "def app_path\n \"#{root}/app\"\n end",
"title": ""
},
{
"docid": "9fa16f1fa0ae9a4929b81492722cdc36",
"score": "0.660661",
"text": "def combined_app_root_glob(include_gen_root=true)\n \"{#{combined_app_root(include_gen_root).join(',')}}\"\n end",
"title": ""
},
{
"docid": "5a7999320a518cdab1a12ecbdbcc10eb",
"score": "0.6592516",
"text": "def root\n File.expand_path(File.dirname(File.dirname(File.dirname(__dir__))))\n end",
"title": ""
},
{
"docid": "775ce0023cc45b741db213c2571cfb38",
"score": "0.6588942",
"text": "def uri_root_path(*paths)\n root_uri = uri_root if self.respond_to?(:uri_root)\n File.join(root_uri || '/', *paths)\n end",
"title": ""
},
{
"docid": "f3724fb996e1123de4549e12abb79479",
"score": "0.65374",
"text": "def uri_root_path(*paths)\n root_uri = self.class.uri_root if self.class.respond_to?(:uri_root)\n File.join(ENV['RACK_BASE_URI'].to_s, root_uri || '/', *paths)\n end",
"title": ""
},
{
"docid": "aac76df45a6e051000c56be09c1355ad",
"score": "0.64938855",
"text": "def root\n Pathname.new(File.dirname(__dir__))\n end",
"title": ""
},
{
"docid": "21fa3c213eecb694d2b169de17edccf6",
"score": "0.6483335",
"text": "def root( *args )\n if self.home =~ /^[a-zA-Z]:/\n self.home.to_s[0..3].fwf_filepath.join( *args )\n else\n \"/\".fwf_filepath.join( *args )\n end\n end",
"title": ""
},
{
"docid": "8289ed8f20b6c83692099bbb1f3e41e7",
"score": "0.647425",
"text": "def app_root_for app, version\n\t\t\t\"#{Nacreon::Config.deploy_root}/#{app.name}/#{version.name}\"\n\t\tend",
"title": ""
},
{
"docid": "6240ae66c72403f2299fd095690b8763",
"score": "0.64730763",
"text": "def root_path\n path = File.join(File.dirname(__FILE__), '../')\n Pathname.new(path).realpath\nend",
"title": ""
},
{
"docid": "34a53444481ae1f4c8123c004f172a5e",
"score": "0.6469741",
"text": "def talia_root(path = '')\n File.join('..', '..', '..', '..', path)\n end",
"title": ""
},
{
"docid": "773d6b7e24cecf39bf2b36ce45d2b3e0",
"score": "0.6464255",
"text": "def root\n Pathname.new File.expand_path('../../', File.dirname(__FILE__))\n end",
"title": ""
},
{
"docid": "26fdd7318768dc6e2513d2e040704850",
"score": "0.64410233",
"text": "def root(config = Pantry.config)\n Pathname.new(config.root_dir)\n end",
"title": ""
},
{
"docid": "da7a055a9e3cfa02c830501ba7bf490d",
"score": "0.6433102",
"text": "def based_on_root(rel_path)\n File.expand_path(File.join(options.root,rel_path))\n end",
"title": ""
},
{
"docid": "b6c8587b2a6a00104527378967623b8f",
"score": "0.64025617",
"text": "def app_path(path)\n File.expand_path(File.join(path), APP_ROOT)\nend",
"title": ""
},
{
"docid": "b7d6583c85a11ca768fe5e27397db2c1",
"score": "0.6399209",
"text": "def rootDir\n if @workflow[:root_dir]\n OpenStudio.toPath(@workflow[:root_dir])\n else\n OpenStudio.toPath(@osw_dir)\n end\n end",
"title": ""
},
{
"docid": "bbe3defa6ef87b4b34a930bcacfcdb78",
"score": "0.6395047",
"text": "def app_path(path)\n File.expand_path(path, Dir.pwd)\n end",
"title": ""
},
{
"docid": "3091c333b009c948ce47a5dd1e9714fe",
"score": "0.6380609",
"text": "def root\n application && application.config.root\n end",
"title": ""
},
{
"docid": "048c2ff2f3cbf61a1e1c3ca3edf3357f",
"score": "0.6351196",
"text": "def root\n @root ||= Pathname.new(\"#{__dir__}/../../../..\").cleanpath\n end",
"title": ""
},
{
"docid": "af4c6e1e412c221d16667a33a36b748e",
"score": "0.63493186",
"text": "def path_to_root\n path_to_script = Pathname.new(File.expand_path $PROGRAM_NAME)\n path_to_parent = path_to_script.parent\n\n if path_to_parent.basename.to_s == 'bin'\n path_to_parent = path_to_parent.parent\n end\n path_to_parent\n end",
"title": ""
},
{
"docid": "031c69933f14a67d7f40fb6d7f4c3647",
"score": "0.632747",
"text": "def root_folder\n load unless loaded?\n @root_folder\n end",
"title": ""
},
{
"docid": "6bbb9d62e88c8acad166ddcc1d3455e5",
"score": "0.6324544",
"text": "def rmce_uploadr_root_path(*args)\n File.join(RMCE_ROOT_DIR, *args)\n end",
"title": ""
},
{
"docid": "2334ea4e97dc436a8f540f356893e7b6",
"score": "0.63034505",
"text": "def rails_root\n @path\n end",
"title": ""
},
{
"docid": "c07ffb155ed85941a5c720fdbb1d90ef",
"score": "0.6289244",
"text": "def root_path\n environment.paths.detect { |path| pathname.to_s[path] }\n end",
"title": ""
},
{
"docid": "79a50d279b063c9bb8a8c294b08eb130",
"score": "0.62750006",
"text": "def root\n self.config[:root] || Dir.pwd rescue Dir.pwd\n end",
"title": ""
},
{
"docid": "c64abbcd6fc1c0b6b9226ba16ab5e114",
"score": "0.62510854",
"text": "def root_path\n @root_path ||= `git rev-parse --show-toplevel`.chomp\n end",
"title": ""
},
{
"docid": "e681277cce619c8e9e5292769c0d5e3c",
"score": "0.6246026",
"text": "def get_root_directory\n return @@root_directory\n end",
"title": ""
},
{
"docid": "e681277cce619c8e9e5292769c0d5e3c",
"score": "0.6246026",
"text": "def get_root_directory\n return @@root_directory\n end",
"title": ""
},
{
"docid": "1f963c71646354dd2403f233636b3003",
"score": "0.6235157",
"text": "def root\n Rails.root || Pathname.new(ENV[\"RAILS_ROOT\"] || Dir.pwd)\n end",
"title": ""
},
{
"docid": "1f963c71646354dd2403f233636b3003",
"score": "0.6235157",
"text": "def root\n Rails.root || Pathname.new(ENV[\"RAILS_ROOT\"] || Dir.pwd)\n end",
"title": ""
},
{
"docid": "57058293569f492431e13df14f4a4734",
"score": "0.6229462",
"text": "def root_path\n RUBYCOCOA_ROOT.to_s\n end",
"title": ""
},
{
"docid": "987a5c1eeecdc38a61cf747e8ec8c9c6",
"score": "0.6206388",
"text": "def build_root\n self.class.build_root.join(name)\n end",
"title": ""
},
{
"docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e",
"score": "0.62050456",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e",
"score": "0.62050456",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "b103d5e546ebb206a2134a26ab16eb85",
"score": "0.62026894",
"text": "def root\n self.config[:root] || Dir.pwd rescue Dir.pwd\n end",
"title": ""
},
{
"docid": "8d47f11c38a99ad2857c79522487fcac",
"score": "0.61938024",
"text": "def root path\n File.dirname(find_dotjam(path))\n end",
"title": ""
},
{
"docid": "9c379984dc9f59eadfd6d433a96d3d48",
"score": "0.61879677",
"text": "def application_root; end",
"title": ""
},
{
"docid": "8e4308945f85f08711873aebc323c29a",
"score": "0.61827517",
"text": "def root\n File.expand_path(File.dirname(__dir__))\n end",
"title": ""
},
{
"docid": "a336149a2553865be66d8eeb7caac80f",
"score": "0.61810243",
"text": "def root\n @root ||= Pathname.new(File.expand_path(\"..\", __dir__))\n end",
"title": ""
},
{
"docid": "109fdcec9dee9329cf8bdabfc2ba2c9a",
"score": "0.61752224",
"text": "def root; Pathname(__dir__).parent; end",
"title": ""
},
{
"docid": "ee2a21893d55346d9020493d3c2cd626",
"score": "0.61709994",
"text": "def rails_root\n `pwd`.gsub(\"\\n\", \"\")\n end",
"title": ""
},
{
"docid": "ee2a21893d55346d9020493d3c2cd626",
"score": "0.61709994",
"text": "def rails_root\n `pwd`.gsub(\"\\n\", \"\")\n end",
"title": ""
},
{
"docid": "73da21ce242e61c216e4ccb4a879a7fb",
"score": "0.61699665",
"text": "def conf_root(root = nil)\n Pathname(File.expand_path(root || Environment::CONFROOT || ENV['MIKUTTER_CONFROOT'] || '~/.mikutter'))\n rescue\n Pathname(File.expand_path(ENV['MIKUTTER_CONFROOT'] || '~/.mikutter'))\n end",
"title": ""
},
{
"docid": "42c40bb372067ad2f1e038662cd4f8c3",
"score": "0.61688125",
"text": "def root_path \n @root_path\n end",
"title": ""
},
{
"docid": "3395edf0dac9b18299b9b92d2b911720",
"score": "0.61645436",
"text": "def root\n\t\tFile.join(options[:root].to_s, user.id.to_s)\n\tend",
"title": ""
},
{
"docid": "9922985354547181f907e326df6b0841",
"score": "0.6150548",
"text": "def _(*paths)\n File.join(root_folder, *paths)\n end",
"title": ""
},
{
"docid": "c69db9cdb927417da9103c1e97d525f9",
"score": "0.61497146",
"text": "def project_root()\n return @project_root_path if @project_root_path\n \n @project_root_path = Common::find_root_of(\"tiapp.xml\", Common::project_path)\n end",
"title": ""
},
{
"docid": "976d854b23b87b118dce5b243f30d0c1",
"score": "0.6141559",
"text": "def root path = nil\n if path && configurable?\n @root = normalize_path(path)\n # resetting path to an empty string cause root should be an absolute path to templates.\n @path, @setup[:path] = nil\n path ''\n end\n @setup[:root] ||= @root ||\n (@controller.ctrl.slice.view.root if @controller) ||\n Presto::App.root\n end",
"title": ""
},
{
"docid": "be6a0ad4f21eb4a277618ba2cc8ae25c",
"score": "0.6132093",
"text": "def set_root_path!\n raise 'IRONNAILS_ROOT is not set' unless defined?(::IRONNAILS_ROOT)\n raise 'IRONNAILS_ROOT is not a directory' unless File.directory?(::IRONNAILS_ROOT)\n\n @root_path =\n # Pathname is incompatible with Windows, but Windows doesn't have\n # real symlinks so File.expand_path is safe.\n if ENV['OS'] == 'Windows_NT'.freeze\n File.expand_path(::IRONNAILS_ROOT)\n\n # Otherwise use Pathname#realpath which respects symlinks.\n else\n Pathname.new(::IRONNAILS_ROOT).realpath.to_s\n end\n\n Object.const_set(:RELATIVE_IRONNAILS_ROOT, ::IRONNAILS_ROOT.dup) unless defined?(::RELATIVE_IRONNAILS_ROOT)\n\n ::IRONNAILS_ROOT.replace @root_path\n end",
"title": ""
},
{
"docid": "f8367bc4c2edbed1a869692c499e4664",
"score": "0.6095844",
"text": "def project_root\n if server_environment\n server_environment['project-root'] || ''\n end\n end",
"title": ""
},
{
"docid": "4acfe0bfa56381993cf07d6777207783",
"score": "0.6094072",
"text": "def root_dir\n self.class.plays_dir.join script_name\n end",
"title": ""
},
{
"docid": "94bb2407168a49a34db50646243e470f",
"score": "0.6088704",
"text": "def relative_path\n self.path.sub(File.expand_path(options[:root_dir]) + '/', '')\n end",
"title": ""
},
{
"docid": "0590546490d5b99dcbf8d0a6d4e429fd",
"score": "0.6084804",
"text": "def rails_root\n File.expand_path('../../..', __dir__)\n end",
"title": ""
},
{
"docid": "0a1aea347cd94ca25a935819eb2d68f1",
"score": "0.60799444",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "16ea12f5d6e2f031f17d54d6d1ec26b4",
"score": "0.6072598",
"text": "def app_root; end",
"title": ""
},
{
"docid": "fceb8d6ef1af3ef33d91e236f8993b7b",
"score": "0.6068725",
"text": "def plugin_app_root\n \"#{plugin_test_root}/app_root\"\n end",
"title": ""
},
{
"docid": "25b58fe9989a1d832064642870c21863",
"score": "0.605558",
"text": "def folder\n @root_folder\n end",
"title": ""
},
{
"docid": "522e8248e5b732377d39f883c33f7707",
"score": "0.6055228",
"text": "def default_application_paths\n paths = []\n\n # Followed by the standard includes.\n paths.concat %w(\n config\n lib\n lib/core_ext\n app\n app/models\n app/controllers\n app/converters\n app/helpers\n ).map { |dir| \"#{root_path}/#{dir}\" }.select { |dir| File.directory?(dir) }\n end",
"title": ""
},
{
"docid": "b9f47f95057d0ab98b7444de294fc337",
"score": "0.6052319",
"text": "def rootify_path path\n path = normalize_path(path, true)\n path.size > 0 ? '/%s/' % path : '/'\n end",
"title": ""
},
{
"docid": "0638ad465dbb141c0911a721b0761010",
"score": "0.60520387",
"text": "def user_root_path\n users_root_path\n end",
"title": ""
},
{
"docid": "bdbe14d733f3cec326ba18bfd661f277",
"score": "0.6034456",
"text": "def path_root\n base_uri ? base_uri : path_to( '/' )\n end",
"title": ""
},
{
"docid": "c38084fe7932a2957e01d95bb16741e9",
"score": "0.603288",
"text": "def mounted_root(*args)\n Padrino.root(@mounted_root ||= \"\", *args)\n end",
"title": ""
},
{
"docid": "8fc53167d9637f06d6ded4660a12696d",
"score": "0.6032552",
"text": "def root\n @root ||= Pathname.new(__FILE__).dirname.dirname.expand_path.to_s\n end",
"title": ""
},
{
"docid": "75998d43d35e1e005d5e36007ac874f1",
"score": "0.6029294",
"text": "def root\n \"#{File.dirname(__FILE__)}/..\"\nend",
"title": ""
},
{
"docid": "0ae73730b8b79d9dd9a147bbf97a4e03",
"score": "0.6027694",
"text": "def local_root(options={})\n prefix = options.has_key?(:prefix)? options[:prefix] : self.config.prefix\n\n begin\n if !connection.directories.get(prefix).nil?\n @local_root ||= connection.directories.get(prefix)\n else\n @local_root ||= connection.directories.create(:key => prefix)\n end\n rescue\n @local_root ||= connection.directories.create(:key => prefix)\n end\n end",
"title": ""
},
{
"docid": "2909e71fe0bb55339fcf84947377ec57",
"score": "0.60052586",
"text": "def relroot\n Pathname.new(File.expand_path(path)).\n relative_path_from(Pathname.new(File.expand_path(root))).to_s\n end",
"title": ""
},
{
"docid": "c2b419a7364cbd99be6129a987e63bab",
"score": "0.6003189",
"text": "def install_root\n Pathname.new(ENV[\"PREFIX\"] || \"/var/www/ood/apps/sys\")\n end",
"title": ""
},
{
"docid": "9be5a24c6cdc3407e68efefbe1c35ea5",
"score": "0.60012466",
"text": "def lookup_root\n pwd = File.expand_path(Dir.pwd)\n home = File.expand_path('~')\n while pwd != '/' && pwd != home\n return pwd if ROOT_INDICATORS.any?{ |r| File.exist?(File.join(pwd, r)) }\n pwd = File.dirname(pwd)\n end\n return nil\n end",
"title": ""
},
{
"docid": "9ca7f1acfc5d48a85f335575497c8b42",
"score": "0.59976816",
"text": "def expand_root_path(path)\n path.to_s.sub(/^\\$root/, @root)\n end",
"title": ""
},
{
"docid": "c7d775e58f0b79033aa9a4488ec21274",
"score": "0.59882283",
"text": "def safe_dir\n options[:root_dir] / name.to_s\n end",
"title": ""
},
{
"docid": "a55d9ba5e06e5453d223020201770202",
"score": "0.59719735",
"text": "def root\n @root ||= Pathname.new(File.expand_path(\"../../\", __FILE__))\n end",
"title": ""
}
] |
d4a1edaae4d92d004632cf64501ce2e7
|
DELETE /users/1 DELETE /users/1.json
|
[
{
"docid": "9e74132e304cccb4e79ff5487a764e47",
"score": "0.0",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.7590564",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_name incorrecta'\n assert_equal '1094673845', data['document'], 'propiedad document incorrecta'\n end",
"title": ""
},
{
"docid": "a8734c4a0413cb455f2d0df0f8fcd5e5",
"score": "0.7535006",
"text": "def delete\n puts \"******* delete *******\"\n @user.delete\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1bdb0dff73de3d9b03c84a910ab5cf6",
"score": "0.7530426",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "acf1bfd6dfa0380aa31a8efde7732e86",
"score": "0.74716073",
"text": "def destroy\n user = User.find(params[:id])\n user.destroy\n\n render json: user\n end",
"title": ""
},
{
"docid": "182545a45c91f56577e4d982a2163076",
"score": "0.7450307",
"text": "def destroy\n # @api_v1_user.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "184da7ffae8985dd57d5dcc85145a0f6",
"score": "0.74005455",
"text": "def destroy\n @user_1 = User1.find(params[:id])\n @user_1.destroy\n\n respond_to do |format|\n format.html { redirect_to user_1s_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "48a547bf26d6cb827ad21d18c74a0be9",
"score": "0.73815674",
"text": "def destroy\n user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23d5420431a6badf1a5be6ec0b92dbc4",
"score": "0.7369995",
"text": "def destroy\n @user.destroy\n render json: {}, status: :ok\n end",
"title": ""
},
{
"docid": "e7586b9e01c30dda3bca3565a54acef7",
"score": "0.73687035",
"text": "def destroy\n @user = HTTParty.delete(\"#{UAA_TOKEN_SERVER}/Users/#{params[\"id\"]}\",\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => \"Bearer #{session[:access_token]}\",\n 'Accept' => 'application/json',\n } )\n\n respond_to do |format|\n format.html { redirect_to users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a50700ffebc25b728498bd9a31e3e68c",
"score": "0.7362334",
"text": "def destroy\n @user.destroy\n render json: {message: \"#{@user.id} deleted\"}, status: :ok\n end",
"title": ""
},
{
"docid": "93c96ce100a97061db1011c64f39a340",
"score": "0.73549896",
"text": "def destroy\n user = User.find(params[:id])\n user.destroy\n head 204\n end",
"title": ""
},
{
"docid": "00011aeb4e366ee142243e8cd8dbea5b",
"score": "0.7348393",
"text": "def destroy\n User.find(params[:id]).destroy\n head 204\n end",
"title": ""
},
{
"docid": "74f571ada66f3dcce468fd0ae24a58d5",
"score": "0.7345434",
"text": "def destroy\n @user1 = User1.find(params[:id])\n @user1.destroy\n\n respond_to do |format|\n format.html { redirect_to user1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9fc011024a4990800c031ede66cb7f09",
"score": "0.73159516",
"text": "def delete_user(id)\n delete \"/1/users/#{id}\"\n end",
"title": ""
},
{
"docid": "9acc47ec98a84118327511a7464c7050",
"score": "0.7314843",
"text": "def destroy\n user = User.find(params[:id])\n user.destroy\n render json: {message: 'User successfully deleted!'}\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.7306841",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.7306841",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.7306841",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.7306841",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.7306841",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.7291842",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.7291842",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.7291842",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31be2fbd2b5aedc5e7088866cdb5f8a3",
"score": "0.72909135",
"text": "def delete_user_data(user_id)\n # Define a path referencing the user data using the user_id\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\" # setup user path\n _delete(path)\n puts '[+] User data deleted successfully'.green\nend",
"title": ""
},
{
"docid": "8431bdc2d158488844c8ac80db43f4b8",
"score": "0.7288024",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "83641ef98db66d873e35a72bb607fce1",
"score": "0.7277104",
"text": "def delete_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "376b4f7e152f407f3e5ee2b58bebf40d",
"score": "0.7276982",
"text": "def destroy\n @user = User.find(params[:id]) \n # then delete the user\n @user.destroy \n \n respond_to do |format|\n format.html { redirect_to users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47906c177f4a86a8afc6f4f47f000281",
"score": "0.727592",
"text": "def destroy\n @user = User.find(params[:id])\n \n if @user.destroy\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "47a21f1095730d24ed4fb5dbb5e6c243",
"score": "0.72750896",
"text": "def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end",
"title": ""
},
{
"docid": "f94ce5c1d8c9e9ebe6c6588ca8157df7",
"score": "0.7272",
"text": "def destroy\n\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3a4b50114274c5e32c86fee540d5fd2",
"score": "0.7250935",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "50196c0b5827d2e60db51073eca353c1",
"score": "0.72436607",
"text": "def delete_user_with_request(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "a3555514a8c25eb906e0889f6912510b",
"score": "0.7242216",
"text": "def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1d85d99e83755aa6408d1f2766310519",
"score": "0.7234411",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n #format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7232177",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
23e95b7b2f204bff7d3eaa8a199ec544
|
short fat L rotate piece 180
|
[
{
"docid": "1f26e2f3d1d811fb2179d5e036dfdd7b",
"score": "0.70223504",
"text": "def rotate_180\n # Ensures that the flip will always be a possible formation (as opposed \n # to nil) by altering the intended coordinates so that it stays \n # within the bounds of the rotation array\n moved = true\n potential = @all_rotations[(@rotation_index + 2) % @all_rotations.size]\n # for each individual block in the piece, checks if the intended move\n # will put this block in an occupied space\n potential.each{|posns| \n if !(@board.empty_at([posns[0] + @base_position[0],\n posns[1] + @base_position[1]]));\n moved = false; \n end\n }\n if moved\n @rotation_index = (@rotation_index + 2) % @all_rotations.size\n end\n moved\n end",
"title": ""
}
] |
[
{
"docid": "54ebfe6e239f23e37e6fefcb9686e1a8",
"score": "0.7870637",
"text": "def rotate_180!; end",
"title": ""
},
{
"docid": "37ebc410b144baa8c4cf7fcfe6c55cdd",
"score": "0.7748208",
"text": "def rotate_180; end",
"title": ""
},
{
"docid": "092053975b105f94ff08b7dd99637ec6",
"score": "0.7639054",
"text": "def rotate_clockwise!; end",
"title": ""
},
{
"docid": "7526dfc2832fea0b99793c424a17e267",
"score": "0.7572457",
"text": "def rotate_clockwise; end",
"title": ""
},
{
"docid": "d27083d204b08517460a90e19911e91e",
"score": "0.7259315",
"text": "def rotate_counter_clockwise; end",
"title": ""
},
{
"docid": "fad7a1366521c9add914879d5cda3045",
"score": "0.7240864",
"text": "def rot180\n rot :d180\n end",
"title": ""
},
{
"docid": "7c3fe04777727797bf5003c9dcfbfc3e",
"score": "0.7238574",
"text": "def rotate180(state)\n state.reverse\nend",
"title": ""
},
{
"docid": "7c3fe04777727797bf5003c9dcfbfc3e",
"score": "0.7238574",
"text": "def rotate180(state)\n state.reverse\nend",
"title": ""
},
{
"docid": "7dcb17f0203dfc6e2d5f818fa32d4a86",
"score": "0.72023314",
"text": "def rotate(angle)\n \n end",
"title": ""
},
{
"docid": "c21a9a5f02ff678f5170622bbd0f5318",
"score": "0.7176219",
"text": "def rotate_right!; end",
"title": ""
},
{
"docid": "21d913c5bfee29391b9f7d4e0a384734",
"score": "0.7175103",
"text": "def rotate_180\n \trotate_clockwise\n \trotate_clockwise\n end",
"title": ""
},
{
"docid": "57065bfada899c72a565fed0504fa80e",
"score": "0.7173765",
"text": "def rotate_right; end",
"title": ""
},
{
"docid": "4440c0d76cf7ebb449037dd81a1ca4a0",
"score": "0.7118144",
"text": "def straighten\n @rotation = 0\n end",
"title": ""
},
{
"docid": "09d1091c859048056ec4de4aa9036328",
"score": "0.70540565",
"text": "def rotX; end",
"title": ""
},
{
"docid": "a55d0bb4be11f0b76bad15e668d6fd90",
"score": "0.7052123",
"text": "def rotate270(state)\n rotate90(rotate180(state))\nend",
"title": ""
},
{
"docid": "a55d0bb4be11f0b76bad15e668d6fd90",
"score": "0.7052123",
"text": "def rotate270(state)\n rotate90(rotate180(state))\nend",
"title": ""
},
{
"docid": "5ec440024ae3d9b245d8958d4de48618",
"score": "0.69756514",
"text": "def rot90\n rot :d90\n end",
"title": ""
},
{
"docid": "5539a32b86ffa95e7c82820f0d4a78b4",
"score": "0.6913347",
"text": "def rotate_left; end",
"title": ""
},
{
"docid": "4ce308438d484a2ac340add84a690ca0",
"score": "0.68784916",
"text": "def rotY; end",
"title": ""
},
{
"docid": "5c2642cca78a25ad36c8404eececcd06",
"score": "0.68632543",
"text": "def leftRotation(a, d)\n # Complete this function\n a.rotate(d)\nend",
"title": ""
},
{
"docid": "c493ea51ec17897c9fac2d5a794a399b",
"score": "0.68494076",
"text": "def rotateLeft()\n \n end",
"title": ""
},
{
"docid": "1ca0c3a28ec978a3739e3c26de72008a",
"score": "0.68484306",
"text": "def rotateRight()\n \n end",
"title": ""
},
{
"docid": "c5e34d251753d625d5498264c241ac1e",
"score": "0.6811757",
"text": "def rotateLeft()\n twoTypeRotate()\n end",
"title": ""
},
{
"docid": "d57099644e1c4b994ff575c6724fd924",
"score": "0.6808893",
"text": "def rot_x; end",
"title": ""
},
{
"docid": "c0ddb2db97a34f99e6076ab870e3763c",
"score": "0.67664975",
"text": "def rotate(piece) # clockwise\r\n\ttemp = piece.clone\r\n\tpiece[0] = temp[1]\r\n\tpiece[1] = temp[2]\r\n\tpiece[2] = temp[3]\r\n\tpiece[3] = temp[0]\r\nend",
"title": ""
},
{
"docid": "05de944420efdba164bb1f40eff8ff67",
"score": "0.67335266",
"text": "def rotate(orientation); end",
"title": ""
},
{
"docid": "95d5d8f84d43cd44f9f2eec816f50b62",
"score": "0.67255795",
"text": "def rotate_180!\n pixels.reverse!\n return self\n end",
"title": ""
},
{
"docid": "723016f5e94cab51899f9f5b5a9bad6d",
"score": "0.67122865",
"text": "def rot270\n rot :d270\n end",
"title": ""
},
{
"docid": "20b8c30a49f8ba84ad63f8fcfc2aa1f7",
"score": "0.6698019",
"text": "def rotate dir = \"LR\"\n orient dir\n end",
"title": ""
},
{
"docid": "204278a9f72f22edff6d9d082abf9eda",
"score": "0.6680447",
"text": "def rotLeft(a, d) \n a.rotate(d) \nend",
"title": ""
},
{
"docid": "e0da3576e9751d50581842bb8ee55bbf",
"score": "0.66771775",
"text": "def rotate_clockwise\n rotate(1)\n end",
"title": ""
},
{
"docid": "df32c6776c53be9881de5ebbd59be53f",
"score": "0.6675661",
"text": "def rotation(theta) ; ; end",
"title": ""
},
{
"docid": "0a747ccd63fd31ec27d65b1d7adf7f9f",
"score": "0.66725695",
"text": "def rot_y; end",
"title": ""
},
{
"docid": "bc28788a3aada26e14c48e449bdc82c9",
"score": "0.66582054",
"text": "def rotate!\n tmp = []\n tmp[0] = @colours[3]\n tmp[1] = @colours[0]\n tmp[2] = @colours[1]\n tmp[3] = @colours[2]\n @colours = tmp\n @orientation = (@orientation-1) % 4\n end",
"title": ""
},
{
"docid": "ed492940a0a8649398dc54650a08e5d4",
"score": "0.66561127",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 1)\n @current_block.move(0, 0, 1)\n end\n draw\n end",
"title": ""
},
{
"docid": "e82ebb4ae2b911c65e33351963f4c93a",
"score": "0.6628026",
"text": "def rotate(vect); end",
"title": ""
},
{
"docid": "e82ebb4ae2b911c65e33351963f4c93a",
"score": "0.6628026",
"text": "def rotate(vect); end",
"title": ""
},
{
"docid": "e419cf877f3b204ec739cb37d024e25c",
"score": "0.6625059",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.rotate_180()\n end\n draw\n end",
"title": ""
},
{
"docid": "d9c63a64d1ab99f3b7deb116e8f64eb3",
"score": "0.66208917",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2)\n end\n draw\n end",
"title": ""
},
{
"docid": "d9c63a64d1ab99f3b7deb116e8f64eb3",
"score": "0.66208917",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2)\n end\n draw\n end",
"title": ""
},
{
"docid": "d9c63a64d1ab99f3b7deb116e8f64eb3",
"score": "0.66208917",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2)\n end\n draw\n end",
"title": ""
},
{
"docid": "d9c63a64d1ab99f3b7deb116e8f64eb3",
"score": "0.66208917",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2)\n end\n draw\n end",
"title": ""
},
{
"docid": "b06863c14370027e342ff5e8d7aa3d2d",
"score": "0.6593791",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, -2)\n end\n draw\n end",
"title": ""
},
{
"docid": "b06863c14370027e342ff5e8d7aa3d2d",
"score": "0.6593791",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, -2)\n end\n draw\n end",
"title": ""
},
{
"docid": "0f27afcdc3734a49a5a35f944a6cce35",
"score": "0.6593691",
"text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2) # intead of call twice, change delta_rotation to 2\n # @current_block.move(0, 0, 1) # call twice to make 180 degree rotation\n end\n draw\n end",
"title": ""
},
{
"docid": "0d9df8233b83b9e3ae90e997a99661af",
"score": "0.65790135",
"text": "def rotate(input)\n\nend",
"title": ""
},
{
"docid": "2444dbb10911f33c3539f0a0b3aef946",
"score": "0.6576483",
"text": "def rotate( coord )\n (coord + @offset) % @square.length\n end",
"title": ""
},
{
"docid": "c9017b71a10361373375674e0e21c225",
"score": "0.6574372",
"text": "def rotate_180\n\t\tif !game_over? and @game.is_running?\n\t\t\t@current_block.move(0, 0, 2)\n\t\tend\n\t\tdraw\n\tend",
"title": ""
},
{
"docid": "1e80d9f6c5d60f2c167cd1bddfda8320",
"score": "0.6570627",
"text": "def rotate(dir)\n\t\tbearings = [\"N\", \"E\", \"S\", \"W\"]\n\t\tcurrent_index = bearings.index(@o)\n\t\tif dir == \"L\"\n\t\t\tcurrent_index -= 1\n\t\telse\n\t\t\tcurrent_index += 1\n\t\tend\n\t\t@o = bearings[current_index % 4]\n\tend",
"title": ""
},
{
"docid": "cc9e74f5e70bfca5465a02adc59c9426",
"score": "0.65704805",
"text": "def rotate(v)\n # borrowed from my \"Apple World\" 1979\n hf = (v.x * @sx - v.z * @cx)\n py = v.y * @cy + @sy * hf\n px = v.x * @cx + v.z * @sx\n pz = -v.y * @sy + @cy * hf\n v.x = px; v.y = py; v.z = pz\n end",
"title": ""
},
{
"docid": "1bfe24f37cd4766a8a8ecfeed011ef59",
"score": "0.65690154",
"text": "def rotateRight()\n twoTypeRotate()\n end",
"title": ""
},
{
"docid": "4edfbeebc68bec6256c59d93afa5ea18",
"score": "0.65636873",
"text": "def rotate\n @rotation = (@rotation + 1) % 26\n rotation\n end",
"title": ""
},
{
"docid": "f2bd0a8b78992c798e7c51c77db87e63",
"score": "0.6549921",
"text": "def rot(strng)\n strng.reverse\nend",
"title": ""
},
{
"docid": "f50919a3c357ae319042770f9fbb8646",
"score": "0.6524832",
"text": "def rot(side)\n\t# [-1, 1].include?(side)\n\tif side < 0\n\t clock\n\telse\n\t anti\n\tend\n end",
"title": ""
},
{
"docid": "86276dc506c572162b87019b67049376",
"score": "0.65212756",
"text": "def rotate!(degrees, center)\n # Your code goes here...\n end",
"title": ""
},
{
"docid": "485bd3b586b46fd474505a79f42944a3",
"score": "0.651855",
"text": "def transform(rotation)\n end",
"title": ""
},
{
"docid": "a878d49398177c885e599bd8cdfc5b6e",
"score": "0.6499211",
"text": "def rotate_180\n dup.rotate_180!\n end",
"title": ""
},
{
"docid": "1b879c2eea66a3dc322d017631541aca",
"score": "0.64877325",
"text": "def rotate_l\n border[:temp] = top\n border[:top] = right\n border[:right] = bottom\n border[:bottom] = left\n border[:left] = border[:temp]\n border.delete(:temp)\n self\n end",
"title": ""
},
{
"docid": "9aa19b02bd6a1a75a448fd923817d56f",
"score": "0.64853215",
"text": "def rotate!(angle)\n# \t\tcase(angle)\n# \t\twhen HALF_PI, -THREE_HALF_PI\n# \t\t\tself.set!(@y,-@x)\n# \t\twhen THREE_HALF_PI, -HALF_PI\n# \t\t\tself.set!(-@y,@x)\n# \t\twhen PI, -PI\n# \t\t\tself.set!(@y,-@x)\n# \t\twhen 0, TWO_PI, -TWO_PI\n# \t\t\tself.set!(@y,-@x)\n# \t\telse\n\t\t\tself.a += angle\n# \t\tend\n\t\treturn self\n\tend",
"title": ""
},
{
"docid": "1aaddf49c23ade0fefdb524deb1138f7",
"score": "0.6478654",
"text": "def turn_left\n @angle -= 4.5\n end",
"title": ""
},
{
"docid": "e5a62dfe13177f30433758c5d783a0b3",
"score": "0.6472977",
"text": "def rotate\n \n half_diagonal = Math.sqrt(2) * 10 # 10 = half side\n [-45, +45, -135, +135].collect do |angle|\n CP::Vec2.new(@body.p.x + Gosu::offset_x(@body.a.radians_to_gosu + angle,\n half_diagonal),\n\n @body.p.y + Gosu::offset_y(@body.a.radians_to_gosu + angle,\n half_diagonal))\n end\n end",
"title": ""
},
{
"docid": "8aafe8c662b38384fd174e428eff5ae0",
"score": "0.64716023",
"text": "def rotate(angle, around_x=0, around_y=0); end",
"title": ""
},
{
"docid": "2466036adcc43d5a96851dd0b36f7f06",
"score": "0.6468806",
"text": "def rotate(piece)\n rotatedPiece = {}\n\n piece.each do |block|\n newBlock = (newBlock[1], -1 * newBlock[0])\n rotatedPiece.add(newBlock)\n end\n\n return rotatedPiece\nend",
"title": ""
},
{
"docid": "4f7ce4367c84b94077b8e2800398370c",
"score": "0.6466153",
"text": "def rotate90(current_waypoint)\n x, y = *current_waypoint\n Vector[y, -x]\n end",
"title": ""
},
{
"docid": "6491084cccd5e6c1fa215183badedc71",
"score": "0.64515096",
"text": "def rotate(degrees, center)\n # Your code goes here...\n end",
"title": ""
},
{
"docid": "807e0b2c84cbdfe3c90999f5d707ba0b",
"score": "0.64353997",
"text": "def rotate\n half_diagonal = Math.sqrt(2) * (self.width/2)\n [-45, +45, -135, +135].collect do |angle|\n CP::Vec2.new(@shape.body.p.x + Gosu::offset_x(@shape.body.a.radians_to_gosu + angle,\n half_diagonal),\n\n @shape.body.p.y + Gosu::offset_y(@shape.body.a.radians_to_gosu + angle,\n half_diagonal))\n end\n end",
"title": ""
},
{
"docid": "68a3906221e5593389a7ff925bbc404d",
"score": "0.6418741",
"text": "def angle(n)\n 180 * (n - 2)\nend",
"title": ""
},
{
"docid": "2c1ab25877de620b3fe7f898e2991113",
"score": "0.6412954",
"text": "def rotated_15\n draw_circle { |c| c.rotate(15) }\nend",
"title": ""
},
{
"docid": "60d5c0d732ba5ffcc709fe867c32ceea",
"score": "0.6411257",
"text": "def rotate90(state)\n state.each_slice(LENGTH).reverse_each.to_a.transpose.flatten\nend",
"title": ""
},
{
"docid": "60d5c0d732ba5ffcc709fe867c32ceea",
"score": "0.6411257",
"text": "def rotate90(state)\n state.each_slice(LENGTH).reverse_each.to_a.transpose.flatten\nend",
"title": ""
},
{
"docid": "9b56a6cfef89ca2d2714f34697bc75cd",
"score": "0.638517",
"text": "def rotLeft(a, d)\n a.rotate!(d)\nend",
"title": ""
},
{
"docid": "46139e80871e9d100a4f3478e4674523",
"score": "0.6364027",
"text": "def rotate\n tmp_piece=Piece.new\n for i in 0..@width-1\n shape_line=Array.new\n \n (@height-1).downto(0) { |j|\n shape_line.push(@shape[j][i])\n }\n \n \n tmp_piece.add_line(shape_line)\n end\n return tmp_piece\n end",
"title": ""
},
{
"docid": "c970c7a55dfc8191e3948f71eb57da22",
"score": "0.63619286",
"text": "def rotate!(degree)\n radian = VoltMath.radian(degree)\n\n x = @x\n cos = Math.cos(radian)\n sin = Math.sin(radian)\n\n self.tap do\n @x = x * cos - @y * sin\n @y = x * sin + @y * cos\n end\n \tend",
"title": ""
},
{
"docid": "06fd7a43749cca48f2e63e182a378c66",
"score": "0.63451153",
"text": "def rotate_180\n self.class.new(width, height).tap do |flipped|\n for y in 0...height do\n flipped.replace_row!(height - (y + 1), row(y).reverse)\n end\n end\n end",
"title": ""
},
{
"docid": "c725a1e121a734650de594c9915dbf6f",
"score": "0.63428676",
"text": "def transform!(rotation)\n end",
"title": ""
},
{
"docid": "245829c5c0a2807ae71f9a50777eceb4",
"score": "0.6334891",
"text": "def right\n rotate(:right)\n end",
"title": ""
},
{
"docid": "ead2776470a042a19650b9fa8b92f59a",
"score": "0.63297004",
"text": "def rotate_x_ccw\n\t\ttmp = @top\n\t\t@top = @back\n\t\[email protected]_180! if @top\n\t\t@back = @bottom\n\t\[email protected]_180! if @back\n\t\t@bottom = @front\n\t\t@front = tmp\n\t\[email protected]_ccw! if @right\n\t\[email protected]_cw! if @left\n\tend",
"title": ""
},
{
"docid": "1ea21b85c099df31b380d55271a9040e",
"score": "0.63096136",
"text": "def rotated_360\n draw_circle { |c| c.rotate(360) }\nend",
"title": ""
},
{
"docid": "9b45eed6fa8a9b5568861bcc6d34b6d7",
"score": "0.63004273",
"text": "def flip\n @local_angle = 180\n end",
"title": ""
},
{
"docid": "63106bb5ee8ceebd747d2363615c31db",
"score": "0.6294162",
"text": "def rotate_ccw\n Vector.new(-y, x, z)\n end",
"title": ""
},
{
"docid": "3babefb75f7666f03d06b050cad71c69",
"score": "0.62907064",
"text": "def rot(d)d=='x'?'y':d=='y'?'z':'x'end",
"title": ""
},
{
"docid": "12f83735ad1a20fcb6693c724cf24209",
"score": "0.6287516",
"text": "def rotate180(matrix)\n matrix.reverse.map(&:reverse)\nend",
"title": ""
},
{
"docid": "2948b3ac05374b07a2d82fa94099434f",
"score": "0.6259635",
"text": "def turn (degrees)\n @angle += degrees\n @angle %= 360\n end",
"title": ""
},
{
"docid": "850a5f479ccb8aa00464b2a736414098",
"score": "0.62495744",
"text": "def rotate_clockwise\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 1)\n end\n draw\n end",
"title": ""
},
{
"docid": "2dca98480b9ba90fa4a5b8ab843a7f16",
"score": "0.6248216",
"text": "def shift_to_deg\n Rational(180.0, Math::PI)\n end",
"title": ""
},
{
"docid": "a3c15f3c3735a32ed71c1598b9d38025",
"score": "0.62427044",
"text": "def rotate!(angle)\n self.shape = self.shape.transpose.collect{|row| row.reverse} if angle % 90 == 0\n self.shape = self.shape.collect{|row| row.reverse}.reverse if angle % 180 == 0\n end",
"title": ""
},
{
"docid": "2755f9c4248fca74876ca321544a9ac1",
"score": "0.6239016",
"text": "def rotate(degrees, background: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d4450b9827aebe25cb877d97107a5d4a",
"score": "0.6238716",
"text": "def turn_right\n self.rotation += self.turn_speed / (SUBSTEPS**2)\n end",
"title": ""
},
{
"docid": "959f653524cbb85483ace8adfa7ae754",
"score": "0.6238307",
"text": "def rotate_right\n @dir.turn_right\n end",
"title": ""
},
{
"docid": "dda3be6d0c19ce49b9b56290dac4925f",
"score": "0.6238028",
"text": "def draw_rot(text, x, y, z, angle, factor_x=1, factor_y=1, color=0xffffffff, mode=:default); end",
"title": ""
},
{
"docid": "9059348eb81ae94706ca045f4edff163",
"score": "0.62359107",
"text": "def turn_left\n self.rotation -= self.turn_speed / (SUBSTEPS**2)\n end",
"title": ""
},
{
"docid": "5691caee0e12346214f5020eff21efc2",
"score": "0.6212747",
"text": "def rotate(cur_dir, target_dir)\n left_rotations = dir_to_int(target_dir) - dir_to_int(cur_dir)\n left_rotations += 4 if left_rotations < 0\n ['L'] * left_rotations\n end",
"title": ""
},
{
"docid": "5ff836dde8c512b97802a174db06a576",
"score": "0.6183567",
"text": "def change_cardinal(rotate)\n\t\tif rotate == \"R\"\n\t\t\t@d = @cardinal[(@cardinal.index(@d) + 1) % 4]\n\t\telse\n\t\t\t@d = @cardinal[(@cardinal.index(@d) - 1) % 4]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a93d148bd64fba837e18f2fb9e69698e",
"score": "0.6178237",
"text": "def left_rotation\n left_rotation = LeftRotation.new\n input, shift = left_rotation.input\n result = left_rotation.shift input, shift\n result.each do |item|\n print \"#{item} \"\n end\nend",
"title": ""
},
{
"docid": "86d0fd1acafa9fa05824d0d1ae8f64fa",
"score": "0.617211",
"text": "def rotate_counterclockwise\n rotate(-1)\n end",
"title": ""
},
{
"docid": "f53ad4c05f63bd0344392dfb3873bb9c",
"score": "0.6169983",
"text": "def rotate_left\n @dir.turn_left\n end",
"title": ""
},
{
"docid": "1557804e5afdb8fa378e5fb769e909b4",
"score": "0.616958",
"text": "def right\n rotate(1)\n end",
"title": ""
},
{
"docid": "c026df5de00154fe1d3115eae65235c9",
"score": "0.61683893",
"text": "def draw_rot(x, y, z, angle, center_x=0.5, center_y=0.5, factor_x=1, factor_y=1, color=0xffffffff, mode=:default); end",
"title": ""
},
{
"docid": "5d8e5368b69232c31832c0257b5d932b",
"score": "0.61645186",
"text": "def rotate_180\n self[:Rotate] = (self[:Rotate].to_f() + 180)\n fix_rotation\n end",
"title": ""
},
{
"docid": "94e2f1373d84c7d7c364b91dd0286e94",
"score": "0.6162373",
"text": "def leftRotation(a, d)\n counter = 0\n\n while counter < d\n moving_piece = a.shift\n a << moving_piece\n counter += 1\n end\n\n print a.join(\" \")\nend",
"title": ""
}
] |
611d0625b60f6813fb8e7a150f49902c
|
Return a role details for a specific role type running on this host
|
[
{
"docid": "b7dae5d074b7b592772250cc542d87bd",
"score": "0.7241687",
"text": "def role_of_role_type(cmhost, service_type, role_type)\n cmhost[:roles].find do |_, v|\n v[:serviceType] == service_type && v[:roleType] == role_type\n end\n end",
"title": ""
}
] |
[
{
"docid": "4f9b38b5c8de232d683b201cb8f2c36a",
"score": "0.731373",
"text": "def type\n self[:role]\n end",
"title": ""
},
{
"docid": "4e101a1f09337f279f710556fa355e2f",
"score": "0.72257555",
"text": "def role(type)\n ENUM[:roles].each {|role| return role if role[:name].downcase.to_sym == type }\n end",
"title": ""
},
{
"docid": "ca2a78b12d3bbc4cf10902798f18c009",
"score": "0.7182693",
"text": "def role\n @instance['role']\n end",
"title": ""
},
{
"docid": "ae1bac28092d92f6dee9c6e7b82a1f60",
"score": "0.7173446",
"text": "def role_of_type(role_type)\n role_of_type = nil\n\n self.roles.each do |role| \n role_of_type = role if (role.role_type == role_type)\n end\n\n return role_of_type\n end",
"title": ""
},
{
"docid": "8f1198a46c31bd45810d93eeb63daeb9",
"score": "0.7084774",
"text": "def role(type)\n role = 'Employer' if type == 'Employer'\n role = 'Job Seeker' if type == 'Member'\n role = 'Administrator' if type == 'Admin'\n return role\n end",
"title": ""
},
{
"docid": "2f1990ce9517c10263039ff7bebb6069",
"score": "0.70828396",
"text": "def role\n UserType.find_by_id(user_types_id).name\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.70113826",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.7011258",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.7011258",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "f4d2501fec6db33d772bdfbf927b5f56",
"score": "0.69886625",
"text": "def role\n template.dig('Metadata', 'Role')\n end",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.6976624",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.6976624",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.6976624",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "4f408feea99641bdab45ecf92ce1c9aa",
"score": "0.6969013",
"text": "def role\n roles.first.name.to_sym if roles.present?\n end",
"title": ""
},
{
"docid": "b1cbbd7ca21787be2255fe507ee92acb",
"score": "0.6874921",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.6859268",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.6859268",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.6859268",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6846602",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6846602",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6846602",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6846602",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "5e5d348b6ffb8299deb86235dbfeb28b",
"score": "0.6835739",
"text": "def role\n self[:role].to_sym\n end",
"title": ""
},
{
"docid": "cba36014bf2c208ac1a1f6b56063e6f3",
"score": "0.6800708",
"text": "def role_name\n return role_title if !role_title.blank?\n role_type.role_type_desc\n end",
"title": ""
},
{
"docid": "148b73782fbc182462a57c6e2d41e548",
"score": "0.6783574",
"text": "def role_type\n return User.role_type_from_string(self.role)\n end",
"title": ""
},
{
"docid": "4762d7d7c083ab2319f9aeabcc666476",
"score": "0.673277",
"text": "def role4api\n self.type.to_s\n end",
"title": ""
},
{
"docid": "7e90656e380e008c8dede794144ccea0",
"score": "0.6716231",
"text": "def role\n read_attribute(:role).to_sym\n end",
"title": ""
},
{
"docid": "d4783f91ce3b2d1fff592768a658cf21",
"score": "0.670994",
"text": "def get_role_description(role)\n parameter = \"role-#{role.downcase}\"\n if @configure.has_parameter?(parameter)\n return @configure.get_parameter(parameter)\n end\n nil\n end",
"title": ""
},
{
"docid": "5f5330f47e3d24ce5914de263ba9a4f3",
"score": "0.670505",
"text": "def role\n the_role = self.read_attribute(:role)\n if the_role \n the_role.to_sym\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "67403a429325c0420098f52acce8a59b",
"score": "0.66772985",
"text": "def print_role\n ROLES[self.role_id]\n end",
"title": ""
},
{
"docid": "41f7f1c3c816517874003123f3268b59",
"score": "0.6666236",
"text": "def get_role\n @role = Role.find(@user.role_id)\n end",
"title": ""
},
{
"docid": "4bc759fbec0b65f1c75c207dc531f6ef",
"score": "0.66491896",
"text": "def role\n\t\tr = Role.find(@user.role_id)\n\t\treturn r\n\tend",
"title": ""
},
{
"docid": "c0dae085dbcf27ccfb7373fb6a335442",
"score": "0.6630094",
"text": "def role\n first_role = self.roles.first unless self.roles.nil?\n if (first_role.nil?)\n return \"(none)\"\n else\n return first_role.name\n end\n end",
"title": ""
},
{
"docid": "832481119b9eac03c401742d1d88dd07",
"score": "0.6605991",
"text": "def role_type\n RoleType.find_by_name self.value_actual if value_actual\n end",
"title": ""
},
{
"docid": "1c37b2c1a51c383fafc3795906572074",
"score": "0.6596632",
"text": "def get_role\n if params[:user_type] || params[:user]\n @user_type = params[:user_type] || params[:user][:profile_type]\n end\n end",
"title": ""
},
{
"docid": "01e4f874539704ed5291ca0467786141",
"score": "0.6587995",
"text": "def role\n ::Installation::SystemRole.find(\"cc_role\")\n end",
"title": ""
},
{
"docid": "0973e43094644ccdc1125679ed5f11e2",
"score": "0.65827966",
"text": "def role\n return Role.find(:first, :conditions => {:id => (RolesPerson.find(:first, :conditions => {:person_id => self.id})).role_id}).name\n end",
"title": ""
},
{
"docid": "d00f549cba2769fbe5604bee243303a4",
"score": "0.65268624",
"text": "def get_roles_by_type(role_type, view = nil)\n roles = get_all_roles(view)\n roles.select { |r| r.type == role_type }\n end",
"title": ""
},
{
"docid": "0d7fb3e4e0668153d45bb5083d3277d5",
"score": "0.6518327",
"text": "def role?(type)\n administrations.pluck(:role).include?(type.to_s)\n end",
"title": ""
},
{
"docid": "9c623ad7a85206625d36701d148be1e2",
"score": "0.64665556",
"text": "def getRole(name, role)\n\t\tif @moderators.include?(name)\n\t\t\trole = \"Mod\"\n\t\telsif @keynote.include?(name)\n\t\t\trole = \"Keynote\"\n\t\tend\n\n\t\t@roles[role]\n\tend",
"title": ""
},
{
"docid": "daa3ddd4484a04f30b7d98015041fe4e",
"score": "0.64657605",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "daa3ddd4484a04f30b7d98015041fe4e",
"score": "0.64657605",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6457663",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6457663",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6457663",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6457663",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6457663",
"text": "def role; end",
"title": ""
},
{
"docid": "62944c55ea9191b8f477c739ac404d29",
"score": "0.64510757",
"text": "def role?(type)\n self.role == type\n end",
"title": ""
},
{
"docid": "ae738ca16f8ddc094dde26b7165deb8a",
"score": "0.6446246",
"text": "def get_role(id)\n @client.raw('get', \"/config/roles/#{id}\")\n end",
"title": ""
},
{
"docid": "6ad41b1de92f653cf75291fe77b9bd6c",
"score": "0.6437063",
"text": "def role\n r=roles.first\n return r.nil? ? nil : r.name\n end",
"title": ""
},
{
"docid": "f24cae0c3a028569357c40dc83fc6c75",
"score": "0.64343065",
"text": "def description_for(role)\n role_descriptions[role]\n end",
"title": ""
},
{
"docid": "6fb8d08b0bffe213eb526b64c8d0d4cf",
"score": "0.6433719",
"text": "def show(id)\n response = request(:get, \"/roles/#{id}.json\")\n response[\"role\"]\n end",
"title": ""
},
{
"docid": "d8aade97e49abb22454fbdc22c833944",
"score": "0.64328635",
"text": "def get_role(id)\n return @client.raw(\"get\", \"/config/roles/#{id}\")\n end",
"title": ""
},
{
"docid": "7c091395ba0797c1a3124494fac56b03",
"score": "0.6432738",
"text": "def get_user_role(role_id)\n path = \"/d2l/api/lp/#{$lp_ver}/roles/#{role_id}\"\n _get(path)\n # returns a Role JSON data block\nend",
"title": ""
},
{
"docid": "d01cac7275c7cd05d8096b80aed3749c",
"score": "0.6425295",
"text": "def role_type_for_solr\n role.role_type_id\n end",
"title": ""
},
{
"docid": "1a5a928c94355f8e75ad5dad9fb7349d",
"score": "0.6423075",
"text": "def find_role role\n raise ArgumentError, \"Must be a role label\" if !role.kind_of_label?\n role_model.where(:name => role.to_s)\n end",
"title": ""
},
{
"docid": "ab4f35a41f59fa6a0046102eecc4edf7",
"score": "0.64174503",
"text": "def role\n return @params ? @params[\"role\"] : @api_permission.role\n end",
"title": ""
},
{
"docid": "ff5381c4202065cc310e1e3ed9e4fc33",
"score": "0.6399475",
"text": "def role_string\n return role.to_s\n end",
"title": ""
},
{
"docid": "ff5381c4202065cc310e1e3ed9e4fc33",
"score": "0.6399475",
"text": "def role_string\n return role.to_s\n end",
"title": ""
},
{
"docid": "fd208c47b83351b11c55f1b903d2448c",
"score": "0.639661",
"text": "def service_name_of_role_type(cmhost, service_type, role_type)\n role = role_of_role_type(cmhost, service_type, role_type)\n role[1][:serviceName]\n end",
"title": ""
},
{
"docid": "230713ce1bec261c08b5133bb968da3b",
"score": "0.63874125",
"text": "def get_role(role_name)\n request(\n 'Action' => 'GetRole',\n 'RoleName' => role_name,\n :parser => Fog::Parsers::AWS::IAM::SingleRole.new\n )\n end",
"title": ""
},
{
"docid": "95083aafb9c3b3b0d9eae5924bd4d0a4",
"score": "0.63822436",
"text": "def get_role(name)\n role = @iam_resource.role(name)\n puts(\"Got data for role '#{role.name}'. Its ARN is '#{role.arn}'.\")\n rescue Aws::Errors::ServiceError => e\n puts(\"Couldn't get data for role '#{name}' Here's why:\")\n puts(\"\\t#{e.code}: #{e.message}\")\n raise\n else\n role\n end",
"title": ""
},
{
"docid": "a43490ca34811e0118226bd5066c8e1b",
"score": "0.63815504",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n run_list.uniq!\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "593fde85de018d0635f48badf24bc00e",
"score": "0.63721067",
"text": "def show\n @user_role = current_user.role.name\n return @user_role\n end",
"title": ""
},
{
"docid": "c5572d93a78ecd91a4cd20171510fb39",
"score": "0.6332172",
"text": "def role_type\n role = @from_role||@to_role\n role && role.role_type\n end",
"title": ""
},
{
"docid": "6261d484e875be0771987a95f7fab6c9",
"score": "0.63262236",
"text": "def pdb_get_role(trusted_facts)\n if trusted_facts && trusted_facts[0] && trusted_facts[0]['value'] && trusted_facts[0]['value']['extensions'] && trusted_facts[0]['value']['extensions']['pp_role']\n role = trusted_facts[0]['value']['extensions']['pp_role']\n Puppet.info(\"#{log_prefix} puppet role for node is: role=#{role}\")\n role\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "141e870e74a43562a9102d8fe2981464",
"score": "0.6322666",
"text": "def roleName\n case role\n when 1\n return \"Admin\"\n when 2\n return \"Editor\"\n when 3 \n return \"Viewer\"\n end\n end",
"title": ""
},
{
"docid": "2fc67f63a0cb9026b3d9ba9a7a107a95",
"score": "0.6305302",
"text": "def role\n ROLES.detect { |role| self.has_role?(role) }\n end",
"title": ""
},
{
"docid": "7bd020af2b6ab13433ab1ee033cb9317",
"score": "0.63046056",
"text": "def get_instance_role\n url = URI.parse('http://169.254.169.254/latest/meta-data/iam/security-credentials/')\n response = Net::HTTP.get_response(url)\n\n return {} if response.code != \"200\"\n\n body = response.body\n\n role = body.lines.first\n response = Net::HTTP::get_response(url+role)\n\n return {} if response.code != \"200\"\n\n role = parse_json_object(response.body)\nend",
"title": ""
},
{
"docid": "9888aedce93e04d9a066cca66861d4da",
"score": "0.62997633",
"text": "def get_role\n str = \"\"; #return value\n str = GlobalConstants::TOURNAMENT_ROLES_STR[self.role].to_s.humanize.capitalize;\n return str;\n end",
"title": ""
},
{
"docid": "192e7e18c65404aecb960926e21ef89a",
"score": "0.6297806",
"text": "def role\n return \"webmaster\" if webmaster?\n return \"employer\" if employer?\n return \"job_seeker\" if job_seeker?\n return \"group_manager\" if group_manager?\n end",
"title": ""
},
{
"docid": "ba9e1ebefd75a1d998116ef95ed72229",
"score": "0.6294268",
"text": "def get_roles_by_type(service_name, role_type, cluster_name = 'default', view = nil)\n roles = get_all_roles(service_name, cluster_name, view)\n roles.select { |r| r.type == role_type }\n end",
"title": ""
},
{
"docid": "77d3cce45770e9dac35616d629511b48",
"score": "0.6289321",
"text": "def roleText\n User::ROLE[self.role]\n end",
"title": ""
},
{
"docid": "043254d0e52e6e129e732c70732b23f5",
"score": "0.6286806",
"text": "def auth_locate_role_object(role)\n return acts_as_authorizable_options[:role_class_name].constantize.send(acts_as_authorizable_options[:role_locate_method],role)\n end",
"title": ""
},
{
"docid": "a663167980ea8dc3164c5a75e21daf11",
"score": "0.6285256",
"text": "def my_role member\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [uri, RRDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, member.uri],\n [:mir, Ruta::Property.has_role, :role]\n )\n role = nil\n query.each_solution { |sol| role = sol.role.as(Role) }\n role\n end",
"title": ""
},
{
"docid": "b83655374608949ed2a2e90ed30e0910",
"score": "0.6272629",
"text": "def get_role_name\n length = self.roles.to_s.length\n if length == 7\n role = \"user\"\n else if length == 19\n role = \"moderator\"\n else\n role = \"admin\"\n end\n end\n end",
"title": ""
},
{
"docid": "be8b49965ac5d20180416e5729581a37",
"score": "0.6271054",
"text": "def role\n ActiveSupport::StringInquirer.new(self[:role]) if self[:role]\n end",
"title": ""
},
{
"docid": "1bc58f7044b5b97899f99f970709abae",
"score": "0.6270935",
"text": "def roles\n user_types.collect do |roleuser|\n roleuser.role.to_sym\n end\n end",
"title": ""
},
{
"docid": "2c24c80d22a07cb17feb328d76926414",
"score": "0.6254648",
"text": "def show\n @role = Role.find(params[:id])\n @description = @role.description\n @permissions = @role.permissions\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @role.to_xml }\n end\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "3dd6f2f8437105e3dee43f4cd8a40bd0",
"score": "0.62542194",
"text": "def show\n @role = Role.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.62495893",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.62495893",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.62495893",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "5fb6e91a55736cd36f0400a128131d4d",
"score": "0.6241905",
"text": "def role\n attribute KAXRoleAttribute\n end",
"title": ""
},
{
"docid": "0bb28045a9a9b58cf53f27b6b8c2bd03",
"score": "0.623417",
"text": "def role_for(role_name)\n @roles.each do |role|\n if role.role_type.role_name == role_name.gsub(/\\b\\w/){$&.upcase}\n return role\n end\n end\n # None of the roles matched the role type, so return nil\n return nil\n end",
"title": ""
},
{
"docid": "6794b6cc07a9c5c93d87b84b2f45a230",
"score": "0.6229527",
"text": "def my_role member\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [uri, RDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, member.uri],\n [:mir, Ruta::Property.has_role, :role]\n )\n role = nil\n query.each_solution { |sol| role = sol.role.as(Role) }\n role\n end",
"title": ""
},
{
"docid": "e81f1edd7a35f77271e589c45bcfb7cf",
"score": "0.6225065",
"text": "def find_role(role)\n conditions, values = role_lookup_condition(role)\n mappings[:role][:klass].where(conditions, *values).first\n end",
"title": ""
},
{
"docid": "39f8b7336ace85673fa6ec87c6b416af",
"score": "0.6221047",
"text": "def role(id)\n @roles.find { |e| e.id == id }\n end",
"title": ""
},
{
"docid": "cd2059741ea9be7bdff07d1a6c0dcca1",
"score": "0.6217241",
"text": "def role\n case level\n when LEVEL_SUPER_ADMIN then 'Super Admin'\n when LEVEL_ADMIN then 'Admin'\n when LEVEL_MODERATOR then 'Moderator'\n when LEVEL_CRM then 'CRM'\n else 'User'\n end\n end",
"title": ""
},
{
"docid": "0f2a04aa7bab1d13f4186b96b123e880",
"score": "0.6214511",
"text": "def role\n if !instance_variable_defined?(:@role)\n @role = user.role\n end\n return @role\n end",
"title": ""
},
{
"docid": "f5fbfb7f520e270e166f450836bf90ca",
"score": "0.62095445",
"text": "def show(id)\n @role = Locomotive::Role.get(id)\n raise NotFound unless @role\n display @role\n end",
"title": ""
},
{
"docid": "ab7e569445c48863c89fd0918c3bdf76",
"score": "0.6205606",
"text": "def data\n roles.map do |role|\n [\n role.name,\n ]\n end\n end",
"title": ""
},
{
"docid": "56e8743b0fedc6813996dea7e3226d18",
"score": "0.62033856",
"text": "def role\n user.role\n end",
"title": ""
},
{
"docid": "35bf5ad3b519f2e6ed10a95dc1f41d81",
"score": "0.6197276",
"text": "def current_role\n self.class.roles[role]\n end",
"title": ""
}
] |
63682d64f80fcbfa0641691697dfda7f
|
initializes provided api_key headers and base uri should not change
|
[
{
"docid": "abb746b491c6792e442444a88bc27cf3",
"score": "0.74503994",
"text": "def initialize(api_key)\n\t\t\t@api_key = api_key\n\t\t\t@headers = {\"Accept\" => \"application/JSON\", \"user-key\" => @api_key}\n\t\t\t@base_uri = \"https://developers.zomato.com/api/v2.1/\"\n\t\tend",
"title": ""
}
] |
[
{
"docid": "ea31a03739e368af3306a829f0679432",
"score": "0.7988136",
"text": "def initialize(api_key, base_url)\n @api_key = api_key\n @base_url = base_url\n @headers = {\n 'X-Cachet-Token' => @api_key,\n 'Content-Type' => 'application/json'\n }\n end",
"title": ""
},
{
"docid": "e7e814522b126035fd707efa23d74457",
"score": "0.7890179",
"text": "def initialize\n self.class.headers.merge!({'x-api-key' => api_key})\n end",
"title": ""
},
{
"docid": "021d57937b4f553172b1bd00b4f76582",
"score": "0.7785008",
"text": "def initialize(baseuri, access_token, api_key)\n begin\n @baseuri = baseuri\n @access_token = access_token\n @api_key = api_key\n\n self.class.logger $log, :debug\n\n $log.debug(sprintf(\"%s: setting base_uri to '%s'\", __method__, @baseuri))\n self.class.base_uri @baseuri\n\n http_headers = _http_headers(@access_token)\n self.class.headers http_headers\n\n rescue StandardError => e\n $log.error(sprintf(\"%s: %s\", __method__, e.message))\n raise e\n end\n end",
"title": ""
},
{
"docid": "90a13ad5825421b69768a013c993f8b0",
"score": "0.77442145",
"text": "def initialize api_key, base_url\n @api_key = api_key\n @base_url = base_url\n end",
"title": ""
},
{
"docid": "1f8fe3c8883e942650ecc1269ebff166",
"score": "0.76454",
"text": "def initialize(api_key = nil)\n self.class.default_options[:headers] = {\"api-key\" => api_key} if api_key\n end",
"title": ""
},
{
"docid": "16e92dbaff5513ea52402497a7e86fa6",
"score": "0.7269461",
"text": "def initialize(api_token)\n @headers = { 'X-API-Key' => api_token, 'Content-Type' => 'application/json' }\n end",
"title": ""
},
{
"docid": "38a4966d0115f2c8c3cee939743e1a75",
"score": "0.7267239",
"text": "def initialize(api_key = nil)\n @api_key = api_key\n @raw_url = nil\n @raw_response = nil\n end",
"title": ""
},
{
"docid": "14596e6f3abc6483f86ae7f32d159740",
"score": "0.72313017",
"text": "def initialize(base_url, api_key)\n @base_uri = make_base_uri(base_url)\n @http = Net::HTTP.new(@base_uri.host, @base_uri.port)\n @http.use_ssl = (@base_uri.scheme == 'https')\n @http.open_timeout = OPEN_TIMEOUT\n @http.read_timeout = READ_TIMEOUT\n @request_headers = {\n 'User-Agent' => USER_AGENT,\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n }\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "0adbc5bfdecac3de935e13e67e69cee1",
"score": "0.7174216",
"text": "def initialize api_key\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "429f53a35d7bf9598394b374a9312684",
"score": "0.70702904",
"text": "def initialize(api_key, api_secret, api_url, ua_addendum=\"\")\n self.class.base_uri api_url\n self.class.headers({\n \"X-TB-PARTNER-AUTH\" => \"#{api_key}:#{api_secret}\",\n \"User-Agent\" => \"OpenTok-Ruby-SDK/#{VERSION}\" + (ua_addendum ? \" #{ua_addendum}\" : \"\")\n })\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "6024f35748b4f46df29ce0b891df26c8",
"score": "0.7051455",
"text": "def initialize(api_key)\n @api_key = api_key \n end",
"title": ""
},
{
"docid": "64d30f29544de34b549ef8d3d2d5ccf7",
"score": "0.70336765",
"text": "def initialize(api_key = 'fake_api_key')\n @api_key = api_key\n @base_url = 'https://app.scrapinghub.com/api'\n end",
"title": ""
},
{
"docid": "9f90a647dc7e6cd4917217a60e97d5d1",
"score": "0.702389",
"text": "def initialize(api_key, api_secret, api_url, ua_addendum=\"\")\n self.class.base_uri api_url\n self.class.headers({\n \"User-Agent\" => \"OpenTok-Ruby-SDK/#{VERSION}\" + \"-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\" + (ua_addendum ? \" #{ua_addendum}\" : \"\") \n })\n @api_key = api_key\n @api_secret = api_secret\n end",
"title": ""
},
{
"docid": "e2ae467e73511681acf6b1c1ec8affd9",
"score": "0.70221055",
"text": "def initialize api_key\n\t\t\t@api_key = api_key\n\t\t\t@connection = Faraday.new(BASE_URL)\n\t\tend",
"title": ""
},
{
"docid": "3b2a06c2dcc6776641d9de8745501e1a",
"score": "0.69610995",
"text": "def initialize(api_key)\n @key = api_key \n end",
"title": ""
},
{
"docid": "0211b08615253c759a876022870f4316",
"score": "0.69526476",
"text": "def initialize(api_key, logger = nil, base_url = nil, access_token = nil )\n self.api_key = api_key\n self.access_token = \n self.base_url = base_url || BASE_URL\n self.timeout = TIMEOUT\n self.logger = logger\n end",
"title": ""
},
{
"docid": "4b422ce9b7f8ce92790b903cac98c265",
"score": "0.69246876",
"text": "def initialize(api_key, subdomain)\n @api_key = api_key\n @subdomain = subdomain\n \n self.class.base_uri \"https://#{@subdomain}.chargify.com\"\n self.class.basic_auth @api_key, 'x'\n \n end",
"title": ""
},
{
"docid": "4b422ce9b7f8ce92790b903cac98c265",
"score": "0.69246876",
"text": "def initialize(api_key, subdomain)\n @api_key = api_key\n @subdomain = subdomain\n \n self.class.base_uri \"https://#{@subdomain}.chargify.com\"\n self.class.basic_auth @api_key, 'x'\n \n end",
"title": ""
},
{
"docid": "493a9ede61b5b499b4c76e744d84d206",
"score": "0.6924274",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "493a9ede61b5b499b4c76e744d84d206",
"score": "0.6924274",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "493a9ede61b5b499b4c76e744d84d206",
"score": "0.6924274",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "7ace991c19242b3cfdf2f540be8f76f1",
"score": "0.69166887",
"text": "def initialize(key = nil)\n\t\t@key = key\n\t\t@base_url = \"http://rajaongkir.com/api/\"\n\tend",
"title": ""
},
{
"docid": "3641fa889ec35b2880d730aa9af4cc2f",
"score": "0.6915962",
"text": "def initialize(params)\n\n fail 'missing API Base URL' if params[:api_base_url].nil?\n fail 'missing API Key' if params[:api_key].nil?\n fail 'missing API Secret' if params[:api_secret].nil?\n\n params[:api_base_url] = sanitize_api_base_url(params[:api_base_url])\n\n @http_helper = OSTSdk::Util::HTTPHelper.new(params)\n\n end",
"title": ""
},
{
"docid": "b1d1ec3d6c2c73ca77e94396274ce86d",
"score": "0.6915759",
"text": "def initialize(api_key:)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "acd58f08e286b1379ba8546b3a0ce3fc",
"score": "0.6903703",
"text": "def initialize\n @api_key = nil\n end",
"title": ""
},
{
"docid": "ab2606ff1a2e251cc3dd01437c4d1f74",
"score": "0.68993",
"text": "def initialize(api_key = @api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "9c02744c35fa306aebddec0251bb24a4",
"score": "0.6895936",
"text": "def initialize(api_key)\n self.class.default_params({\n apiVersion: '2.1',\n key: api_key\n })\n end",
"title": ""
},
{
"docid": "0537461503189c6e9e2e31ec47ec7b94",
"score": "0.68896526",
"text": "def initialize(api_key)\n @key = api_key\n end",
"title": ""
},
{
"docid": "ab0bcce807984811ccecc8139cf56205",
"score": "0.6873348",
"text": "def initialize(api_key, options = {})\n raise Zvent::NoApiKeyError.new if !api_key || api_key.strip.empty?\n @api_key = api_key\n @base_url = options[:base_url] || DEFAULT_BASE_URL\n end",
"title": ""
},
{
"docid": "ce7ad4c63d8aeddfc6d7afdae6743595",
"score": "0.6866561",
"text": "def initialize(api_key)\n self.api_key = api_key\n end",
"title": ""
},
{
"docid": "7f9d38f6717bb357ef8a02636a516409",
"score": "0.6864672",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "7f9d38f6717bb357ef8a02636a516409",
"score": "0.6864672",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "7f9d38f6717bb357ef8a02636a516409",
"score": "0.6864672",
"text": "def initialize(api_key)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "35d360503f0907f0a73cd5aa1d156bb9",
"score": "0.6863542",
"text": "def initialize(key=\"\")\n @api_key = key\n end",
"title": ""
},
{
"docid": "5d31849df190c654246d478a12310a29",
"score": "0.68530756",
"text": "def initialize(api_key)\n @api_key = api_key\n\n self.class.base_uri \"https://mmjmenu.com/api/v1\"\n self.class.basic_auth @api_key, 'x'\n\n end",
"title": ""
},
{
"docid": "c4295497b289ab3539dbe3ef7ef4fc57",
"score": "0.6831925",
"text": "def initialize\n @_apikeys = {}\n end",
"title": ""
},
{
"docid": "d32ce1ef50327d7acd5011114aaba817",
"score": "0.6828433",
"text": "def initialize(api_key: nil)\r\n Configuration.api_key = api_key if\r\n api_key\r\n end",
"title": ""
},
{
"docid": "cb4c1961a882bdb044b343e674146ff9",
"score": "0.682751",
"text": "def initialize(params)\n\n fail 'missing API Base URL' if params[:api_base_url].nil?\n fail 'missing API Key' if params[:api_key].nil?\n fail 'missing API Secret' if params[:api_secret].nil?\n\n params[:api_base_url] = sanitize_api_base_url(params[:api_base_url])\n\n @http_helper = OstKycSdkRuby::Util::HTTPHelper.new(params)\n\n end",
"title": ""
},
{
"docid": "c957ac085ade2536a31ac9dc0f185c36",
"score": "0.6820788",
"text": "def initialize(api_key, app_name)\n @auth_key = nil\n @api_key = api_key\n @app_name = app_name\n @host = 'http://30boxes.com'\n @api_path = '/api/api.php'\n end",
"title": ""
},
{
"docid": "0a3fcc8355141a4ce22111fd5435c199",
"score": "0.6801033",
"text": "def initialize(api_key: 'enter-api-key')\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "9a276a31c7e0c7bc0c5a798bf2b004af",
"score": "0.6786502",
"text": "def initialize(key, base_url)\n @key = key\n @base_url = Normalize.normalize(base_url, :url)\n end",
"title": ""
},
{
"docid": "ccecc85bca793da99907deaedaf1ced4",
"score": "0.6772694",
"text": "def initialize(api_key, path = Sift.current_rest_api_path)\n @api_key = api_key.to_s\n @path = path\n raise(RuntimeError, \"api_key is required\") if @api_key.nil? || @api_key.empty?\n end",
"title": ""
},
{
"docid": "d427536d8a6e453f3f7d7c6947fc5d81",
"score": "0.67701966",
"text": "def initialize\n @auth_token = (ENV['HAKIRI_AUTH_TOKEN'] or nil)\n @headers = { 'X-AUTH-TOKEN' => @auth_token }\n @api_url = (ENV['HAKIRI_API_URL'] or 'https://hakiri.io/api/v1')\n end",
"title": ""
},
{
"docid": "0388878f315f843ed74a6e7a1b295024",
"score": "0.67662615",
"text": "def initialize(api_key_or_params={})\n @host = HOST_URL\n @api = API_PATH\n @verify_ssl = true\n api_key_or_params={} if api_key_or_params.nil? # fix for nil value as argument\n api_key_or_params = {:api_key => api_key_or_params} if api_key_or_params.is_a?(String)\n api_key_or_params = Config.get if Config.parsed? and api_key_or_params.empty?\n set_up_configuration api_key_or_params if api_key_or_params.is_a? Hash\n end",
"title": ""
},
{
"docid": "107b8caa3cd96aaa88f3cbc82e1f7187",
"score": "0.6763408",
"text": "def initialize(api_key:)\n @route = [DARKSKY_API_URL, api_key].join('/')\n rescue\n raise Error::NoConnection, 'Not enough parameters to establish connection'\n end",
"title": ""
},
{
"docid": "9cebd7235a24205f08dcd890d8735c6a",
"score": "0.67555773",
"text": "def initialize(api_key: nil)\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "8b6d102efcc7d8e60adba07a1cf4616c",
"score": "0.67554843",
"text": "def initialize base_url, api_key\n\t\t\t\t\t@connection = Freshdesk::Api::Client::Request.new base_url, api_key\n\t\t\t\tend",
"title": ""
},
{
"docid": "8b6d102efcc7d8e60adba07a1cf4616c",
"score": "0.67554843",
"text": "def initialize base_url, api_key\n\t\t\t\t\t@connection = Freshdesk::Api::Client::Request.new base_url, api_key\n\t\t\t\tend",
"title": ""
},
{
"docid": "8b6d102efcc7d8e60adba07a1cf4616c",
"score": "0.67554843",
"text": "def initialize base_url, api_key\n\t\t\t\t\t@connection = Freshdesk::Api::Client::Request.new base_url, api_key\n\t\t\t\tend",
"title": ""
},
{
"docid": "f5df2dcb0097d0d520dbb05a8dc97993",
"score": "0.6748217",
"text": "def initialize(apikey = nil)\n @apikey = apikey\n end",
"title": ""
},
{
"docid": "fad7afe331eefa4296fed4a8675d4839",
"score": "0.67446357",
"text": "def initialize(api_key, api_signature, environment = \"LIVE\")\n @api_key = api_key\n @api_signature = api_signature\n $environment = environment.upcase\n # Set API base environment for selected environment\n case $environment\n when \"LIVE\"\n @api_base = LIVE_API_BASE_URL\n when \"TEST\"\n @api_base = SANDBOX_API_BASE_URL\n else\n fail \"`environment` must be either LIVE or TEST\"\n end\n end",
"title": ""
},
{
"docid": "0669468500e7f7d6de1e2917aca19a31",
"score": "0.67367744",
"text": "def initialize(knowledgebase_id, subscription_key)\n @knowledgebase_id = knowledgebase_id\n @subscription_key = subscription_key\n @http = HTTP.headers('Ocp-Apim-Subscription-Key' => @subscription_key)\n end",
"title": ""
},
{
"docid": "1154fd378283935c472b368c7ea0c577",
"score": "0.6727405",
"text": "def initialize(params)\n\n fail 'missing API Base URL' if params[:api_base_url].nil?\n fail 'missing API Key' if params[:api_key].nil?\n fail 'missing API Secret' if params[:api_secret].nil?\n\n params[:api_base_url] = params[:api_base_url].gsub(/\\/$/, '') # remove trailing slash\n params[:api_spec] = false if params[:api_spec].nil?\n\n set_manifest(params)\n\n end",
"title": ""
},
{
"docid": "68b2333f202c4ca7979f3b2527502ba7",
"score": "0.67109144",
"text": "def initialize(id, key)\n @api_id = id\n @api_key = key\n\n setup\n end",
"title": ""
},
{
"docid": "24f09ed2af08e4d796c21a43f68980e8",
"score": "0.6687545",
"text": "def initialize(api_token:)\n @base_url = BASE_URL\n @api_token = api_token\n end",
"title": ""
},
{
"docid": "8a29b4b910c4a4b9ec1ddc60d4915238",
"score": "0.6686234",
"text": "def initialize(api_key:, access_token:, environment:)\n @api_key = api_key\n @access_token = access_token\n @environment = environment\n\n @configuration = Utils.to_openstruct(DEFAULT_CONFIGURATION)\n\n validate_configuration!\n set_headers\n end",
"title": ""
},
{
"docid": "51ff8b6044f8ca40fb2b8b595b7e5b2f",
"score": "0.667227",
"text": "def _initialize_headers\n {}\n end",
"title": ""
},
{
"docid": "8f7ea28dec1d731050e03f713f6a2475",
"score": "0.66611373",
"text": "def initialize(api_key, api_endpoint = 'http://webthumb.bluga.net/api.php')\n raise WebthumbException.new('Need an not nil and not blank api_key') if api_key == nil || api_key == ''\n @api_key = api_key\n @api_endpoint = api_endpoint\n @api_uri = URI.parse(@api_endpoint)\n end",
"title": ""
},
{
"docid": "fcdbed22bb9a31a7a109f57b15c07c16",
"score": "0.6656294",
"text": "def initialize(api_key = 'adc2bed5d8c04c25a858a718b7d2df5a')\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "bdb0ae4d5135f9da4a3d24343bfdedca",
"score": "0.66453683",
"text": "def initialize(apikey)\n raise ArgumentError, 'You must provide an API Key' if apikey.blank?\n self.class.default_params :apikey => apikey\n end",
"title": ""
},
{
"docid": "bdb0ae4d5135f9da4a3d24343bfdedca",
"score": "0.66453683",
"text": "def initialize(apikey)\n raise ArgumentError, 'You must provide an API Key' if apikey.blank?\n self.class.default_params :apikey => apikey\n end",
"title": ""
},
{
"docid": "2491f468065e45607940c0cfcbaa9557",
"score": "0.6625906",
"text": "def initialize(api_key)\n @api_key = api_key\n @url = URI.parse \"http://clients.multimap.com/API/geocode/1.2/#{@api_key}\"\n end",
"title": ""
},
{
"docid": "7cb4a256d78719fb5176d1044da0fbd3",
"score": "0.6625475",
"text": "def auth_headers\n { \"X-Api-Key\" => client_apps(:default).api_key }\n end",
"title": ""
},
{
"docid": "151df37f5c0e70cf16dddd7f0747d023",
"score": "0.66219866",
"text": "def initialize (api_key, domain)\n\t @api = api_key\n\t @domain = domain\n\tend",
"title": ""
},
{
"docid": "bfd5c0dd3c6df4607d6496cf3e6755e9",
"score": "0.66201746",
"text": "def initialize(api_key=nil, endpoint=nil)\n @api_key = api_key\n @api_key ||= Hockeydeploy.api_key\n @endpoint = endpoint\n @endpoint ||= Hockeydeploy.endpoint\n \n @options = { :headers => {'X-HockeyAppToken' => @api_key} }\n end",
"title": ""
},
{
"docid": "447d231976e21eff4bd5b0e7666f0b5b",
"score": "0.6600988",
"text": "def initialize(key = '', env = :test)\n @key = key\n env = env.to_sym\n @auth = { username: @key, password: '' }\n @base_url = if env == :live\n 'https://api.pin.net.au/1/'\n else\n 'https://test-api.pin.net.au/1/'\n end\n end",
"title": ""
},
{
"docid": "1f25863466e5cf1e4d0c330de8c37227",
"score": "0.6591164",
"text": "def initialize(api_key = nil)\n @options = {}\n @options << {:api_key => api_key} if api_key\n end",
"title": ""
},
{
"docid": "30fbd96df8a5af7d0d6f45471b89c408",
"score": "0.6587763",
"text": "def initialize(api_key, email = nil)\n\n @params = Hash.new\n\n if email.nil?\n @params[:api_key] = api_key\n else\n @params[:api_key] = api_key\n @params[:email] = email\n end\n\n end",
"title": ""
},
{
"docid": "312da0a94f04907cb0ffc4209e0f7375",
"score": "0.65788496",
"text": "def initialize(params, api_key)\n @params = params\n @api_key = api_key\n end",
"title": ""
},
{
"docid": "6394131e13047b1302346f3fd6d107ff",
"score": "0.6578041",
"text": "def initialize\n @headers = {\n \"X-Token\": ENV['X_TOKEN'],\n \"Content-Type\": \"application/json\"\n }\n end",
"title": ""
},
{
"docid": "7cfc5425655597bf6b3145abf57968d6",
"score": "0.6575829",
"text": "def initialize\n @api_key ||= DEFAULT_DEVELOPMENT_API_KEY\n end",
"title": ""
},
{
"docid": "0f4682d7d07b54629522a9f0407a876d",
"score": "0.6574234",
"text": "def initialize(url, key)\n @api_uri = UriHandler.api_uri url\n @key = key\n @client = RestClient::Resource.new api_uri, user: key, password: ''\n end",
"title": ""
},
{
"docid": "0a5dc771ed2a3a59fa535ae74b5b2a62",
"score": "0.65726054",
"text": "def initialize(api_key, api_region = 'US')\n @api_key = api_key\n @api_host = api_host_from_region(api_region)\n end",
"title": ""
},
{
"docid": "94bd3caab1f3d61eca392c28919ecb3b",
"score": "0.6572411",
"text": "def initialize api_key, region\n @api_key = api_key\n @region = region \n end",
"title": ""
},
{
"docid": "ed61569a07545a383ba161af9d0ed51f",
"score": "0.65713596",
"text": "def initialize(api_key, application, provider_key = nil)\n @api_key, @application, @provider_key = api_key, application, provider_key\n end",
"title": ""
},
{
"docid": "3f6394d8908298e88f2f0afb0b8e101b",
"score": "0.6566114",
"text": "def initialize(api_key=nil)\n @api_key = api_key || self.class.api_key\n @base_url = 'http://beta.yle.fi/api/ttvcontent/'\n end",
"title": ""
},
{
"docid": "29fa1e9b5567cc0652dea3f92ac788d5",
"score": "0.6564119",
"text": "def set_headers(req, api_key)\n req['Api-Key'] = api_key\n req['Content-Type'] = 'application/json'\n end",
"title": ""
},
{
"docid": "078b5dfaa9c2f61062875f629f161c32",
"score": "0.65387625",
"text": "def initialize(api_token)\n\t\t@api_endpoint = 'https://api.wheniwork.com/2' if @api_endpoint.nil?\n\t\t@api_headers = [] if @api_headers.nil?\n\t\t@verify_ssl = false if @verify_ssl.nil?\n\n\t\t@api_token = api_token\n\tend",
"title": ""
},
{
"docid": "739d2c7ffa1d29610c14f9a6c6dfed2c",
"score": "0.6533543",
"text": "def initialize(api_key, user_token)\n @api_key = api_key\n @user_token = user_token\n end",
"title": ""
},
{
"docid": "2271852173b1cb9a77b1f0930b12a09c",
"score": "0.652909",
"text": "def initialize_http_header(initheader)\n super\n set_headers_for_body\n end",
"title": ""
},
{
"docid": "68de29cce0f995c2ae159abe7d4a5e02",
"score": "0.6517838",
"text": "def initialize\n @format = 'json'\n @scheme = 'https'\n @host = ''\n @base_path = '/api'\n @user_agent = \"ruby-swagger-#{Swagger::VERSION}\"\n @inject_format = false\n @force_ending_format = false\n\n @default_headers = {\n 'Content-Type' => \"application/#{@format.downcase}\",\n 'User-Agent' => @user_agent\n }\n\n # keys for API key authentication (param-name => api-key)\n @api_key = {}\n @api_key_prefix = {}\n\n @verify_ssl = true\n\n @debug = false\n @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)\n end",
"title": ""
},
{
"docid": "13e276db76148b3cdadc1fc94a41a0f0",
"score": "0.65167004",
"text": "def initialize\n @api_key = ENV['PRINTFUL_API_KEY']\n end",
"title": ""
},
{
"docid": "8836ceb40ef180447738236f73379961",
"score": "0.64994544",
"text": "def initialize(api_key, shared_secret)\n @api_key = api_key\n @shared_secret = shared_secret\n end",
"title": ""
},
{
"docid": "3e3cc83dfbc580b4e10fb6ed38f1d12a",
"score": "0.6478711",
"text": "def initialize(key: ENV['SHODAN_API_KEY'])\n raise \"No API key has been found or provided! ( setup your SHODAN_API_KEY environment varialbe )\" if key.nil?\n # pass the given API key to each of the underlying clients\n #\n # Note: you can optionally change these API keys later, if you\n # had multiple for whatever reason. ;)\n #\n @rest_api = Shodanz.api.rest.new(key: key)\n @streaming_api = Shodanz.api.streaming.new(key: key)\n @exploits_api = Shodanz.api.exploits.new(key: key)\n end",
"title": ""
},
{
"docid": "a357434605c8002ade821d3fe5c6f8e6",
"score": "0.64764184",
"text": "def initialize(url, key)\n @api_uri = UriHandler.api_uri url\n @key = key\n @resources_res = RestClient::Resource.new @api_uri, user: @key, password: ''\n end",
"title": ""
},
{
"docid": "a357434605c8002ade821d3fe5c6f8e6",
"score": "0.64764184",
"text": "def initialize(url, key)\n @api_uri = UriHandler.api_uri url\n @key = key\n @resources_res = RestClient::Resource.new @api_uri, user: @key, password: ''\n end",
"title": ""
},
{
"docid": "26c45fd3eaa98b611414929f71585010",
"score": "0.64632213",
"text": "def set_auth_header\n request.headers[\"X-Sicario-Authorization\"] = ENV['APIKEY']\n end",
"title": ""
},
{
"docid": "69ecec92f827cdab7659818d311aa967",
"score": "0.6458049",
"text": "def initialize(api_key, &block)\n @api_key = api_key\n @faraday_configuration = block\n @http = Faraday.new(\"https://api.orchestrate.io\") do |faraday|\n block = lambda{|f| f.adapter :net_http_persistent } unless block\n block.call faraday\n\n # faraday seems to want you do specify these twice.\n faraday.request :basic_auth, api_key, ''\n faraday.basic_auth api_key, ''\n end\n end",
"title": ""
},
{
"docid": "4d00810c36b6a0f153818a93ceb58a7e",
"score": "0.64528376",
"text": "def initialize(api_key, api_secret )\n @auth = {:username => api_key, :password => api_secret}\n end",
"title": ""
},
{
"docid": "bd4ae31a51e40aeca05960b11dd50890",
"score": "0.64500993",
"text": "def initialize api_key: default_api_key, adapter: Faraday.default_adapter\n\n @library = {\n system: public_client(adapter),\n market: public_client(adapter),\n chart: public_client(adapter),\n trading: auth_client(api_key, adapter),\n wallet: auth_client(api_key, adapter),\n }\n end",
"title": ""
},
{
"docid": "3f798ff31b7891ffcc5fc39d9d7dfaa1",
"score": "0.64448816",
"text": "def build_headers(include_api = true)\n {}\nend",
"title": ""
},
{
"docid": "81fade9260769d20ba5c871a9ed89458",
"score": "0.6443133",
"text": "def initialize(api_key=nil)\n @api_key = api_key\n @api_key ||= Remixr.api_key\n \n @api_path = ''\n @store_filters = {}\n @product_filters = {}\n end",
"title": ""
},
{
"docid": "ab06fc7a7709dcebf9248e8531e1f5a3",
"score": "0.6439393",
"text": "def initialize(api_key)\n raise ArgumentError, 'api_key is required' if api_key == nil || api_key.empty?\n Klout.api_key = api_key\n end",
"title": ""
},
{
"docid": "ac3154bc30036e4cd77bbc5350590ff9",
"score": "0.6436333",
"text": "def initialize\n @headers = {\n \"Authorization\" => \"token #{ENV[\"AUTH_TOKEN\"]}\",\n \"User-Agent\" => \"HTTParty\"\n }\n end",
"title": ""
},
{
"docid": "b9f1914b5a2013ee3b710af3746ea0f5",
"score": "0.6434371",
"text": "def initialize(url, api_key)\n @client = Client.new(api_key, url + \"/#{API_ROOT}\")\n end",
"title": ""
},
{
"docid": "37cb65c753fe6a76245b097e86da8b56",
"score": "0.64294595",
"text": "def initialize( api_key, endpoint=DEFAULT_ENDPOINT, options={} )\n\t\tif endpoint.is_a?( Hash )\n\t\t\toptions = endpoint\n\t\t\tendpoint = DEFAULT_ENDPOINT\n\t\tend\n\n\t\tsuper( endpoint, options )\n\n\t\t@api_key = api_key\n\t\t@hostname = Socket.gethostname\n\tend",
"title": ""
},
{
"docid": "46f02a185d1d0be8cff8680440cf8f60",
"score": "0.64143145",
"text": "def initialize(api_key, secret, api_uri)\n @api_key = api_key\n @secret = secret\n @api_uri = api_uri\n end",
"title": ""
},
{
"docid": "401eefc19b600fe67f171f2a9907ddd6",
"score": "0.6411617",
"text": "def initialize\n @headers = {\n \"Authorization\" => \"token #{ENV[\"AUTH_TOKEN\"]}\",\n \"User-Agent\" => \"HTTParty\"\n }\n end",
"title": ""
},
{
"docid": "401eefc19b600fe67f171f2a9907ddd6",
"score": "0.6411617",
"text": "def initialize\n @headers = {\n \"Authorization\" => \"token #{ENV[\"AUTH_TOKEN\"]}\",\n \"User-Agent\" => \"HTTParty\"\n }\n end",
"title": ""
},
{
"docid": "e83887c83784bcc1ab2aaccae2f03ad8",
"score": "0.6411464",
"text": "def initialize(api_key, secret, format_options={})\n @auth = { :api_key => api_key }\n @secret = secret\n end",
"title": ""
}
] |
0afb35cbad2b599affc466723ca7ef30
|
I just kind of arbitrarily picked this because all the empty images I saw were < 1000 bytes
|
[
{
"docid": "ce35badb4c2a8212b6eb0856842bfc8a",
"score": "0.5446044",
"text": "def better?(new_image)\n image.size < MIN_GOOD_IMAGE_SIZE &&\n new_image.size > image.size\n end",
"title": ""
}
] |
[
{
"docid": "af59c69684d340a00149e10c19f5f447",
"score": "0.6285769",
"text": "def test_07b\r\n db = build\r\n db.fetch('image-1.jpg',:width => 102)\r\n assert_equal 6,db.images.size\r\n assert_equal 1,db.image('image-1.jpg')[:widths].size\r\n r = db.delete('image-1.jpg',:width => 102)\r\n assert_equal 6,db.images.size # Original still there\r\n assert_equal 0,db.image('image-1.jpg')[:widths].size\r\n # Sized version is not there\r\n end",
"title": ""
},
{
"docid": "eae6281f53fc6ea9d6d993117f5e0b0b",
"score": "0.6211468",
"text": "def image\n 0\n end",
"title": ""
},
{
"docid": "cd0def74d7895e462ed8d665f7c8572e",
"score": "0.61912656",
"text": "def filter_by_filesize(images, min_bytes, max_bytes)\n found = 0\n images.map do |image|\n bytes = get_bytes_for_image image\n log \"%s bytes - %s\" % [bytes, image]\n if found < 20 and bytes and (bytes == 0 or bytes > min_bytes) and bytes < max_bytes\n log \"filter_by_filesize: Found potential image - size: #{bytes} bytes, src: #{image}\"\n found += 1\n image\n else\n nil\n end\n end.compact\n end",
"title": ""
},
{
"docid": "3deb46d68ef5ff04316df7e52edc520c",
"score": "0.618777",
"text": "def no_cards_image \n scryfall.card_code_number('sok', 84)['image_uris']['large']\n end",
"title": ""
},
{
"docid": "4a66ecaa268329cc3ebaf2a3d0bbeea1",
"score": "0.61561763",
"text": "def test_07a\r\n db = build\r\n db.fetch('image-1.jpg',:width => 102)\r\n db.fetch('image-1.jpg',:width => 103)\r\n db.fetch('image-1.jpg',:width => 104)\r\n assert_equal 6,db.images.size\r\n assert_equal 3,db.image('image-1.jpg')[:widths].size\r\n r = db.delete('image-1.jpg')\r\n assert_equal 5,db.images.size # 5 originals left\r\n assert_equal nil,db.image('image-1.jpg')\r\n end",
"title": ""
},
{
"docid": "01c2d5998d47354c3c1a88b0a0deece0",
"score": "0.6048751",
"text": "def test_data_img_no_size\n output = tested('data_img_no_size rms.jpg')\n\n assert errors_ok? output\n\n assert_equal '(max-width: 600px) 80vw, 50%',\n output.at_css('img')['sizes']\n end",
"title": ""
},
{
"docid": "1e0a3e0e411be0a99ff90b3d55df772f",
"score": "0.60416883",
"text": "def test_that_grids_do_not_work_for_small_imgs\n end",
"title": ""
},
{
"docid": "cdaf3e6c4db2965c372840a10e80902c",
"score": "0.5999836",
"text": "def not_found_image\n scryfall.card_code_number('5dn', 52)['image_uris']['large']\n end",
"title": ""
},
{
"docid": "4a059bfb9b09ae17919183696c3178f8",
"score": "0.5930239",
"text": "def first_available_image\n image = %w[o s m l].each do |size|\n field = \"size_#{size}\"\n value = send(field)\n return \"#{id}-#{size}.#{img_type}\" if value.present?\n end\nend",
"title": ""
},
{
"docid": "bec41e293660e12807fcab74b7862c77",
"score": "0.5915673",
"text": "def test_09b\r\n db = ITestUtils.newdb\r\n nm = File.join(test_data,'image-1.jpg')\r\n db.store(nm)\r\n db.fetch 'image-1.jpg',:width => 102\r\n r = db.fetch('image-1.jpg',:width => 103)\r\n db.fetch 'image-1.jpg',:width => 104\r\n db.hooks = hooks()\r\n db.delete 'image-1.jpg',:width => 103\r\n assert_equal 1,db.hooks.count[:deletes]\r\n assert_equal r,db.hooks.params[:sized].first\r\n #assert_equal File.basename(r),db.hooks.params[:sized].first\r\n assert_equal 1,db.hooks.params[:sized].size\r\n end",
"title": ""
},
{
"docid": "6df17bf61d4fd6cd0f6d6cfe991de7db",
"score": "0.58637166",
"text": "def test_oe_gn\r\n db = oe\r\n db.use_not_found = true\r\n db.not_found_image = 'notfound-not-here.jpg'\r\n assert(/orig-1.jpg/===db.fetch('orig-1.jpg'))\r\n assert !File.exists?(File.join(db.root,'w','102','orig-1.jpg'))\r\n assert(/w.102.orig-1.jpg/===db.fetch('orig-1.jpg',:width => 102))\r\n assert File.exists?(File.join(db.root,'w','102','orig-1.jpg'))\r\n assert(/w.102.orig-1.jpg/===db.fetch('orig-1.jpg',:width => 102))\r\n assert(/w.112.notfound-not-here.jpg/===\r\n db.fetch('orig-1.jpg',\r\n :width => 112,\r\n :resize => false))\r\n assert(/w.102.orig-1.jpg/===\r\n db.fetch('orig-1.jpg',\r\n :width => 102,\r\n :resize => false))\r\n end",
"title": ""
},
{
"docid": "a07ece23f48efd9d8f54ed5e500a4e58",
"score": "0.5845618",
"text": "def official_minimal\n @images.select do |img|\n img[\"official\"] == true &&\n img[\"virtual_size\"] != 0\n end.sort_by do |img|\n img[\"disk_size\"]\n end.first[\"id\"]\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "015e39673efe1c9b9221b64b05b57642",
"score": "0.5804745",
"text": "def test_06a\r\n db = build\r\n assert_equal 6,db.images.size\r\n end",
"title": ""
},
{
"docid": "63a3335538507c3dc9758b8de92759c6",
"score": "0.5784283",
"text": "def imagemagick7?; end",
"title": ""
},
{
"docid": "c96c642ccd096f970993cc75230dc80e",
"score": "0.57764417",
"text": "def image(size: T.unsafe(nil), search_terms: T.unsafe(nil), match_all: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "783b1128040d6bd17e7284fce5ec6666",
"score": "0.5773808",
"text": "def test_progressive_dct_based_jpeg_image\n testname = '35w x 35h progressive jpeg image.'\n data = %w(\n FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 96\n 00 96 00 00 FF E1 04 E7 45 78 69 66 00 00 4D 4D\n 00 2A 00 00 00 08 00 07 01 12 00 03 00 00 00 01\n 00 01 00 00 01 1A 00 05 00 00 00 01 00 00 00 62\n 01 1B 00 05 00 00 00 01 00 00 00 6A 01 28 00 03\n 00 00 00 01 00 02 00 00 01 31 00 02 00 00 00 14\n 00 00 00 72 01 32 00 02 00 00 00 14 00 00 00 86\n 87 69 00 04 00 00 00 01 00 00 00 9C 00 00 00 C8\n 00 00 00 96 00 00 00 01 00 00 00 96 00 00 00 01\n 41 64 6F 62 65 20 50 68 6F 74 6F 73 68 6F 70 20\n 37 2E 30 00 32 30 30 38 3A 30 39 3A 30 39 20 32\n 32 3A 32 33 3A 31 32 00 00 00 00 03 A0 01 00 03\n 00 00 00 01 FF FF 00 00 A0 02 00 04 00 00 00 01\n 00 00 00 23 A0 03 00 04 00 00 00 01 00 00 00 23\n 00 00 00 00 00 00 00 06 01 03 00 03 00 00 00 01\n 00 06 00 00 01 1A 00 05 00 00 00 01 00 00 01 16\n 01 1B 00 05 00 00 00 01 00 00 01 1E 01 28 00 03\n 00 00 00 01 00 02 00 00 02 01 00 04 00 00 00 01\n 00 00 01 26 02 02 00 04 00 00 00 01 00 00 03 B9\n 00 00 00 00 00 00 00 48 00 00 00 01 00 00 00 48\n 00 00 00 01 FF D8 FF E0 00 10 4A 46 49 46 00 01\n 02 01 00 48 00 48 00 00 FF ED 00 0C 41 64 6F 62\n 65 5F 43 4D 00 02 FF EE 00 0E 41 64 6F 62 65 00\n 64 80 00 00 00 01 FF DB 00 84 00 0C 08 08 08 09\n 08 0C 09 09 0C 11 0B 0A 0B 11 15 0F 0C 0C 0F 15\n 18 13 13 15 13 13 18 11 0C 0C 0C 0C 0C 0C 11 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 01 0D 0B 0B 0D\n 0E 0D 10 0E 0E 10 14 0E 0E 0E 14 14 0E 0E 0E 0E\n 14 11 0C 0C 0C 0C 0C 11 11 0C 0C 0C 0C 0C 0C 11\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C FF C0 00 11\n 08 00 23 00 23 03 01 22 00 02 11 01 03 11 01 FF\n DD 00 04 00 03 FF C4 01 3F 00 00 01 05 01 01 01\n 01 01 01 00 00 00 00 00 00 00 03 00 01 02 04 05\n 06 07 08 09 0A 0B 01 00 01 05 01 01 01 01 01 01\n 00 00 00 00 00 00 00 01 00 02 03 04 05 06 07 08\n 09 0A 0B 10 00 01 04 01 03 02 04 02 05 07 06 08\n 05 03 0C 33 01 00 02 11 03 04 21 12 31 05 41 51\n 61 13 22 71 81 32 06 14 91 A1 B1 42 23 24 15 52\n C1 62 33 34 72 82 D1 43 07 25 92 53 F0 E1 F1 63\n 73 35 16 A2 B2 83 26 44 93 54 64 45 C2 A3 74 36\n 17 D2 55 E2 65 F2 B3 84 C3 D3 75 E3 F3 46 27 94\n A4 85 B4 95 C4 D4 E4 F4 A5 B5 C5 D5 E5 F5 56 66\n 76 86 96 A6 B6 C6 D6 E6 F6 37 47 57 67 77 87 97\n A7 B7 C7 D7 E7 F7 11 00 02 02 01 02 04 04 03 04\n 05 06 07 07 06 05 35 01 00 02 11 03 21 31 12 04\n 41 51 61 71 22 13 05 32 81 91 14 A1 B1 42 23 C1\n 52 D1 F0 33 24 62 E1 72 82 92 43 53 15 63 73 34\n F1 25 06 16 A2 B2 83 07 26 35 C2 D2 44 93 54 A3\n 17 64 45 55 36 74 65 E2 F2 B3 84 C3 D3 75 E3 F3\n 46 94 A4 85 B4 95 C4 D4 E4 F4 A5 B5 C5 D5 E5 F5\n 56 66 76 86 96 A6 B6 C6 D6 E6 F6 27 37 47 57 67\n 77 87 97 A7 B7 C7 FF DA 00 0C 03 01 00 02 11 03\n 11 00 3F 00 F5 54 0B 33 71 AB 79 AC BF 75 83 53\n 5B 01 7B 84 F1 B9 95 EE 73 54 F2 1C E6 D1 63 9B\n F4 9A C7 16 FC 40 5C F7 49 B7 1A FA 19 51 BF 23\n 1B 2C B4 3A EC 7B 2D 65 76 6E 23 DC FD 06 FB 58\n FF 00 A4 CB 92 53 1E B9 F5 9B 3E 96 DB 8D 83 D3\n B2 85 A7 DB 56 53 D8 1B 5C E9 EE 0F 7E E6 37 FE\n B8 AF FD 5B FD AA 71 9E EE A2 CB 6A 26 36 D7 7B\n C5 8F 07 5D EE DE 27 F4 7F 43 E9 21 E5 D5 85 8D\n 59 39 B9 04 56 EE 45 D9 6F F7 79 7A 6D 1E FF 00\n EA AB 9D 0A C3 67 4D AC 9A AC C7 01 CF 0C A6 D2\n 4B DA D0 E7 7A 61 FE A4 BF E8 7E FA 4A 74 12 49\n 24 94 FF 00 FF D0 F5 2B DA 5D 4D 8D 1C B9 A4 7D\n E1 66 F4 FB BA 7F 50 C3 C7 17 D4 CF 59 B5 33 F4\n 57 06 97 00 47 2D 9F CC 74 7D 26 2D 55 CC 7D 61\n CD 7F 40 38 66 BA 99 76 16 4D CE AD EC B8 4B 69\n 2E 06 C6 7A 76 0F 73 37 D9 EC D8 EF EC 24 A7 61\n 95 74 7C 70 6F 6B 28 AF 61 FE 72 1B 20 8F DD 77\n D2 44 E9 97 8C 8C 63 7B 5A E6 36 CB 2C 21 AE D1\n D0 1E EA F5 1F D8 58 1F 57 FA 95 DD 6B 23 25 B5\n D5 5E 23 31 F6 13 63 1A 1E F9 70 73 76 56 F7 7B\n 6A FE 6F 7F D0 FC F5 D3 63 D1 56 3D 2C A6 A6 ED\n AD 82 1A 12 52 44 92 49 25 3F FF D1 F5 55 47 AD\n C7 EC AC AD DE 84 7A 6E 9F B5 4F A3 11 FE 1B 67\n BF 67 F5 17 CC 69 24 A7 E9 6F AB BB 7F 66 55 B7\n EC BB 60 47 D8 B7 7A 5C 7F C2 7E 93 FC F5 A8 BE\n 55 49 25 3F 55 24 BE 55 49 25 3F FF D9 FF ED 09\n 94 50 68 6F 74 6F 73 68 6F 70 20 33 2E 30 00 38\n 42 49 4D 04 25 00 00 00 00 00 10 00 00 00 00 00\n 00 00 00 00 00 00 00 00 00 00 00 38 42 49 4D 03\n ED 00 00 00 00 00 10 00 96 00 00 00 01 00 01 00\n 96 00 00 00 01 00 01 38 42 49 4D 04 26 00 00 00\n 00 00 0E 00 00 00 00 00 00 00 00 00 00 3F 80 00\n 00 38 42 49 4D 04 0D 00 00 00 00 00 04 00 00 00\n 1E 38 42 49 4D 04 19 00 00 00 00 00 04 00 00 00\n 1E 38 42 49 4D 03 F3 00 00 00 00 00 09 00 00 00\n 00 00 00 00 00 01 00 38 42 49 4D 04 0A 00 00 00\n 00 00 01 00 00 38 42 49 4D 27 10 00 00 00 00 00\n 0A 00 01 00 00 00 00 00 00 00 01 38 42 49 4D 03\n F5 00 00 00 00 00 48 00 2F 66 66 00 01 00 6C 66\n 66 00 06 00 00 00 00 00 01 00 2F 66 66 00 01 00\n A1 99 9A 00 06 00 00 00 00 00 01 00 32 00 00 00\n 01 00 5A 00 00 00 06 00 00 00 00 00 01 00 35 00\n 00 00 01 00 2D 00 00 00 06 00 00 00 00 00 01 38\n 42 49 4D 03 F8 00 00 00 00 00 70 00 00 FF FF FF\n FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n FF FF FF 03 E8 00 00 00 00 FF FF FF FF FF FF FF\n FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 03\n E8 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF\n FF FF FF FF FF FF FF FF FF FF FF 03 E8 00 00 00\n 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n FF FF FF FF FF FF FF 03 E8 00 00 38 42 49 4D 04\n 08 00 00 00 00 00 10 00 00 00 01 00 00 02 40 00\n 00 02 40 00 00 00 00 38 42 49 4D 04 1E 00 00 00\n 00 00 04 00 00 00 00 38 42 49 4D 04 1A 00 00 00\n 00 03 59 00 00 00 06 00 00 00 00 00 00 00 00 00\n 00 00 23 00 00 00 23 00 00 00 12 00 54 00 43 00\n 50 00 5F 00 43 00 69 00 72 00 63 00 6C 00 65 00\n 5F 00 42 00 61 00 6C 00 6C 00 61 00 73 00 74 00\n 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00\n 00 00 23 00 00 00 23 00 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 01\n 00 00 00 00 00 00 6E 75 6C 6C 00 00 00 02 00 00\n 00 06 62 6F 75 6E 64 73 4F 62 6A 63 00 00 00 01\n 00 00 00 00 00 00 52 63 74 31 00 00 00 04 00 00\n 00 00 54 6F 70 20 6C 6F 6E 67 00 00 00 00 00 00\n 00 00 4C 65 66 74 6C 6F 6E 67 00 00 00 00 00 00\n 00 00 42 74 6F 6D 6C 6F 6E 67 00 00 00 23 00 00\n 00 00 52 67 68 74 6C 6F 6E 67 00 00 00 23 00 00\n 00 06 73 6C 69 63 65 73 56 6C 4C 73 00 00 00 01\n 4F 62 6A 63 00 00 00 01 00 00 00 00 00 05 73 6C\n 69 63 65 00 00 00 12 00 00 00 07 73 6C 69 63 65\n 49 44 6C 6F 6E 67 00 00 00 00 00 00 00 07 67 72\n 6F 75 70 49 44 6C 6F 6E 67 00 00 00 00 00 00 00\n 06 6F 72 69 67 69 6E 65 6E 75 6D 00 00 00 0C 45\n 53 6C 69 63 65 4F 72 69 67 69 6E 00 00 00 0D 61\n 75 74 6F 47 65 6E 65 72 61 74 65 64 00 00 00 00\n 54 79 70 65 65 6E 75 6D 00 00 00 0A 45 53 6C 69\n 63 65 54 79 70 65 00 00 00 00 49 6D 67 20 00 00\n 00 06 62 6F 75 6E 64 73 4F 62 6A 63 00 00 00 01\n 00 00 00 00 00 00 52 63 74 31 00 00 00 04 00 00\n 00 00 54 6F 70 20 6C 6F 6E 67 00 00 00 00 00 00\n 00 00 4C 65 66 74 6C 6F 6E 67 00 00 00 00 00 00\n 00 00 42 74 6F 6D 6C 6F 6E 67 00 00 00 23 00 00\n 00 00 52 67 68 74 6C 6F 6E 67 00 00 00 23 00 00\n 00 03 75 72 6C 54 45 58 54 00 00 00 01 00 00 00\n 00 00 00 6E 75 6C 6C 54 45 58 54 00 00 00 01 00\n 00 00 00 00 00 4D 73 67 65 54 45 58 54 00 00 00\n 01 00 00 00 00 00 06 61 6C 74 54 61 67 54 45 58\n 54 00 00 00 01 00 00 00 00 00 0E 63 65 6C 6C 54\n 65 78 74 49 73 48 54 4D 4C 62 6F 6F 6C 01 00 00\n 00 08 63 65 6C 6C 54 65 78 74 54 45 58 54 00 00\n 00 01 00 00 00 00 00 09 68 6F 72 7A 41 6C 69 67\n 6E 65 6E 75 6D 00 00 00 0F 45 53 6C 69 63 65 48\n 6F 72 7A 41 6C 69 67 6E 00 00 00 07 64 65 66 61\n 75 6C 74 00 00 00 09 76 65 72 74 41 6C 69 67 6E\n 65 6E 75 6D 00 00 00 0F 45 53 6C 69 63 65 56 65\n 72 74 41 6C 69 67 6E 00 00 00 07 64 65 66 61 75\n 6C 74 00 00 00 0B 62 67 43 6F 6C 6F 72 54 79 70\n 65 65 6E 75 6D 00 00 00 11 45 53 6C 69 63 65 42\n 47 43 6F 6C 6F 72 54 79 70 65 00 00 00 00 4E 6F\n 6E 65 00 00 00 09 74 6F 70 4F 75 74 73 65 74 6C\n 6F 6E 67 00 00 00 00 00 00 00 0A 6C 65 66 74 4F\n 75 74 73 65 74 6C 6F 6E 67 00 00 00 00 00 00 00\n 0C 62 6F 74 74 6F 6D 4F 75 74 73 65 74 6C 6F 6E\n 67 00 00 00 00 00 00 00 0B 72 69 67 68 74 4F 75\n 74 73 65 74 6C 6F 6E 67 00 00 00 00 00 38 42 49\n 4D 04 11 00 00 00 00 00 01 01 00 38 42 49 4D 04\n 14 00 00 00 00 00 04 00 00 00 01 38 42 49 4D 04\n 0C 00 00 00 00 03 D5 00 00 00 01 00 00 00 23 00\n 00 00 23 00 00 00 6C 00 00 0E C4 00 00 03 B9 00\n 18 00 01 FF D8 FF E0 00 10 4A 46 49 46 00 01 02\n 01 00 48 00 48 00 00 FF ED 00 0C 41 64 6F 62 65\n 5F 43 4D 00 02 FF EE 00 0E 41 64 6F 62 65 00 64\n 80 00 00 00 01 FF DB 00 84 00 0C 08 08 08 09 08\n 0C 09 09 0C 11 0B 0A 0B 11 15 0F 0C 0C 0F 15 18\n 13 13 15 13 13 18 11 0C 0C 0C 0C 0C 0C 11 0C 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 01 0D 0B 0B 0D 0E\n 0D 10 0E 0E 10 14 0E 0E 0E 14 14 0E 0E 0E 0E 14\n 11 0C 0C 0C 0C 0C 11 11 0C 0C 0C 0C 0C 0C 11 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C\n 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C FF C0 00 11 08\n 00 23 00 23 03 01 22 00 02 11 01 03 11 01 FF DD\n 00 04 00 03 FF C4 01 3F 00 00 01 05 01 01 01 01\n 01 01 00 00 00 00 00 00 00 03 00 01 02 04 05 06\n 07 08 09 0A 0B 01 00 01 05 01 01 01 01 01 01 00\n 00 00 00 00 00 00 01 00 02 03 04 05 06 07 08 09\n 0A 0B 10 00 01 04 01 03 02 04 02 05 07 06 08 05\n 03 0C 33 01 00 02 11 03 04 21 12 31 05 41 51 61\n 13 22 71 81 32 06 14 91 A1 B1 42 23 24 15 52 C1\n 62 33 34 72 82 D1 43 07 25 92 53 F0 E1 F1 63 73\n 35 16 A2 B2 83 26 44 93 54 64 45 C2 A3 74 36 17\n D2 55 E2 65 F2 B3 84 C3 D3 75 E3 F3 46 27 94 A4\n 85 B4 95 C4 D4 E4 F4 A5 B5 C5 D5 E5 F5 56 66 76\n 86 96 A6 B6 C6 D6 E6 F6 37 47 57 67 77 87 97 A7\n B7 C7 D7 E7 F7 11 00 02 02 01 02 04 04 03 04 05\n 06 07 07 06 05 35 01 00 02 11 03 21 31 12 04 41\n 51 61 71 22 13 05 32 81 91 14 A1 B1 42 23 C1 52\n D1 F0 33 24 62 E1 72 82 92 43 53 15 63 73 34 F1\n 25 06 16 A2 B2 83 07 26 35 C2 D2 44 93 54 A3 17\n 64 45 55 36 74 65 E2 F2 B3 84 C3 D3 75 E3 F3 46\n 94 A4 85 B4 95 C4 D4 E4 F4 A5 B5 C5 D5 E5 F5 56\n 66 76 86 96 A6 B6 C6 D6 E6 F6 27 37 47 57 67 77\n 87 97 A7 B7 C7 FF DA 00 0C 03 01 00 02 11 03 11\n 00 3F 00 F5 54 0B 33 71 AB 79 AC BF 75 83 53 5B\n 01 7B 84 F1 B9 95 EE 73 54 F2 1C E6 D1 63 9B F4\n 9A C7 16 FC 40 5C F7 49 B7 1A FA 19 51 BF 23 1B\n 2C B4 3A EC 7B 2D 65 76 6E 23 DC FD 06 FB 58 FF\n 00 A4 CB 92 53 1E B9 F5 9B 3E 96 DB 8D 83 D3 B2\n 85 A7 DB 56 53 D8 1B 5C E9 EE 0F 7E E6 37 FE B8\n AF FD 5B FD AA 71 9E EE A2 CB 6A 26 36 D7 7B C5\n 8F 07 5D EE DE 27 F4 7F 43 E9 21 E5 D5 85 8D 59\n 39 B9 04 56 EE 45 D9 6F F7 79 7A 6D 1E FF 00 EA\n AB 9D 0A C3 67 4D AC 9A AC C7 01 CF 0C A6 D2 4B\n DA D0 E7 7A 61 FE A4 BF E8 7E FA 4A 74 12 49 24\n 94 FF 00 FF D0 F5 2B DA 5D 4D 8D 1C B9 A4 7D E1\n 66 F4 FB BA 7F 50 C3 C7 17 D4 CF 59 B5 33 F4 57\n 06 97 00 47 2D 9F CC 74 7D 26 2D 55 CC 7D 61 CD\n 7F 40 38 66 BA 99 76 16 4D CE AD EC B8 4B 69 2E\n 06 C6 7A 76 0F 73 37 D9 EC D8 EF EC 24 A7 61 95\n 74 7C 70 6F 6B 28 AF 61 FE 72 1B 20 8F DD 77 D2\n 44 E9 97 8C 8C 63 7B 5A E6 36 CB 2C 21 AE D1 D0\n 1E EA F5 1F D8 58 1F 57 FA 95 DD 6B 23 25 B5 D5\n 5E 23 31 F6 13 63 1A 1E F9 70 73 76 56 F7 7B 6A\n FE 6F 7F D0 FC F5 D3 63 D1 56 3D 2C A6 A6 ED AD\n 82 1A 12 52 44 92 49 25 3F FF D1 F5 55 47 AD C7\n EC AC AD DE 84 7A 6E 9F B5 4F A3 11 FE 1B 67 BF\n 67 F5 17 CC 69 24 A7 E9 6F AB BB 7F 66 55 B7 EC\n BB 60 47 D8 B7 7A 5C 7F C2 7E 93 FC F5 A8 BE 55\n 49 25 3F 55 24 BE 55 49 25 3F FF D9 00 38 42 49\n 4D 04 21 00 00 00 00 00 55 00 00 00 01 01 00 00\n 00 0F 00 41 00 64 00 6F 00 62 00 65 00 20 00 50\n 00 68 00 6F 00 74 00 6F 00 73 00 68 00 6F 00 70\n 00 00 00 13 00 41 00 64 00 6F 00 62 00 65 00 20\n 00 50 00 68 00 6F 00 74 00 6F 00 73 00 68 00 6F\n 00 70 00 20 00 37 00 2E 00 30 00 00 00 01 00 38\n 42 49 4D 04 06 00 00 00 00 00 07 00 08 01 01 00\n 01 01 00 FF E1 12 48 68 74 74 70 3A 2F 2F 6E 73\n 2E 61 64 6F 62 65 2E 63 6F 6D 2F 78 61 70 2F 31\n 2E 30 2F 00 3C 3F 78 70 61 63 6B 65 74 20 62 65\n 67 69 6E 3D 27 EF BB BF 27 20 69 64 3D 27 57 35\n 4D 30 4D 70 43 65 68 69 48 7A 72 65 53 7A 4E 54\n 63 7A 6B 63 39 64 27 3F 3E 0A 3C 3F 61 64 6F 62\n 65 2D 78 61 70 2D 66 69 6C 74 65 72 73 20 65 73\n 63 3D 22 43 52 22 3F 3E 0A 3C 78 3A 78 61 70 6D\n 65 74 61 20 78 6D 6C 6E 73 3A 78 3D 27 61 64 6F\n 62 65 3A 6E 73 3A 6D 65 74 61 2F 27 20 78 3A 78\n 61 70 74 6B 3D 27 58 4D 50 20 74 6F 6F 6C 6B 69\n 74 20 32 2E 38 2E 32 2D 33 33 2C 20 66 72 61 6D\n 65 77 6F 72 6B 20 31 2E 35 27 3E 0A 3C 72 64 66\n 3A 52 44 46 20 78 6D 6C 6E 73 3A 72 64 66 3D 27\n 68 74 74 70 3A 2F 2F 77 77 77 2E 77 33 2E 6F 72\n 67 2F 31 39 39 39 2F 30 32 2F 32 32 2D 72 64 66\n 2D 73 79 6E 74 61 78 2D 6E 73 23 27 20 78 6D 6C\n 6E 73 3A 69 58 3D 27 68 74 74 70 3A 2F 2F 6E 73\n 2E 61 64 6F 62 65 2E 63 6F 6D 2F 69 58 2F 31 2E\n 30 2F 27 3E 0A 0A 20 3C 72 64 66 3A 44 65 73 63\n 72 69 70 74 69 6F 6E 20 61 62 6F 75 74 3D 27 75\n 75 69 64 3A 34 37 38 34 61 35 39 66 2D 37 65 64\n 66 2D 31 31 64 64 2D 39 61 37 39 2D 61 31 62 66\n 63 38 33 61 61 63 63 36 27 0A 20 20 78 6D 6C 6E\n 73 3A 78 61 70 4D 4D 3D 27 68 74 74 70 3A 2F 2F\n 6E 73 2E 61 64 6F 62 65 2E 63 6F 6D 2F 78 61 70\n 2F 31 2E 30 2F 6D 6D 2F 27 3E 0A 20 20 3C 78 61\n 70 4D 4D 3A 44 6F 63 75 6D 65 6E 74 49 44 3E 61\n 64 6F 62 65 3A 64 6F 63 69 64 3A 70 68 6F 74 6F\n 73 68 6F 70 3A 34 37 38 34 61 35 39 64 2D 37 65\n 64 66 2D 31 31 64 64 2D 39 61 37 39 2D 61 31 62\n 66 63 38 33 61 61 63 63 36 3C 2F 78 61 70 4D 4D\n 3A 44 6F 63 75 6D 65 6E 74 49 44 3E 0A 20 3C 2F\n 72 64 66 3A 44 65 73 63 72 69 70 74 69 6F 6E 3E\n 0A 0A 3C 2F 72 64 66 3A 52 44 46 3E 0A 3C 2F 78\n 3A 78 61 70 6D 65 74 61 3E 0A 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 0A 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 0A 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0A\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 0A 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 0A 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0A\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20\n 20 20 20 20 20 20 20 20 20 0A 3C 3F 78 70 61 63\n 6B 65 74 20 65 6E 64 3D 27 77 27 3F 3E FF EE 00\n 21 41 64 6F 62 65 00 64 40 00 00 00 01 03 00 10\n 03 02 03 06 00 00 00 00 00 00 00 00 00 00 00 00\n FF DB 00 84 00 01 01 01 01 01 01 01 01 01 01 01\n 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01\n 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01\n 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 03\n 03 03 03 03 03 01 01 01 01 01 01 01 01 01 01 01\n 02 02 01 02 02 03 03 03 03 03 03 03 03 03 03 03\n 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03\n 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03\n 03 03 03 03 03 03 FF C2 00 11 08 00 23 00 23 03\n )\n @image.__send__(\"process_jpg\", [data.join('')].pack('H*'))\n assert_equal(@type, @image.type)\n assert_equal(35, @image.width)\n assert_equal(35, @image.height)\n end",
"title": ""
},
{
"docid": "57acde128ac77e1b4fe9664793e194ea",
"score": "0.57458633",
"text": "def check_for_resize; end",
"title": ""
},
{
"docid": "526d936fab65cd2e99c4be82668958bc",
"score": "0.5745092",
"text": "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end",
"title": ""
},
{
"docid": "e637488d6e5acf3dab83ef65e0943f2a",
"score": "0.5744486",
"text": "def process_small_image\n small_image.encode!(:png).convert!('-resize 50x50 -gravity center -background none -extent 50x50')\n end",
"title": ""
},
{
"docid": "03de8c8b7e027c0cf645c93a5599bc6e",
"score": "0.57180333",
"text": "def official_minimal\n @images.select do |img|\n img[\"official\"] == true &&\n img[\"status\"] == \"available\" &&\n img[\"virtual_size\"] != 0\n end.sort_by do |img|\n img[\"disk_size\"]\n end.first[\"id\"]\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "a97ed200e6fa59c7003d69a2d3627030",
"score": "0.5714984",
"text": "def available_images; Image.all - images; end",
"title": ""
},
{
"docid": "a97ed200e6fa59c7003d69a2d3627030",
"score": "0.5714984",
"text": "def available_images; Image.all - images; end",
"title": ""
},
{
"docid": "b92ad8f1f79523e8631861f057c88451",
"score": "0.57094854",
"text": "def test_06b\r\n db = build\r\n db.fetch('image-1.jpg',:width => 102)\r\n db.fetch('image-1.jpg',:width => 103)\r\n db.fetch('image-1.jpg',:width => 104)\r\n db.fetch('image-1.jpg',:height => 105)\r\n r = db.image('image-1.jpg')\r\n assert_equal 'image-1.jpg',r[:original]\r\n end",
"title": ""
},
{
"docid": "2e43d8cc5aa6685bd7c12620a58fad2d",
"score": "0.5701721",
"text": "def images; end",
"title": ""
},
{
"docid": "bcb86f0f0e599ce820c085bc897b7d8e",
"score": "0.5696663",
"text": "def valid_image(image_path)\n image_path.exist? && image_path.size < 32.kilobytes\n end",
"title": ""
},
{
"docid": "0bdd60c4c8dfa4ae8877991820b07777",
"score": "0.5687569",
"text": "def imagemagick?; end",
"title": ""
},
{
"docid": "dd7832574015ce259945b016b3b64fa1",
"score": "0.56856287",
"text": "def handle_missing_extent\n @bytecount, @byteoffset, @startblock, @fileoffset, @partition = 0, 0, 0, 0, 'b'\n end",
"title": ""
},
{
"docid": "24461593a85fdbba4711d4dea14326cd",
"score": "0.5670886",
"text": "def ignore_bad_chunking; end",
"title": ""
},
{
"docid": "24461593a85fdbba4711d4dea14326cd",
"score": "0.5670886",
"text": "def ignore_bad_chunking; end",
"title": ""
},
{
"docid": "f2834fc47985d839dca5140af2cf07fe",
"score": "0.5670793",
"text": "def tempMissingBackSprite\n bmp = pbBitmap(\"Graphics/EBDX/Battlers/000\")\n rbmp = Bitmap.new(bmp.width*5*2, bmp.height*2)\n for i in 0...5\n rbmp.stretch_blt(Rect.new(i*2*bmp.width, 0, bmp.width*2, bmp.height*2), bmp, bmp.rect)\n end\n bmp.dispose\n return rbmp\n end",
"title": ""
},
{
"docid": "042d06f877a45fa795414e1e76256a66",
"score": "0.5670465",
"text": "def images; (page.images rescue []); end",
"title": ""
},
{
"docid": "042d06f877a45fa795414e1e76256a66",
"score": "0.5670465",
"text": "def images; (page.images rescue []); end",
"title": ""
},
{
"docid": "ab0257bf74fc9b099f99f869d3432865",
"score": "0.5626832",
"text": "def extract_jpeg(data)\n pos = 0\n while pos + 11 < data.length\n head = data[pos, 11]\n\n if head.to_s.match(Regexp.new('^\\xff\\xd8\\xff...(JFIF|Exif)\\x00', nil, \"n\"))\n return data[pos ... data.length]\n else\n pos += 1\n end\n end\n\n return \"\"\n end",
"title": ""
},
{
"docid": "49cc34a2e7a81770f3281d75cd8049d1",
"score": "0.56255126",
"text": "def test_12d2\r\n db = build\r\n r = db.fetch('foo.jpg')\r\n assert_nil r\r\n r = db.fetch('foo.jpg' , :not_found => 'image-2.jpg')\r\n assert(/image-2.jpg/===r)\r\n r = db.fetch('foo.jpg' , :width => 61,\r\n :not_found => 'image-2.jpg')\r\n assert(/w.61.image-2.jpg/===r)\r\n r = db.fetch('foo.jpg' , :width => 61)\r\n assert_nil r\r\n end",
"title": ""
},
{
"docid": "7dfd56a94af1c702b20f05019e57f018",
"score": "0.5623098",
"text": "def images_holder\n images_quantity = self.images.count\n if images_quantity < 5\n images_needed = 5 - images_quantity\n images_needed.times do\n self.images << Image.new\n end\n end\n end",
"title": ""
},
{
"docid": "56b77dea6362e38b01e535fa07d3004e",
"score": "0.5601251",
"text": "def test_12e\r\n db = build\r\n\r\n r = db.fetch('image-1.jpg',:height => 102,:resize => false)\r\n assert r.nil?\r\n\r\n db.not_found_image = 'image-2.jpg'\r\n db.use_not_found = true\r\n\r\n r = db.fetch('image-1.jpg',:height => 102,:resize => false)\r\n assert_equal r,(File.join(db.root,'h','102','image-2.jpg')).to_s\r\n #assert File.exists?(File.join(db.root,'h','102','image-2.jpg'))\r\n# TODO: 27-Jun-2010\r\n assert(/image-2.jpg/===r)\r\n\r\n db.use_not_found = false\r\n#debugger\r\n r = db.fetch('image-1.jpg',:height => 102,:resize => false)\r\n assert r.nil?\r\n end",
"title": ""
},
{
"docid": "50731c0ac648727263850cdac49c8d15",
"score": "0.5590347",
"text": "def test_06c\r\n db = build\r\n db.images.grep(/image-1/)\r\n end",
"title": ""
},
{
"docid": "acbe85ee9a5e39e1926b0d8daa02c229",
"score": "0.55855316",
"text": "def is_small_imageable?\n return true\n end",
"title": ""
},
{
"docid": "c124056300dce345d5794fa2abd7c8d7",
"score": "0.5583641",
"text": "def image_hash; end",
"title": ""
},
{
"docid": "7f28c66572bccea9ff34965348ccb13f",
"score": "0.5579767",
"text": "def capture_size_before_cache(new_file) \n if model.image_width.nil? || model.image_height.nil?\n model.image_width, model.image_height = `identify -format \"%wx %h\" #{new_file.path}`.split(/x/).map { |dim| dim.to_i }\n end\n end",
"title": ""
},
{
"docid": "d2c2fa5dafd334d57f5f3d1e5a26e487",
"score": "0.55477786",
"text": "def images\n []\n end",
"title": ""
},
{
"docid": "d6f9417bd6a1aefac189d7d151b534b6",
"score": "0.55472606",
"text": "def length\n images.size\n end",
"title": ""
},
{
"docid": "780ed5b389e6b8054880e20b40795495",
"score": "0.5546544",
"text": "def test_09a\r\n db = ITestUtils.newdb\r\n nm = File.join(test_data,'image-1.jpg')\r\n r = db.store(nm)\r\n db.fetch 'image-1.jpg',:width => 102\r\n db.fetch 'image-1.jpg',:width => 103\r\n db.fetch 'image-1.jpg',:width => 104\r\n db.hooks = hooks()\r\n db.delete 'image-1.jpg' # Delete image and all sized\r\n assert_equal 1,db.hooks.count[:deletes]\r\n assert_equal File.basename(r),db.hooks.params[:original]\r\n assert_equal 3,db.hooks.params[:sized].size\r\n # Returns array of 3 sized images that were deleted\r\n end",
"title": ""
},
{
"docid": "cab0ecc2be9220d7237cd46fd42ca2f4",
"score": "0.5536267",
"text": "def size_calculation(file_name)\n\t\t#file_name = \"file:///home/frakinho/image_manipulation/server_serial_port/app/assets/images/coisa.jpg\"\n\t original = Magick::Image::read(file_name).first\n\t\t\n\t\tpath_debug = get_path_without_image_name(file_name)\n\t \n\n\t #Copy for debug mod\n\t image = original\n\n\t #Apply Fitler twice for remove a max of noise \n\t image = image.median_filter(radius=3)\n\t image = image.median_filter(radius=3)\n\t \timage.write(\"#{path_debug}first_filter.jpg\")\n\t image = image.edge(radius=2)\n\t \timage.write(\"#{path_debug}edge.jpg\")\n\n\t image.image_type = Magick::BilevelType\n\t image.write(\"#{path_debug}BileveType.jpg\")\n\t image = image.median_filter(radius=1)\n\t image.write(\"#{path_debug}last_filter.jpg\")\n\n\t \t# Get Bounding_box\n\t\tbound = image.bounding_box\n\n\t\t#Calculate value in CM\n\t #Value top in CM\n\t # 237 is a variable value, depend the distance between table and camera\n\t value_width_cm = ((bound.width) * 21) / 380.0\n\t #Value of height\n\t value_height_cm = ((bound.height) * 21) / 380.0\n\n\n\t # Debug MOD \n\t\tif ServerSerialPort::Application.config.my_app.debug\n\t\t gc_1 = Magick::Draw.new\n\t\t gc_1.stroke(\"gray50\")\n\t\t gc_1.fill_opacity(0)\n\t\t gc_1.rectangle(bound.x, bound.y, bound.x+bound.width, bound.y+bound.height)\n\t\t gc_1.stroke(\"red\")\n\t\t gc_1.circle(bound.x, bound.y, bound.x+2, bound.y+2)\n\t\t gc_1.circle(bound.x+bound.width, bound.y, bound.x+bound.width+2, bound.y+2)\n\t\t gc_1.circle(bound.x, bound.y+bound.height, bound.x+2, bound.y+bound.height+2)\n\t\t gc_1.circle(bound.x+bound.width, bound.y+bound.height, bound.x+bound.width+2, bound.y+bound.height+2)\n\t\t gc_1.fill(\"white\")\n\t\t gc_1.stroke(\"transparent\")\n\t\t gc_1.text(bound.x-15, bound.y-5, \"\\'#{bound.x},#{bound.y}\\'\")\n\t\t gc_1.text(bound.x+(bound.width/2),bound.y-15,\"#{value_width_cm}\")\n\t\t gc_1.text(bound.x - 15,(bound.height / 2),\"#{value_height_cm}\")\n\t\t gc_1.text(bound.x+bound.width-15, bound.y-5, \"\\'#{bound.x+bound.width},#{bound.y}\\'\")\n\t\t gc_1.text(bound.x-15, bound.y+bound.height+15, \"\\'#{bound.x},#{bound.y+bound.height}\\'\")\n\t\t gc_1.text(bound.x+bound.width-15, bound.y+bound.height+15, \"\\'#{bound.x+bound.width},#{bound.y+bound.height}\\'\")\t \n\t\t gc_1.draw(original)\n\t\t original.write(\"#{path_debug}bounding.jpg\")\n\t\t\n\t\tend\n\t\timage_crop = original.crop(bound.x, bound.y, bound.width, bound.height)\n\t\timage_crop = image_crop.rotate(90)\n\t\n\t\timage_crop.write(\"#{path_debug}image_crop.jpg\")\n\n\n\n\t return value_width_cm,value_height_cm\n\tend",
"title": ""
},
{
"docid": "a11c23e02bd20a02e719eb4749fa56cf",
"score": "0.55304277",
"text": "def checkForThumbs(commit) #:doc:\n prev_commit_blob_ids = Array.new\n prev_commit = Commit.find(:first, :conditions => [\"id = ?\", commit.previous_commit_id])\n if prev_commit\n prev_commit.blobs.find_each(:batch_size => 1500) do |pb|\n prev_commit_blob_ids.push(pb.id)\n end\n end\n \n blobs_without_thumb = Array.new\n new_thumbs = 0\n new_thumbs_without_thumb = 0\n prev_thumbs_ok = true\n commit.blobs.find_each(:batch_size => 1500) do |blob|\n if blob.thumbnail_name == nil and not prev_commit_blob_ids.include?(blob.id) and not blobs_without_thumb.include?(blob.blob_hash)\n blobs_without_thumb.push(blob.blob_hash)\n new_thumbs_without_thumb += 1\n new_thumbs += 1\n elsif blob.thumbnail_name == nil and not blobs_without_thumb.include?(blob.blob_hash)\n blobs_without_thumb.push(blob.blob_hash)\n prev_thumbs_ok = false\n elsif blob.thumbnail_name != nil and not prev_commit_blob_ids.include?(blob.id)\n new_thumbs += 1\n end\n end\n \n if blobs_without_thumb.size == 0 # we have all thumbs, do nothing\n return\n elsif prev_thumbs_ok and new_thumbs_without_thumb == new_thumbs # all new thumbs missing\n XmppHelper::sendXmppMessage(@device.xmppname, \"thumbs \" + commit.commit_hash)\n else\n # some thumbs are missing. get them.\n i = 0\n blobs_per_message = 100\n message = blobs_without_thumb[i...blobs_per_message]\n while message != nil do\n XmppHelper::sendXmppMessage(@device.xmppname, \"thumbs \" + commit.commit_hash + \" \" + message.join(\" \"))\n i += blobs_per_message\n message = blobs_without_thumb[i...blobs_per_message]\n end\n end \n end",
"title": ""
},
{
"docid": "c8edc787bb82df5930d2f6da535e7073",
"score": "0.5523594",
"text": "def delete_small!\n @contents.delete_if do |c|\n# ((c[1] - c[0]) < @image.min_content_size*0.6) or\n ((c[1] - c[0]) < @image.min_obj_size) or\n ((c[0] - @image.min_obj_size <= 0) and (c[2]<@image.min_content_size)) or\n ((c[1] + @image.min_obj_size >= @projection.size) and (c[2]<@image.min_content_size))\n end\n end",
"title": ""
},
{
"docid": "2bf1c87623ded10996aa90a7d184fe8d",
"score": "0.55217856",
"text": "def large_image_width\n 850\n end",
"title": ""
},
{
"docid": "5fe32a4a388baa7df9864cf87887c995",
"score": "0.55211806",
"text": "def sizes\n images.collect(&:classifier).sort\n end",
"title": ""
},
{
"docid": "fa0f11acffc7e582a7ac3551c5258f30",
"score": "0.55040354",
"text": "def raw_size\n valid_blobs.map(&:raw_size).sum\n end",
"title": ""
},
{
"docid": "50578e4386febf63272130a5a1ae5a11",
"score": "0.5466059",
"text": "def image_processing?\n !image_tmp.blank?\n end",
"title": ""
},
{
"docid": "582e99b2d7e95c68646833773dbfb975",
"score": "0.54541075",
"text": "def image_sweep?\n results = false\n all_contents = \"\"\n for attribute in self.image_containers\n contents = self.send(attribute)\n if !contents.blank?\n new_matches = contents.scan(/\\/stored_images\\/[\\w]*\\/[\\w. ]*/)\n results = true if new_matches.length > 0 \n all_contents += contents\n end\n end\n pwd = Dir.pwd\n image_dir = \"#{RAILS_ROOT}/public/assets/#{self.class.to_s.pluralize.underscore}/#{self.id}/contained_images\"\n FileUtils.mkdir_p(image_dir) unless File.directory?(image_dir)\n Dir.chdir image_dir\n files = Dir.glob(\"*\")\n for file in files\n FileUtils.rm(File.join(image_dir, file)) unless all_contents.include?(file)\n end\n Dir.chdir pwd\n return results\n end",
"title": ""
},
{
"docid": "16e4fa4acbdacee2d454c4bfcb6901ba",
"score": "0.54531616",
"text": "def image_size\n end",
"title": ""
},
{
"docid": "77a63f0a2fabf1f2fd5c14e14f106058",
"score": "0.54421633",
"text": "def size_range\n 0..IMAGE_FILE_SIZE.megabytes\n end",
"title": ""
},
{
"docid": "1cddbfab96554108e1ac43a253c8c509",
"score": "0.5438959",
"text": "def image_size\n\t\tif image.size > 500.kilobytes\n\t\t\terrors.add(:image, \"should be less than 500kB\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1f62e4342d09719e8aa4dab26b31a2c2",
"score": "0.542752",
"text": "def thumbnail(size); end",
"title": ""
},
{
"docid": "ccbd106192c07a1c1be34b2a421145ec",
"score": "0.5424",
"text": "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end",
"title": ""
},
{
"docid": "ccbd106192c07a1c1be34b2a421145ec",
"score": "0.5424",
"text": "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end",
"title": ""
},
{
"docid": "be0a59946a5aab4430a6805958eb5630",
"score": "0.54210013",
"text": "def image_width\n end",
"title": ""
},
{
"docid": "8b657829b012b4390c75df0e6d58db81",
"score": "0.5412491",
"text": "def large_image\n self.image.large\n end",
"title": ""
},
{
"docid": "3c79546efc04625a83086e1a345f8cce",
"score": "0.54115343",
"text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end",
"title": ""
},
{
"docid": "3c79546efc04625a83086e1a345f8cce",
"score": "0.54115343",
"text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end",
"title": ""
},
{
"docid": "13053dc2393593a3870a77c082f2df24",
"score": "0.5403294",
"text": "def all_images(albid)\n kept_images(albid) + deleted_images(albid)\n end",
"title": ""
},
{
"docid": "9846b9a0566ee1da478d2df517438ed4",
"score": "0.5383254",
"text": "def putImage(theWidth, theHeight, theImage)\n\n\tputs \"Raw Image:\";\n\tputs theImage.join();\n\t\n\t\n\tputs \"\"\n\tputs \"Bitmap Image:\"\n\tn = 0;\n\n\t0.upto(theHeight - 1) do |y|\n\t\t0.upto(theWidth - 1) do |x|\n\t\t\tprint (theImage[n] == 1) ? '#' : ' ';\n\t\t\tn += 1;\n\t\tend\n\t\tputs \"\";\n\tend\n\nend",
"title": ""
},
{
"docid": "826447b7a2af81d5b35b2beb91dd994c",
"score": "0.53817",
"text": "def pixels; end",
"title": ""
},
{
"docid": "6400829d42dd458c4c17074f1c67c629",
"score": "0.53695434",
"text": "def big_image\n return image.gsub(/square/i, \"large\") if image =~ /facebook/ && image =~ /square/\n return image.gsub(/normal/i, \"original\") if image =~ /twitter/ && image =~ /normal/\n image\n end",
"title": ""
},
{
"docid": "fe1d506c36608db6bdf3ebeb60ddf600",
"score": "0.53643274",
"text": "def image_too_small?\n @temp_file.open if @temp_file.closed?\n @temp_file.size < options[:min_size]\n end",
"title": ""
},
{
"docid": "456b6f67b0f745c0fdbc57962f0a1445",
"score": "0.53633493",
"text": "def image_styles\n nil\n end",
"title": ""
},
{
"docid": "3c5c7cda3571c31ca854f892cf57bf99",
"score": "0.5358254",
"text": "def all_images_exist?\n return false if self.missing_images.size > 0\n return false if self.missing_reference_images.size > 0\n return true\n end",
"title": ""
},
{
"docid": "7fc988580d450165bdf1ed5b9739103e",
"score": "0.53512406",
"text": "def image_size_sufficient(uri)\n # see lib/shared/shared_utilities for this customzation of Net::HTTP\n body, new_location = Net::HTTP.get_with_timeout_redirect(uri, 2) # second argument is the timeout in seconds\n if !body.nil?\n # TODO: replace Net::HTTP with http://github.com/taf2/curb/tree/master if speed is required.\n if body.size >= Nfwyd::Constants::MIN_IMAGE_SIZE # in bytes, so 10KB minimum\n return body.size, new_location\n end\n else\n log_it :info, \"got no content trying to download image=#{uri}\\n should happend occasionally. Throwing away image\"\n end\n return nil, nil\n end",
"title": ""
},
{
"docid": "75d32fafcfae7c94fc3c8d5decc3ad3c",
"score": "0.53507626",
"text": "def compressed_size; end",
"title": ""
},
{
"docid": "75d32fafcfae7c94fc3c8d5decc3ad3c",
"score": "0.53507626",
"text": "def compressed_size; end",
"title": ""
},
{
"docid": "57e96f8693090e70274656fe768a7c08",
"score": "0.5345693",
"text": "def get_bytes_for_image(src)\n begin\n uri = URI.parse src\n req = Net::HTTP.new(uri.host, 80)\n resp = req.request_head(uri.path)\n\n if resp.content_type.include?(\"image\")\n return resp.content_length\n end\n rescue\n log \"Error getting image size for #{src} - #{$!}\"\n end\n\n return 0\n end",
"title": ""
},
{
"docid": "0b1c2deb92345f08bfbaff4db5e1cc2d",
"score": "0.53419226",
"text": "def has_image\n return self.food_images.size>0\n end",
"title": ""
},
{
"docid": "3ff7efb147f82884a3b6061f4f717fd2",
"score": "0.53406656",
"text": "def number_of_images\n images.count\n end",
"title": ""
},
{
"docid": "77c964b16f5f616e8a0607b67f23b20e",
"score": "0.53239435",
"text": "def load_image(url)\n require 'open-uri'\n temp = Tempfile.new 'split-vertically'\n image = nil\n\n seems_legit = false\n open(temp.path, 'wb') do |file|\n file << open(url).read\n # Images server returns literally \"0\" if no image exists\n seems_legit = file.size > 1\n end\n sleep 0.25 # Let's try to be nice to the images server\n\n Magick::Image.read(temp.path).first if seems_legit\nend",
"title": ""
},
{
"docid": "23d051b44553b105e2f68c52daf0cd7a",
"score": "0.5320479",
"text": "def has_image?\n false\n end",
"title": ""
},
{
"docid": "590e9e2eb869c7cdd7502916da391d9b",
"score": "0.5319816",
"text": "def sequence_images\n \n end",
"title": ""
},
{
"docid": "fab786e84dc0dd748ef1c37e3265b700",
"score": "0.53149134",
"text": "def test_load_invalid_png_files\n\n each_file_with_updated_info do\n |file_path|\n\n if @test_feature == \"x\"\n #Invalid png files should generally raise exception (except in the specific cases below).\n\n if @parameter == \"cs\" || @parameter == \"hd\"\n if @parameter == \"cs\"\n chunk_str = \"IDAT\"\n else\n chunk_str = \"IHDR\"\n end\n #Test images with bad crc warn\n actual_stderr = $stderr\n $stderr = StringIO.new\n assert_nothing_raised do\n Imgrb::Image.new(file_path)\n end\n $stderr.rewind\n assert_equal \"Critical chunk '#{chunk_str}' failed crc check. Image may not be decoded correctly.\", $stderr.string.chomp\n $stderr = actual_stderr\n else\n assert_raise do\n Imgrb::Image.new(file_path)\n end\n end\n\n #Reading only metadata should not raise an error if IDAT chunk is\n #missing. Maybe try harder to extract metadata from other invalid files\n #as well.\n if @parameter == \"dt\"\n assert_nothing_raised do\n Imgrb::Image.new(file_path, :only_metadata)\n end\n end\n\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "b40d291d93f6b0a80705d1acf17b5867",
"score": "0.5303869",
"text": "def prepare_images #:nodoc:\n count = 0\n images = []\n\n # We sort the images by row and column but that isn't strictly required.\n #\n rows = @images.keys.sort\n\n rows.each do |row|\n cols = @images[row].keys.sort\n cols.each do |col|\n images.push(@images[row][col])\n count += 1\n end\n end\n\n @images = {}\n @images_array = images\n\n return count\n end",
"title": ""
},
{
"docid": "bde490ea4bc707a98f5f22ed444df882",
"score": "0.52980614",
"text": "def get_image_bytes(url)\n URI.open(url).read\nend",
"title": ""
},
{
"docid": "15ab86c216e64699d5ceac97a9d48dae",
"score": "0.5292005",
"text": "def image(criteria = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e57d146371ce1cef2c419609d6ce67c1",
"score": "0.5288225",
"text": "def test_12g\r\n db = build\r\n db.use_not_found = true\r\n db.not_found_image = 'image-1.jpg'\r\n r = db.fetch('foo.jpg' , :not_found => nil)\r\n assert_nil r\r\n r = db.fetch('foo.jpg')\r\n assert(/image-1.jpg/===r)\r\n end",
"title": ""
},
{
"docid": "81f576242296ef64fb67ab5aa3564136",
"score": "0.5287566",
"text": "def pure_jpg\n Jhead.call(\"-purejpg\", @match, @pattern)\n end",
"title": ""
},
{
"docid": "195454600b8174b34a2f701ca052ffbd",
"score": "0.52848965",
"text": "def test_render_unknown_image\n tag = Jekyll::ThumbnailifyTag.new('t', 'foobaar.png', nil)\n assert_not_nil tag\n\n html = tag.render(@context)\n\n assert_not_nil html\n assert_equal \"File foobaar.png not found in images\", html\n assert_equal 0, @site.static_files.size\n end",
"title": ""
},
{
"docid": "153ab5e81d38b161caa5e3d0f436377f",
"score": "0.5281514",
"text": "def png_chunk(signature, data)\n\t[data.length, signature, data, Zlib::crc32(signature + data)].pack(\"NA4A*N\")\nend",
"title": ""
},
{
"docid": "2d3478c697d2d4fe67bbd9b5a517d37b",
"score": "0.5280959",
"text": "def test_02d\r\n db = build\r\n n1 = db.fetch('image-1.jpg',:width => 101)\r\n n2 = db.fetch('image-1.jpg',:width => 102)\r\n assert File.exists?(n1)\r\n assert File.exists?(n2)\r\n nm = File.join(test_data,'image-2.jpg')\r\n r = db.store(nm,:name => 'image-1.jpg',:force => true)\r\n assert !File.exists?(n1)\r\n assert !File.exists?(n2)\r\n end",
"title": ""
},
{
"docid": "550a8b0598a0180801469b98703546bb",
"score": "0.528075",
"text": "def setup\n size 200, 200\n @a = load_image 'construct.jpg'\n @b = load_image 'wash.jpg'\n @offset = 0.0\nend",
"title": ""
},
{
"docid": "2aa3a7e8490aa2dda5c3059daeb13b07",
"score": "0.52799946",
"text": "def prepare_image\n images_for_job = []\n images = []\n @images_from_index = row.slice(config['IMAGE']['image_file_name'][0]..-1).compact\n @images_from_index = @images_from_index.collect{|file| file.include?('.') ? \\\n file: file + \".#{@image_ext}\"}\n # identifying check and envelop images\n @check_image, @envelop_image = call_parser_specific_method \"prepare_check_and_envelop_images\" if @version == 'BANK_OF_AMERICA' and facility.index_file_parser_type != \"Apria_bank\"\n envelop_image_to_loaded = (@envelop_image.upcase)[0...-4].split(\"_\") unless @envelop_image.blank?\n @image_folder = Dir.glob(\"#{@location}/**/#{config['IMAGE']['image_folder']}*\", File::FNM_CASEFOLD)\n @images_from_index.each do |file_name|\n unless @hash_envelop_images.has_key?(\"#{file_name}\")\n images_for_job << @image_folder.select{|file| File.basename(file).upcase == file_name.upcase}\n images_for_job << @image_folder.select{|file| file_name[0...-4] + \"B\" == File.basename(file)[0...-4].upcase}\n \n else\n unless @envelop_image.blank?\n images_for_job << @image_folder.select{|file| File.basename(file).upcase == @envelop_image.upcase ||\n File.basename(file)[0...-4].upcase == @envelop_image.upcase[0...-4] +'B'}\n if envelop_image_to_loaded.size == 2\n @image_folder = Dir.glob(\"#{@location}/**/#{config['IMAGE']['image_folder']}*\", File::FNM_CASEFOLD)\n images_for_job << @image_folder.select{|file| File.basename(file)[0...-4].upcase == envelop_image_to_loaded[0]+'B_'+ envelop_image_to_loaded[1]}\n end\n end\n end\n end\n images_for_job.flatten!\n # @initial_image_name = images_for_job[0]\n multi_page_facilities = ['CHRISTIAN HOSPITAL LABORATORY','GENOPTIX MEDICAL LABORATORY']\n images_for_job = convert_single_page_to_multipage(images_for_job) if multi_page_facilities.include? facility.name.strip.upcase\n f = nil\n images_for_job.each_with_index do |image_name,img_count|\n f = File.open(\"#{image_name}\",\"rb\")\n image = ImagesForJob.new(:image => f)\n parse_values(\"IMAGE\", image, File.basename(image_name))\n image_file_name = image.image_file_name.strip.split(\"\\\\\").last unless image.image_file_name.blank?\n # initial_image = images_for_job[0]\n @initial_image_name = image_file_name if img_count == 0\n path = Dir.glob(\"#{@location}/**/#{image_file_name}\").first\n count = %x[identify \"#{path}\"].split(image_file_name).length-1\n new_image_name = File.basename(\"#{path}\")\n if count>1\n dir_location = File.dirname(\"#{path}\")\n ext_name = File.extname(\"#{path}\")\n new_image_base_name = new_image_name.chomp(\"#{ext_name}\")\n if ((not ext_name.empty?) and (ext_name.casecmp(\".pdf\") == 0) ) then\n system \"pdftk '#{path}' burst output '#{dir_location}/#{new_image_base_name}_%d#{ext_name}'\"\n for image_count in 1..count\n image = ImagesForJob.new(:image_file_name=>\"#{new_image_base_name}_#{image_count}#{ext_name}\",:is_splitted_image=>true)\n image = update_image image\n image.save\n images << image\n end\n else\n InputBatch.split_image(count,path, dir_location, new_image_base_name)\n single_images = Dir.glob(\"#{@location}/**/*\").select{|file| InputBatch.get_single_image(file, new_image_base_name)}.sort\n single_images.each_with_index do |single_image, index|\n new_image_name = \"#{dir_location}/#{new_image_base_name}_#{index}#{ext_name}\"\n File.rename(single_image, new_image_name)\n image = ImagesForJob.create(:image => File.open(new_image_name), :image_number => @img_count,:is_splitted_image=>true)\n @img_count += 1\n images << image\n end\n end\n else\n # image = ImagesForJob.new(:image_file_name=>\"#{new_image_name}\")\n image = update_image image\n image.save\n images << image\n end\n f.close\n end\n return images\n end",
"title": ""
},
{
"docid": "c2974b390c59e8caae9e2dcd1540ece8",
"score": "0.5278449",
"text": "def size; '' end",
"title": ""
},
{
"docid": "280b4a9313a300aabcd825bf771b55b3",
"score": "0.5276524",
"text": "def prepDoneDirImages(pdftmp_dir, maxheight, maxwidth, grid, logkey='')\n images = Dir[\"#{Bkmkr::Paths.project_tmp_dir_img}/*\"].select {|f| File.file? f}\n image_count = images.count\n corrupt = []\n processed = []\n\n if image_count > 0\n FileUtils.cp Dir[\"#{Bkmkr::Paths.project_tmp_dir_img}/*\"].select {|f| test ?f, f}, pdftmp_dir\n pdfimages = Dir.entries(pdftmp_dir).select { |f| !File.directory? f }\n pdfimages.each do |i|\n puts \"resizing and grayscaling #{i}\"\n pdfimage = File.join(pdftmp_dir, \"#{i}\")\n if i.include?(\"fullpage\")\n #convert command for ImageMagick should work the same on any platform\n `convert \"#{pdfimage}\" -colorspace gray \"#{pdfimage}\"`\n processed << pdfimage\n else\n myres = `identify -format \"%y\" \"#{pdfimage}\"`\n if myres.nil? or myres.empty? or !myres\n corrupt << pdfimage\n else\n resize = calcImgSizes(myres, pdfimage, maxheight, maxwidth, grid)\n if !resize.match(/^error/)\n `convert \"#{pdfimage}\" -density #{myres} #{resize}-quality 100 -colorspace gray \"#{pdfimage}\"`\n else\n logstring = resize #log any errors returned from calcImgSizes method\n end\n end\n processed << pdfimage\n end\n end\n else\n logstring = 'n-a (no images in done dir)'\n end\n\n return image_count, corrupt, processed\nrescue => logstring\n return '',[],[]\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend",
"title": ""
},
{
"docid": "3564b7080e898db1999cc71f9aa90ca2",
"score": "0.52714527",
"text": "def test_non_pngs_unaffacted\n for image in %w(test.jpg test.jpeg test.gif test.bmp)\n get :index, :src => image\n assert_response :success\n extension = image.gsub(/^.*\\./, '')\n assert_select \"img[src*=test.#{extension}]\"\n end\n end",
"title": ""
},
{
"docid": "eba01808f1f3b76ad77c16dc2941d0f9",
"score": "0.5271019",
"text": "def all_images\n # For all images:\n image_text_files = Dir\n .children(folder_path)\n .select do |path|\n path.start_with?('output-')\n end\n .sort\n # .tap{|fs| puts fs }\n image_text_data = image_text_files.map do |path|\n File.read(File.join(folder_path, path))\n end\n image_jsons = image_text_data.map do |json_string|\n JSON.parse(json_string)\n end\n page_regex = /#{image_prefix}(\\d+)#{image_suffix}/\n ordered_image_jsons = image_jsons.sort do |a, b|\n a_uri = a['responses'].first['context']['uri']\n b_uri = b['responses'].first['context']['uri']\n a_num = a_uri.match(page_regex)[1].to_i\n b_num = b_uri.match(page_regex)[1].to_i\n a_num <=> b_num\n end\n\n ordered_images_count = ordered_image_jsons.count\n ordered_image_jsons.each.with_index do |ordered_image_json, image_index|\n # next unless image_index == 4\n\n puts \"Processing image #{image_index+1} of #{ordered_images_count}\"\n uri = ordered_image_json['responses'].first['context']['uri']\n # puts \"Processing URI #{uri}\"\n page_number = uri.match(page_regex)[1].to_i\n # puts \"Processing page number #{page_number}\"\n\n input_image_path = full_image_path(page_number)\n # puts \"File.exist?(#{input_image_path}): #{File.exist?(input_image_path)}\"\n image = Magick::Image.read(input_image_path)[0]\n # json_path =\"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/output-#{page_number}-to-#{page_number}.json\"\n # json_text = File.read(json_path)\n # json = JSON.parse(json_text)\n\n bounding_box = ordered_image_json[\"responses\"].first[\"textAnnotations\"][1][\"boundingPoly\"]\n vertices = bounding_box[\"vertices\"]\n\n confidence_symbols_to_colors = {\n # very_confidence: '#BED1D8',\n # very_confidence: '#000000',\n very_confidence: '#555',\n moderately_confidence: '#FFAE03',\n sort_of_confidence: '#E67F0D',\n low_confidence: '#E9190F'\n }\n\n numbers_to_confidence_symbols = {\n 80..100 => :very_confidence,\n 50..80 => :moderately_confidence,\n 31..50 => :sort_of_confidence,\n 0..30 => :low_confidence\n }\n\n numbers_to_stroke_opacity = {\n 80..100 => '35%',\n 60..80 => '100%',\n 31..60 => '100%',\n 0..30 => '100%'\n }\n numbers_to_stroke_width = {\n 80..100 => 2,\n # 80..100 => 4,\n 50..80 => 5,\n # 50..80 => 4,\n 31..50 => 5,\n 0..30 => 5\n }\n\n pages = ordered_image_json[\"responses\"].first[\"fullTextAnnotation\"]['pages']\n blocks = pages.map{|p| p['blocks'] }.flatten.compact\n paragraphs = blocks.map{|b| b['paragraphs'] }.flatten.compact\n words = paragraphs.map{|p| p['words'] }.flatten.compact\n symbols = words.map{|w| w['symbols'] }.flatten.compact\n symbols_total = symbols.count\n symbols.each.with_index do |symbol, symbol_index|\n # next unless symbol_index == 41\n\n # puts \" Processing symbol #{symbol_index+1} of #{symbols_total}\"\n bounding_box = symbol[\"boundingBox\"]\n vertices = bounding_box[\"vertices\"]\n confidence = symbol['confidence'] || 0\n confidence_number = (confidence * 100).to_i\n confidence_symbol = numbers_to_confidence_symbols.select{|n| n === confidence_number }.values.first\n color = confidence_symbols_to_colors[confidence_symbol]\n stroke_opacity = numbers_to_stroke_opacity.select{|n| n === confidence_number }.values.first\n stroke_width = numbers_to_stroke_width.select{|n| n === confidence_number }.values.first\n\n draw = Magick::Draw.new\n draw.fill_opacity(0)\n draw.stroke(color)\n draw.stroke_opacity(stroke_opacity)\n # draw.stroke_opacity('100%')\n draw.stroke_width(stroke_width)\n\n p1x = vertices[0]['x'] || 0\n p1y = vertices[0]['y'] || 0\n # p2x = vertices[1]['x']\n # p2y = vertices[1]['y']\n # p3x = vertices[3]['x']\n # p3y = vertices[3]['y']\n p4x = vertices[2]['x'] || 0\n p4y = vertices[2]['y'] || 0\n\n unless p1x && p1y && p4x && p4y\n # unless p1x && p1y && p2x && p2y && p3x && p3y && p4x && p4y\n puts \"Error: Missing at least one vertex for image json block from file #{image_text_files[image_index]} for page#{page_number}.jpg\"\n puts \"Error: Vertices:\"\n puts vertices\n next\n end\n\n # puts \"trying to draw rectangle at #{p1x}, #{p1y}, #{p3x}, #{p3y}\"\n # draw.roundrectangle(p1x, p1y, p4x, p4y, 5, 5)\n draw.rectangle(p1x, p1y, p4x, p4y)\n # draw.line(p1x, p1y, p2x, p2y)\n # draw.line(p1x, p1y, p3x, p3y)\n # draw.line(p2x, p2y, p4x, p4y)\n # draw.line(p3x, p3y, p4x, p4y)\n\n draw.draw(image)\n next\n end\n # After exploring this, I'm confident that missing vertices should be\n # treated as 0s\n altered_image_suffix = image_suffix\n .split('.')\n .insert(1, 'symbol_confidence')\n .join('.')\n output_image_path = \"#{full_image_prefix}#{page_number}#{altered_image_suffix}\"\n # output_image_path = \"/Users/kyle/Dropbox/code/kyletolle/handwriting_transcription/page#{page_number}.symbol_confidence.missingvertices.jpg\"\n image.write(output_image_path)\n end\n puts \"Finished drawing on images...\"\nend",
"title": ""
},
{
"docid": "ea7a74eef1567790a57b18980111badf",
"score": "0.526798",
"text": "def scanned_prof_image\n scanned_prof\n end",
"title": ""
},
{
"docid": "7582b407de00f31b83502afdbfa71f79",
"score": "0.5267224",
"text": "def encode_png_scanline_none(original_bytes, previous_bytes = nil, pixelsize = 3)\n [ChunkyPNG::FILTER_NONE] + original_bytes\n end",
"title": ""
},
{
"docid": "56f115df815c0e0f00b034ae68dc1487",
"score": "0.52651626",
"text": "def ignore_bad_chunking=(_arg0); end",
"title": ""
},
{
"docid": "0b86b426ce02e085114447804f010caf",
"score": "0.5261228",
"text": "def fbe_size\n 1\n end",
"title": ""
},
{
"docid": "0b86b426ce02e085114447804f010caf",
"score": "0.5261228",
"text": "def fbe_size\n 1\n end",
"title": ""
},
{
"docid": "0b86b426ce02e085114447804f010caf",
"score": "0.5261228",
"text": "def fbe_size\n 1\n end",
"title": ""
},
{
"docid": "0b86b426ce02e085114447804f010caf",
"score": "0.5261228",
"text": "def fbe_size\n 1\n end",
"title": ""
},
{
"docid": "0b86b426ce02e085114447804f010caf",
"score": "0.5261228",
"text": "def fbe_size\n 1\n end",
"title": ""
}
] |
09430eda00cb850f48ac0013ae059530
|
Check to see that the nick as provided during the registration process matches the authenticated campfire user. If the nicks don't match, send a nick change to the connected client.
|
[
{
"docid": "db91d0befa1575864936fb7e35348017",
"score": "0.8271298",
"text": "def check_nick_matches_authenticated_user\n campfire.user(\"me\") do |user|\n name = irc_name user.name\n if name != nick\n user_reply :nick, name\n @nick = name\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ae8b7706d50dff533aca256e3b805929",
"score": "0.68145055",
"text": "def nickserv?(botuser)\n if botuser.respond_to? :registered # this is not part of official rbot atm.\n botuser.registered\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3589bdd9056b3cded417163fb61e542c",
"score": "0.67606175",
"text": "def handle_nick_taken\n logger.info \"Nickname '#{self.nickname}' on #{self.server} taken, trying next.\" \n logger.info \"Available Nicknames: #{self.nicks.empty? ? \"None\" : self.nicks.join(\", \")}\"\n if !self.nicks.empty?\n logger.info \"Getting next nickname to switch\"\n next_nick = self.nicks.shift # Get the next nickname\n logger.info \"Attemping to set nickname to '#{next_nick}'\"\n nick next_nick\n else\n logger.fatal \"No Nicknames available - QUITTING\"\n quit\n end\n end",
"title": ""
},
{
"docid": "d911f30105e67f3ec0b66ad5af74dc09",
"score": "0.67024255",
"text": "def change_nick(context, nick)\n raise ClientError.new(\"Can't change nick name. The connection is not yet registered.\")\n end",
"title": ""
},
{
"docid": "b57f82dd424f44eff1cdbfcc2f4ca3c4",
"score": "0.6700984",
"text": "def nick=(nick)\n if(nick =~ NICK_RX )\n @nick = nick\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "3e60ff387d4ae7ec68a048f1a062b996",
"score": "0.66910654",
"text": "def handle_nick_taken\n logger.info \"Nickname '#{nickname}' on #{server} taken, trying next.\" \n logger.info \"Available Nicknames: #{nicks.empty? ? \"None\" : nicks.join(\", \")}\"\n if !nicks.empty?\n logger.info \"Getting next nickname to switch\"\n next_nick = nicks.shift # Get the next nickname\n logger.info \"Attemping to set nickname to '#{next_nick}'\"\n nick next_nick\n else\n logger.error \"No Nicknames available - QUITTING\"\n quit\n end\n end",
"title": ""
},
{
"docid": "790e929e39829c738751bbcbc6897011",
"score": "0.66731286",
"text": "def check_ns_login nick\n # According to the docs, those servers that use STATUS may query up to\n # 16 nicknames at once. if we pass an Array do:\n # a) on STATUS send groups of up to 16 nicknames.\n # b) on ACC, we have no such luck, send each message separately.\n\n if nick.is_a? Array\n if @ircd =~ /unreal/i\n nick.each_slice(16) {|group| msg \"NickServ\", \"STATUS #{group.join(' ')}\"}\n else\n nick.each {|nickname| msg \"NickServ\", \"ACC #{nick}\"}\n end \n else # one nick was given, send the message\n msg \"NickServ\", \"ACC #{nick}\" if @ircd =~ /ircd-seven/i # freenode\n msg \"NickServ\", \"STATUS #{nick}\" if @ircd =~ /unreal/i\n end\n end",
"title": ""
},
{
"docid": "1b24178b0c57ea33693a9a7bbef49ab2",
"score": "0.66661626",
"text": "def nick_change(who, what)\n if who = @client.state[:nick] && @client.state[:newnick] && what == @client.state[:newnick].first\n @client.state[:nick] = @client.state[:newnick].shift\n end\n end",
"title": ""
},
{
"docid": "ae0c665d1509cd10458825615e31f561",
"score": "0.6661358",
"text": "def got_nick network, message\n old_nick = message.prefix.nick\n\n # Update or own nickname if has been changed by the server\n if network.nickname == old_nick\n new_nick = message.parameters[0]\n\n emit :nick, new_nick\n network.nickname = new_nick\n end\n\n return unless (user = network.users.delete(old_nick))\n\n new_nick = message.parameters[0]\n emit :user_rename, user, new_nick\n user.nick = new_nick\n network.users[new_nick] = user\n end",
"title": ""
},
{
"docid": "0574dc6a006707d0978ddce992cf21e0",
"score": "0.6640648",
"text": "def set_nick(jid, nick = nil)\n # Check he's subscribed\n if not @subscriptions[jid] then\n say(jid, \"You are not subscribed, so cannot change your nick.\")\n return\n end\n\n # Check it's unique\n if(@subscriptions.values.map{|sub| sub.nick}.include? nick) then\n say(jid, \"That nick is already taken, sorry.\")\n return\n end\n\n # Try to assign\n old_nick = @subscriptions[jid].nick\n if(@subscriptions[jid].nick = nick) then\n say(jid, \"You are now known as #{@subscriptions[jid].nick}.\")\n $log.info \"#{old_nick} is now known as #{@subscriptions[jid].nick}.\"\n send_to_all(jid, \"#{old_nick} is now known as #{@subscriptions[jid].nick}.\")\n else\n $log.info \"#{old_nick} failed to change his nick.\"\n say(jid, \"Your requested nick was not accepted.\")\n end\n @subscriptions.save\n end",
"title": ""
},
{
"docid": "6211059798390279f50f7cb3eb56ccbc",
"score": "0.66028774",
"text": "def set_nick(new_nick)\r\n\t\t@nick = new_nick\r\n\tend",
"title": ""
},
{
"docid": "61df644cf084a86d473e7be4750b9a41",
"score": "0.6601811",
"text": "def nick_in_use(args)\r\n if @nickinuse == 0\r\n @botstate.nick = @altnick\r\n else\r\n @botstate.nick = @nick + ('_'*@nickinuse)\r\n end\r\n @server.write(@irc_proto.helper.nick(@botstate.nick))\r\n @nickinuse += 1\r\n end",
"title": ""
},
{
"docid": "3580643164cdd7f51a65ca7cb04e6c9e",
"score": "0.65980977",
"text": "def fix_nick\n if bot.nick != preferred_nick\n bot.info \"Nick is #{bot.nick}, but should be #{preferred_nick}. Fixing nickname.\"\n bot.nick = preferred_nick\n end\n end",
"title": ""
},
{
"docid": "ddbeecdfb7b6913a8ac232713539553f",
"score": "0.65481085",
"text": "def receive_nick_collision(m)\n if [email protected]_nicks.empty? && !@login\n # only works when not login\n @trying_nick += 1\n nick = @config.alt_nicks[@trying_nick]\n if nick\n @sentnick = nick\n send(:nick, nick)\n else\n try_another_nick\n end\n else\n try_another_nick\n end\n end",
"title": ""
},
{
"docid": "951550fb0b6d0354d8f9244bd83fc9f9",
"score": "0.65177983",
"text": "def nick(new_nick)\n # Dup strings so handler can filter safely\n new_nick = new_nick.dup\n\n handle(:outgoing_nick, new_nick)\n\n raw \"NICK :#{new_nick}\"\n end",
"title": ""
},
{
"docid": "1c4203d59e67f5021712572b4bfad685",
"score": "0.6515992",
"text": "def checker_nick(user_nick)\n if !User.find_by_nick(user_nick).blank?\n return user_nick + (rand(Time.now.sec * Time.now.hour * Time.now.min)).to_s\n else\n return user_nick\n end\n end",
"title": ""
},
{
"docid": "2e2fde3e80c2bd25a8f764d197ca6a9d",
"score": "0.6513896",
"text": "def check_conn\n\t\treturn if not @user or not @nick\n\t\tident = @ident || \"~#{@user[1]}\"\n\t\thostname = @hostname\n\t\tif @ircd.conf.user_pass and @pass != @ircd.conf.user_pass\n\t\t\tputs \"#{Time.now} bad password from #{@nick}!#{ident}@#{hostname}\"\n\t\t\t# sv_send \"bad pass\"\n\t\t\tcleanup\n\t\t\treturn\n\t\tend\n\t\tif @ircd.conf.cloak_users\n\t\t\thostname = Digest::MD5.hexdigest(hostname).downcase[0, 16] + '.fu'\n\t\tend\n\t\tclt = User.new(@ircd, @nick, ident[0, 10], hostname, @fd)\n\t\tclt.ip = @ip\n\t\tclt.descr = @user[4]\n\t\tclt.ts = Time.now.to_i\n\t\tclt.mode << 'S' if @fromport.pline[:ssl]\n\t\[email protected]_user clt\n\t\[email protected] self\n\t\[email protected]_user clt\n\t\[email protected] { |s| s.send_nick_full(clt) }\n\t\tclt.send_welcome\n\tend",
"title": ""
},
{
"docid": "dd40b11c29e3cec29e0aae9ffc7480e7",
"score": "0.6494422",
"text": "def update_nick(nick)\n @nick = nick\n end",
"title": ""
},
{
"docid": "dd40b11c29e3cec29e0aae9ffc7480e7",
"score": "0.6494422",
"text": "def update_nick(nick)\n @nick = nick\n end",
"title": ""
},
{
"docid": "04778e73c1b10260be0d90c02e20b0bc",
"score": "0.64819086",
"text": "def registration_failure(context, message) \n \n context.connection_listeners.each do |connection_listener|\n connection_listener.on_registration_failure(context, message)\n end\n \n return unless context.auto_nick_change\n \n raise ClientError(\"Maximum number of nick name changes reached. Giving up!\") if context.nick_generator.names.empty?\n nick = context.nick_generator.pop\n \n IRC::Commands::NickCommand.new(nick).execute(context)\n IRC::Commands::UserCommand.new(nick, Socket.gethostname, context.server.hostname, context.realname).execute(context)\n \n end",
"title": ""
},
{
"docid": "90d4b18fa98e6dd152c370f2eef4e728",
"score": "0.64785486",
"text": "def on_nick_already_in_use(context, nick_name)\n return unless context.auto_nick_change\n raise ClientError(\"Maximum number of nick name changes reached. Giving up!\") if context.nick_generator.names.empty?\n context.change_nick(context.nick_generator.pop) \n end",
"title": ""
},
{
"docid": "42de1cace320385099b55b0aab16e78f",
"score": "0.64699835",
"text": "def nick_here?(nick)\r\n @msg.channel.users.map {|user, modes| user}.include? nick\r\n end",
"title": ""
},
{
"docid": "cc5964c611891df897dfb8ee7269f3c4",
"score": "0.64593786",
"text": "def change_nick(context, nick)\n raise ClientError.new(\"Can't change nick name. Not connected to a server.\")\n end",
"title": ""
},
{
"docid": "778449e42c1b2c4bd0f196613b9da646",
"score": "0.6444441",
"text": "def change_own_nickname(auth, server_id, nick, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_members_me_nick,\n server_id, # This is technically a guild endpoint\n :patch,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/members/@me/nick\",\n { nick: nick }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"title": ""
},
{
"docid": "7fab847a2405dc44388d0059bf81caf9",
"score": "0.6434778",
"text": "def update_nick(new_nick)\n @last_nick = @name\n @name = new_nick\n # Unsync authname because some networks tie authentication to\n # the nick, so the user might not be authenticated anymore after\n # changing their nick\n unsync(:authname)\n @bot.user_list.update_nick(self)\n end",
"title": ""
},
{
"docid": "e500d0a32bf8224106cf3350322d1f04",
"score": "0.64064085",
"text": "def nick=(value)\n @irc.nick(value)\n end",
"title": ""
},
{
"docid": "0e6c594459205728a65f9b63d13d293e",
"score": "0.6335889",
"text": "def modify_current_user_nick(guild_id, nick: :undef, reason: nil)\n json = filter_undef({ nick: nick })\n route = Route.new(:PATCH, '/guilds/%{guild_id}/members/@me/nick', guild_id: guild_id)\n request(route, json: json, reason: reason)\n end",
"title": ""
},
{
"docid": "6ab3285507d710dc8cb39e7ce572a1bf",
"score": "0.63205314",
"text": "def set_nick(nick, reason = nil)\n # Discord uses the empty string to signify 'no nickname' so we convert nil into that\n nick ||= ''\n\n if @user.current_bot?\n API::User.change_own_nickname(@bot.token, @server_id, nick, reason)\n else\n API::Server.update_member(@bot.token, @server_id, @user.id, nick: nick, reason: nil)\n end\n end",
"title": ""
},
{
"docid": "47b7397c29e7b0cf29d5da818a496f67",
"score": "0.63126314",
"text": "def check_user\n user = User.find_by_nick params[:nick]\n \n if user and user.session_expired\n user.destroy\n user = nil\n end\n \n if user == nil\n user = User.new :nick => params[:nick]\n if user.save\n render :template => \"chats/check_user_proceed\"\n else\n flash[:error] = \"Error al registrar al nuevo usuario\"\n redirect_to chats_login_path\n end\n else\n render :template => \"chats/check_user_error\"\n end\n end",
"title": ""
},
{
"docid": "670a0ec58eeeb16d25c9361999258f37",
"score": "0.63080573",
"text": "def change_nick(context, nick)\n end",
"title": ""
},
{
"docid": "670a0ec58eeeb16d25c9361999258f37",
"score": "0.63080573",
"text": "def change_nick(context, nick)\n end",
"title": ""
},
{
"docid": "17f709e0e15e29ce58e0ae9c790b9e0b",
"score": "0.63065135",
"text": "def set_nick(nick, reason = nil)\n # Discord uses the empty string to signify 'no nickname' so we convert nil into that\n nick ||= ''\n\n if @user.current_bot?\n API::User.change_own_nickname(@bot.token, @server.id, nick, reason)\n else\n API::Server.update_member(@bot.token, @server.id, @user.id, nick: nick, reason: nil)\n end\n end",
"title": ""
},
{
"docid": "ae9457b40fab218ca6ddf98f0152ae21",
"score": "0.62951577",
"text": "def ch_nick(nick)\n IRCConnection.send_to_server(\"NICK #{nick}\")\n @nick = nick\n end",
"title": ""
},
{
"docid": "cb06ea94521903458ec775eb4ad3d87f",
"score": "0.6290656",
"text": "def set_nick(nick)\n @nick = nick\n send \"NICK #{@nick}\"\n end",
"title": ""
},
{
"docid": "a7492e3dae407a158a907abf84dc5f7e",
"score": "0.62833744",
"text": "def successful_registration\n check_campfire_authentication do\n check_nick_matches_authenticated_user\n send_welcome\n send_luser_info\n send_motd\n end\n end",
"title": ""
},
{
"docid": "b7aab7ce41b8903b0f2666e196e9095e",
"score": "0.6275265",
"text": "def nick_taken?(nick)\n has_key?(nick) && !virtual(nick)\n end",
"title": ""
},
{
"docid": "e7756eedc062a8918b4644ff4309f617",
"score": "0.62722903",
"text": "def change_own_nickname(token, server_id, nick, reason = nil)\n Discordrb::API.request(\n :guilds_sid_members_me_nick,\n server_id, # This is technically a guild endpoint\n :patch,\n \"#{Discordrb::API.api_base}/guilds/#{server_id}/members/@me/nick\",\n { nick: nick }.to_json,\n Authorization: token,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"title": ""
},
{
"docid": "aaf002bb015a1b6396e2134f622888dc",
"score": "0.6266773",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection again. Already registered.\") \n end",
"title": ""
},
{
"docid": "50b76777c1e8a74f234bdd0505e8e227",
"score": "0.6263317",
"text": "def check_nickname_changed\n logger.debug \"************** checking nickname changed\"\n \n # if this is a create (id does not exist) make sure the nickname is unique\n fix_nickname_duplication if self.id.blank?\n\n # if nickname changed text, not just case, create new permalink\n new_nickname = ActionController::Base.helpers.strip_links(self.nickname)\n nickname_was = self.nickname_was.present? ? self.nickname_was.downcase.strip : nil\n logger.debug \"************** nickname was: #{self.nickname_was}; nickname now: #{new_nickname}\"\n if nickname_was != new_nickname.downcase.strip\n logger.debug \"************** nickname changed, creating new permalink\"\n # make sure there are no tags in the nickname\n self.nickname = new_nickname\n self.generate_permalink! \n end\n return true\n end",
"title": ""
},
{
"docid": "10785e1d508856396949a391e7539b8b",
"score": "0.62603366",
"text": "def registration (thing)\n if thing.class != Incoming\n return\n end\n\n # additional check for nick collisions\n if thing.data[:nick]\n if (thing.server.data[:nicks][thing.data[:nick]] && thing.server.data[:nicks][thing.data[:nick]] != thing) || thing.server.clients[thing.data[:nick]]\n if thing.data[:warned] != thing.data[:nick]\n thing.send :numeric, ERR_NICKNAMEINUSE, thing.data[:nick]\n thing.data[:warned] = thing.data[:nick]\n end\n\n return\n end\n\n thing.server.data[:nicks][thing.data[:nick]] = thing\n end\n\n # if the client isn't registered but has all the needed attributes, register it\n if thing.data[:user] && thing.data[:nick]\n if thing.config.attributes['password'] && thing.config.attributes['password'] != thing.data[:password]\n return false\n end\n\n client = thing.server.connections.things[thing.socket] = Client.new(thing)\n\n client.nick = thing.data[:nick]\n client.user = thing.data[:user]\n client.realName = thing.data[:realName]\n\n # clean the temporary hash value and use the nick as key\n thing.server.connections.clients[:byName][client.nick] = client\n thing.server.connections.clients[:bySocket][client.socket] = client\n\n thing.server.data[:nicks].delete(client.nick)\n\n thing.server.execute(:registered, client)\n\n client.send :numeric, RPL_WELCOME, client\n client.send :numeric, RPL_HOSTEDBY, client\n client.send :numeric, RPL_SERVCREATEDON\n client.send :numeric, RPL_SERVINFO, {\n :client => Base.supportedModes[:client].join(''),\n :channel => Base.supportedModes[:channel].join(''),\n }\n\n supported = String.new\n\n Base.support.each {|key, value|\n if value != true\n supported << \" #{key}=#{value}\"\n else\n supported << \" #{key}\"\n end\n }\n\n supported = supported[1, supported.length]\n\n client.send :numeric, RPL_ISUPPORT, supported\n\n if !client.modes.to_s.empty?\n client.send :raw, \":#{server} MODE #{client.nick} #{client.modes}\"\n end\n\n motd(client)\n\n server.execute :connected, client\n end\n end",
"title": ""
},
{
"docid": "fbe68f8dde21a437db49d72f5727afd4",
"score": "0.6248475",
"text": "def test_nick_when_other\n @plugin.nick_changed 'somenick', 'somenick2'\n assert_equal 'somenick2', @client.state[:names]['#chan'][0]\n assert_equal 'somenick2', @client.state[:names]['#chan2'][2]\n # event should exist for all current channels\n assert_event @client.state[:events][1], NickChangedEvent, \n :who => 'somenick', :where => '#chan', :what => 'somenick2', :context => nil\n assert_event @client.state[:events][0], NickChangedEvent, \n :who => 'somenick', :where => '#chan2', :what => 'somenick2', :context => nil\n \n # TODO: private message gets updated with new name? probably.\n # TODO: is this a good idea? might b0rk the front-end app, by changing tab title?\n end",
"title": ""
},
{
"docid": "8ca03a19c3e3d2952b7bda04778e5c36",
"score": "0.6236562",
"text": "def nick_canon\n @nick_canon ||= @connection.canonize @nick\n end",
"title": ""
},
{
"docid": "5d92dd3767d897f352422341f09171f1",
"score": "0.6233133",
"text": "def update_nickname\n @current_user = get_current_user\n if params[:user_id] != nil && params[:nickname] != nil\n chat = Chat.find_by(id: params[:chat_id])\n user = ChatUser.user(session, @current_user, chat)\n old_nickname = user.nickname\n user.nickname = params[:nickname]\n if user.save\n payload = { :old_nickname => old_nickname, :nickname => user.nickname, :user_id => user.id }\n Pusher[\"presence-\" + chat.channel].trigger('updated_nickname', payload)\n render :text => \"SAVED\"\n else\n render :text => \"ERROR\"\n end\n else\n render :text => \"ERROR\"\n end\n end",
"title": ""
},
{
"docid": "55fcf00b89c8b0c9032903cc86e1ac43",
"score": "0.62224",
"text": "def nick\n \"#{@@prefix}#{@@nicks[username] || username}\"\n end",
"title": ""
},
{
"docid": "89fbfd3ec3aebd9266ef120752dfd3ee",
"score": "0.6210998",
"text": "def send_nick nick\n send_command 'NICK', nick\n end",
"title": ""
},
{
"docid": "5062aa497e939ecc33dfd6a8c3385170",
"score": "0.6187856",
"text": "def change_nick msg\n return unless @users.has_key? msg.nick_canon\n\n $log.debug(\"Channel.change_nick\") { \"Renaming user #{msg.nick} on #{@name}\" }\n\n changed_nick_canon = msg.connection.canonize msg.text\n\n # Apparently structs don't let you change values. So just make a\n # new user.\n changed_user = ChannelUser.new changed_nick_canon,\n @users[msg.nick_canon].user,\n @users[msg.nick_canon].host,\n @users[msg.nick_canon].modes\n\n @users.delete msg.nick_canon\n @users[changed_nick_canon] = changed_user\n end",
"title": ""
},
{
"docid": "2486c94c0a2941cdefb9908cd2e1f5f5",
"score": "0.6185147",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection. Not connected to a server.\") \n end",
"title": ""
},
{
"docid": "8ed84af12389ff264ac69ce0bc3a4fec",
"score": "0.61827403",
"text": "def fix_name\n if @bot.nick == \"#{shared[:Bot_Nick]}\"\n puts \"Nick is fine, no change necessary.\"\n else\n puts \"Fixing nickname.\"\n @bot.nick = \"#{shared[:Bot_Nick]}\"\n end\n end",
"title": ""
},
{
"docid": "cf97540a998e21814cc59a9dd79b0dcc",
"score": "0.6181418",
"text": "def on_nick(fullactor, actor, nickname)\n if irc.me == nickname\n irc.msg \"NickServ\", \"identify #{options[:nickpass]}\"\n end\n \n actor = actor.downcase\n nickname = nickname.downcase\n @nickmutex.synchronize do\n @nicklist.each do |target, nicklist|\n if nicklist.delete?(actor)\n nicklist.add(nickname)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7b90b2b55f3d96f808cbe8be78782473",
"score": "0.61702853",
"text": "def _nicknameinuse(event)\n event.message =~ /^(\\S+)/\n report \"Nickname #{$1} is already in use.\"\n\n if (!@registered)\n begin\n nextnick = @nicknames[([email protected]).find { |i| @nicknames[i] == $1 } + 1]\n if (nextnick != nil)\n nick nextnick\n else\n report '*** All nicknames in use. ***'\n raise ArgumentError.new(\"All nicknames in use\")\n end\n rescue\n report '*** Nickname selection error. ***'\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "7ac7058082b9d98a9a4493e2c1fda2fb",
"score": "0.6168089",
"text": "def setNewNickname(newnick)\n if !@@NicknameList.include? newnick\n @@NicknameList.delete newnick \n @Nickname = newnick \n @@NicknameList.push @Nickname\n else\n raise \"Another user is using that nickname.\"\n end \n end",
"title": ""
},
{
"docid": "8fa30fdada885fb491da2050e379d562",
"score": "0.61432356",
"text": "def handle_nick(cmd)\n unless cmd =~ /^NICK :(.*)$/\n return\n end\n\n nick = $1\n\n if \"InUseNick\" == nick\n add_output \":#{SERVER} 433 * #{nick} :Nickname is already in use.\"\n return\n end\n\n oldnick = @nick\n @nick = nick\n\n unless @logged_in\n add_output \"NOTICE AUTH :*** Looking up your hostname\",\n \":#{SERVER} NOTICE #{@nick} :*** You are exempt from user limits. congrats.\",\n \":#{SERVER} 001 #{@nick} :Welcome to the Fakey-fake Internet Relay Chat Network #{@nick}\",\n \":#{SERVER} 002 #{@nick} :Your host is #{SERVER}[0.0.0.0/6667], running version mock-irc-1.7.7\",\n \":#{SERVER} 003 #{@nick} :This server was created Nov 21 2009 at 21:20:48\",\n \":#{SERVER} 004 #{@nick} #{SERVER} mock-irc-1.7.7 foobar barbaz bazfoo\",\n \":#{SERVER} 005 #{@nick} CALLERID CASEMAPPING=rfc1459 DEAF=D KICKLEN=160 MODES=4 NICKLEN=15 PREFIX=(ohv)@%+ STATUSMSG=@%+ TOPICLEN=350 NETWORK=Fakeyfake MAXLIST=beI:25 MAXTARGETS=4 CHANTYPES=#& :are supported by this server\",\n \":#{SERVER} 251 #{@nick} :There are 0 users and 24 invisible on 1 servers\",\n \":#{SERVER} 254 #{@nick} 3 :channels formed\",\n \":#{SERVER} 255 #{@nick} :I have 24 clients and 0 servers\",\n \":#{SERVER} 265 #{@nick} :Current local users: 24 Max: 30\",\n \":#{SERVER} 266 #{@nick} :Current global users: 24 Max: 33\",\n \":#{SERVER} 250 #{@nick} :Highest connection count: 30 (30 clients) (4215 connections received)\",\n \":#{SERVER} 375 #{@nick} :- #{SERVER} Message of the Day - \",\n \":#{SERVER} 372 #{@nick} :- BOO!\",\n \":#{SERVER} 372 #{@nick} :- Did I scare you?\",\n \":#{SERVER} 372 #{@nick} :- BOO again!\",\n \":#{SERVER} 376 #{@nick} :End of /MOTD command.\"\n @logged_in = true\n return\n end\n\n # Hostmask is faked, but otherwise this is the message we send in response to a nick change\n add_output \":#{oldnick}!#{USERHOST} NICK :#{@nick}\"\n end",
"title": ""
},
{
"docid": "cbc3abd32707c209bde6a4089daf10bf",
"score": "0.61318",
"text": "def seen_user(irc, server_map, nick = nil, real_nick = nil)\n nick = irc.from.nnick unless nick\n if !real_nick or nick == real_nick\n server_map[nick] = true\n real_nick ||= nick\n else\n server_map[nick] = real_nick\n server_map[real_nick] = true\n end\n @user_watch_hooks.each { |m| m.call(true, irc, real_nick) }\n end",
"title": ""
},
{
"docid": "cbc3abd32707c209bde6a4089daf10bf",
"score": "0.61318",
"text": "def seen_user(irc, server_map, nick = nil, real_nick = nil)\n nick = irc.from.nnick unless nick\n if !real_nick or nick == real_nick\n server_map[nick] = true\n real_nick ||= nick\n else\n server_map[nick] = real_nick\n server_map[real_nick] = true\n end\n @user_watch_hooks.each { |m| m.call(true, irc, real_nick) }\n end",
"title": ""
},
{
"docid": "af8d2f155782e18fa50858b35673c796",
"score": "0.61298287",
"text": "def used_nick(user_nick)\n\t\tif !User.find_by_nick(user_nick).blank?\n\t\t\tself.nick = self.nick + (rand(Time.now.sec * Time.now.min)).to_s\n\t\tend\n\tend",
"title": ""
},
{
"docid": "572179b59de5106e09a04c7677523188",
"score": "0.6128583",
"text": "def on_nick(context, before, after)\n return if before.nick.strip.downcase != context.nick.strip.downcase\n context.nick = after.nick\n @log.debug(\"#{network_name(context)} Successfully changed nick name from #{before.nick} to #{after.nick}.\") \n end",
"title": ""
},
{
"docid": "9b794bc7ac63790616f7da349b84f57c",
"score": "0.61259234",
"text": "def set_nickname\n @user.set_nickname(params.require(:nickname))\n unless @user.save\n flash.now[:error] = \"Could not update nickname\"\n end\n end",
"title": ""
},
{
"docid": "088a117e6bd5be68458810cff5e5986a",
"score": "0.6114233",
"text": "def me?\n nick_canon == @connection.canonize(@connection.nick)\n end",
"title": ""
},
{
"docid": "e5a1ea7d89660e2c26f8f745033488ac",
"score": "0.61086494",
"text": "def check_usn\r\n if $ownerlist.include?(\"#{@msg.user.nick}\")\r\n @msg.user.send \"#{JSON.parse($redis.get(\"users_seen\"))}\"\r\n else\r\n @msg.user.send \"Sorry, this command is for owners only.\"\r\n end\r\n end",
"title": ""
},
{
"docid": "ab4d028f2b660f159d941a537008b7c8",
"score": "0.61020505",
"text": "def single_nick?\n @nick != '*' && @nick !~ /^!/\n end",
"title": ""
},
{
"docid": "ab4d028f2b660f159d941a537008b7c8",
"score": "0.61020505",
"text": "def single_nick?\n @nick != '*' && @nick !~ /^!/\n end",
"title": ""
},
{
"docid": "5b9a9dce64cea81bad93cbb04abd905c",
"score": "0.60915494",
"text": "def nick(nickname)\n write \"NICK \"+nickname\n end",
"title": ""
},
{
"docid": "a30e6f5796238dd0032816833ad77623",
"score": "0.6091364",
"text": "def nick=(new_nick)\n @context.change_nick(new_nick)\n end",
"title": ""
},
{
"docid": "980dcd7b46d590cc548f08ea27001dc9",
"score": "0.6081353",
"text": "def handleNickList(fullMessage, nicks, channel)\n nicks.each{|nick|\n nick.strip!\n ops = false\n\n if (nick.start_with?('@'))\n ops = true\n nick.sub!(/^@/, '')\n end\n\n ensureUser(nick, channel, ops)\n }\n end",
"title": ""
},
{
"docid": "d7f51719b2cbded034bb76d282c3821c",
"score": "0.6073114",
"text": "def real_nick\n @real_nick ||=\n real_nick_in(@original_head) ||\n real_nick_in(@original_tail) || target_nick\n end",
"title": ""
},
{
"docid": "4dfabb2e91f8dea5146ea5299918c93f",
"score": "0.6070192",
"text": "def nick_name=(value)\n @nick_name = value\n end",
"title": ""
},
{
"docid": "0a3ad45ad1e561d7bdb44dd05c1b737f",
"score": "0.60657",
"text": "def change_nick nick\n send_msg Cmd.nick(nick)\n end",
"title": ""
},
{
"docid": "b053a4413e08b055e788f0669e7785e5",
"score": "0.60601854",
"text": "def check_nickname(n)\n\t\treturn if n =~ /^(nick|chan|oper)serv$/i\n\t\tn.length < conf.max_nickname_len and n =~ /^[a-z_`\\[\\]\\\\{}|\\^][a-z_`\\[\\]\\\\{}|\\^0-9-]*$/i\n\tend",
"title": ""
},
{
"docid": "caa579a17fa6b9cd9a2854d2d4558154",
"score": "0.60478604",
"text": "def nick(nick)\n return \"NICK #{nick}\"\n end",
"title": ""
},
{
"docid": "97e93c375df2268ff5599133c58521d5",
"score": "0.60429704",
"text": "def got_nick network, command\n nick = command.sender.nickname\n \n if channels = network.channels_with_user(nick)\n channels.each do |channel|\n if user = channel.user_by_nick(nick)\n emit :user_rename, channel, user, user.nick, command[0]\n user.nick = command[0]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9d9abc82e0152ea262632482a83083a4",
"score": "0.603325",
"text": "def say_nickname_is_already_in_use\n reply cmd: '433', params: ['Nickname is already in use.']\n end",
"title": ""
},
{
"docid": "3ea75547ccd35159594e98a1e2b0b94d",
"score": "0.6032112",
"text": "def getuser(nick)\n if @users[nick] and @users[nick][:user]\n @users[nick][:user]\n else\n Thread.new do\n sleep(1)\n whois(nick)\n end\n wait_for(type: :code, code: ProtonBot::Numeric::WHOISUSER)\n @users[nick][:user]\n end\n end",
"title": ""
},
{
"docid": "791b249323a145338c43efb7a79a7baa",
"score": "0.6005306",
"text": "def raw_nick=(value)\n self.nick = Nick[value]\n end",
"title": ""
},
{
"docid": "1c2c369b2d78cd47baae8fcb753ba405",
"score": "0.59946996",
"text": "def set_nick(nick)\n @name = nick\n end",
"title": ""
},
{
"docid": "1c2c369b2d78cd47baae8fcb753ba405",
"score": "0.59946996",
"text": "def set_nick(nick)\n @name = nick\n end",
"title": ""
},
{
"docid": "4bdfd3f0c06a953a95a1747b304702af",
"score": "0.59622073",
"text": "def nickname\n nick_name || user.name\n end",
"title": ""
},
{
"docid": "03d70455849c8b3a198a537025e45909",
"score": "0.5949989",
"text": "def target_nick\n resolve_nick(@nick)\n end",
"title": ""
},
{
"docid": "05534bc71fd643c97808443c536b35dd",
"score": "0.59335977",
"text": "def test_nick_when_self\n @plugin.nick_changed 'nick', 'newnick'\n assert_equal 'newnick', @client.state[:names]['#chan'][1]\n # should be an event listed in every channel\n assert_event @client.state[:events].last, NickChangedEvent,\n :who => 'nick', :where => '#chan', :what => 'newnick', :context => :self\n assert_event @client.state[:events].first, NickChangedEvent,\n :who => 'nick', :where => '#chan2', :what => 'newnick', :context => :self\n end",
"title": ""
},
{
"docid": "8dbdb9c1e387078251eb28e55812540e",
"score": "0.5932217",
"text": "def register(context, nick, login, realname)\n raise ClientError.new(\"Can't register connection. Connection registration is only possible in the unregistered state.\")\n end",
"title": ""
},
{
"docid": "c4ca33b523e7c61955bc53a2f37dc400",
"score": "0.59285057",
"text": "def resolve_nick_conflicts!\n duplicates = duplicate_nick_users\n\n duplicates.dup.each do |user|\n new_nick = generate_unique_nick(user, duplicates)\n update_user_nick!(user, new_nick)\n duplicates << user # Consider newly generated nicks when checking further duplicates.\n end\n end",
"title": ""
},
{
"docid": "68c94b23343eea7f624fe755fb02a7ba",
"score": "0.59169996",
"text": "def validate_nick!(nick)\n unless valid_nick?(nick)\n raise ArgumentError, \"invalid nickname: #{nick.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "7ceedfc43649342acbb1e026bce8c83d",
"score": "0.5915125",
"text": "def find_ensured(nick)\n sanitized_nick = sanitize(nick)\n\n if sanitized_nick == @bot.id\n user = @bot\n end\n\n @mutex.synchronize do\n if user.nil?\n user = @cache[sanitized_nick] ||= User.new(nick, @bot)\n end\n user\n end\n end",
"title": ""
},
{
"docid": "7dec78b3dc1862b63b0594235504c41d",
"score": "0.59115255",
"text": "def change_nick(to)\n write(\"NICK #{to}\")\n self\n end",
"title": ""
},
{
"docid": "a6b72fb38bc6649419f2eed1b025e1e5",
"score": "0.5899519",
"text": "def change_nick msg\n return unless @users.key? msg.nick\n\n $log.debug(\"Channel.change_nick\") { \"Renaming user #{msg.nick} on #{@name}\" }\n\n # Apparently structs don't let you change values. So just make a\n # new user.\n changed_user = ChannelUser.new self,\n msg.text,\n @users[msg.nick].user,\n @users[msg.nick].host,\n @users[msg.nick].modes\n\n @users.delete msg.nick\n @users[msg.text] = changed_user\n end",
"title": ""
},
{
"docid": "6488398bb35f87f0e521cd4f934ba79a",
"score": "0.589846",
"text": "def ask_user(user, server)\n talk(\"nickserv\", \"status #{user}\", server)\n end",
"title": ""
},
{
"docid": "4f8985e257279031ca877ca92e76ef47",
"score": "0.5896798",
"text": "def update_user_nick!(user, nick)\n @channels.values.each do |channel|\n channel_user = channel.find_user_by_id(user.id)\n channel_user.nick = nick if channel_user\n end\n end",
"title": ""
},
{
"docid": "94f299065e617edc0fa3a891cce2d521",
"score": "0.58864415",
"text": "def nick_change(from, to)\n if (u = @users.delete(from.nnick))\n u.nick = to\n @users[u.nnick] = u\n# $log.puts \"Nick change in #{@name}: #{from.nick} => #{to}\"\n# $log.puts @users.keys.join(', ')\n end\n end",
"title": ""
},
{
"docid": "86447eb2997e09c58f56ea8f950fbc56",
"score": "0.58855236",
"text": "def register(context, nick, login, realname)\n end",
"title": ""
},
{
"docid": "1c9e07356b7d4f0837691db33b20beca",
"score": "0.58825535",
"text": "def test_rfc_compliant_errors\n @client.state[:nick] = 'nick'\n @client.state[:newnick] = %w{newnick, newnick2}\n @plugin.nick_in_use# message(:nick_in_use_rfc)\n assert_equal ['newnick2'], @client.state[:newnick]\n @plugin.nick_invalid# message(:invalid_nick_rfc) \n assert_equal [], @client.state[:newnick]\n end",
"title": ""
},
{
"docid": "58c6cbf2260ceb4301ba25149c18788a",
"score": "0.5872166",
"text": "def nick! nickname\n $bot.send_line \"NICK #{nickname}\"\nend",
"title": ""
},
{
"docid": "b3cbacb83d21266c844fd8a0248e41c8",
"score": "0.5864394",
"text": "def on_nickname_change(room, mes)\n end",
"title": ""
},
{
"docid": "a63b5de858d6a1aad49d218b307f09f3",
"score": "0.5859628",
"text": "def myself\n return false unless logged_in?\n self.nickserv.info(@user)\n end",
"title": ""
},
{
"docid": "3b1f7d44c963d94bd2fb22663b3ab44e",
"score": "0.5858296",
"text": "def change_nick msg\n return if msg.connection != @connection\n return unless key? msg.nick\n\n $log.debug(\"Users.add_user\") { \"Renaming user #{msg.nick} on #{@connection.name}\" }\n\n temp = self[msg.nick]\n\n delete msg.nick\n\n temp.nick = msg.text\n\n self[msg.text] = temp\n end",
"title": ""
},
{
"docid": "ae3311033e6b06ac3fb4bd9559492013",
"score": "0.5857126",
"text": "def check_client(client, login_password)\n pair = login_password.split\n if @clients[pair[1]].nil?\n client.puts 'A' + @spacer + \"Client with this nickname doesn't exist.\"\n Thread.kill self\n end\n unless @clients[pair[1]] == pair[2]\n client.puts 'A' + @spacer + 'Wrong password.'\n Thread.kill self\n end\n if @connections[client].nil?\n @connections[client] = pair[1]\n end\n puts Time.now.to_s = \"Client with nickname #{pair[1]} has been authorized.\"\n client.puts 'R' + @spacer + 'You log in successfull!'\n @connections.each_key do |other_client|\n unless other_client == client\n other_client.puts 'M' + @spacer + \"#{pair[1]} joined the chat.\"\n end\n end\n end",
"title": ""
},
{
"docid": "3f4b6f09b1c51f35c5cadcd96935d68a",
"score": "0.58531904",
"text": "def registered?\n !!@nick && !!@email && !!@real_name\n end",
"title": ""
},
{
"docid": "9e532edd0f9493d22d781a015e3f10fe",
"score": "0.5852667",
"text": "def nick? &handler\n $bot.handlers[:NICK] << handler\nend",
"title": ""
},
{
"docid": "96195a73b44838df880f0c1f149491fa",
"score": "0.58459485",
"text": "def lost_user(irc, server_map, nick = nil, user = nil)\n nick = irc.from.nnick unless nick\n user = server_map[nick] unless user\n real_nick = user == true ? nick : user\n @user_watch_hooks.each { |m| m.call(false, irc, real_nick) }\n server_map.delete(nick)\n end",
"title": ""
},
{
"docid": "96195a73b44838df880f0c1f149491fa",
"score": "0.58459485",
"text": "def lost_user(irc, server_map, nick = nil, user = nil)\n nick = irc.from.nnick unless nick\n user = server_map[nick] unless user\n real_nick = user == true ? nick : user\n @user_watch_hooks.each { |m| m.call(false, irc, real_nick) }\n server_map.delete(nick)\n end",
"title": ""
},
{
"docid": "19005c042096909d001d0bb89b82bab1",
"score": "0.5820706",
"text": "def test_newnick_state_maintenance\n @client.state[:nick] = 'nick'\n @client.state[:newnick] = ['foo', 'gnar'] # start with a couple nicks pushed on the stack\n @plugin.nick_invalid\n assert_equal ['gnar'], @client.state[:newnick], 'should have popped foo, not gnar'\n @client.state[:newnick] = ['foo', 'gnar']\n @plugin.nick_in_use\n assert_equal ['gnar'], @client.state[:newnick], 'should have popped foo, not gnar'\n end",
"title": ""
},
{
"docid": "a3d5d9467023d23113c2b71db8f2625e",
"score": "0.5817127",
"text": "def call\n nick\n end",
"title": ""
},
{
"docid": "7ca992361abebe5cb0bc7f6b9b2fd356",
"score": "0.5814894",
"text": "def cmd_identify(irc, line)\n pass, nick = line ? line.split(' ', 2) : nil\n nick = nil if nick and nick.length == 0\n if irc.channel\n irc.reply 'This command can only be used in private.'\n elsif !line or line.length == 0\n irc.reply 'Empty password given. USAGE: identify <password> [nick-name].'\n elsif nick and !$config['irc/track-nicks']\n irc.reply \"The nick-name argument is only supported when nick-name tracking is enabled, which it isn't.\"\n elsif !(u = $config[\"servers/#{sn = irc.server.name}/users/#{nnn = IRC::Address.normalize(nn = nick ? nick : irc.from.nick)}\"])\n irc.reply \"Do I know you? You'll want to 'register' instead, pal.\"\n else\n if pass[0] == ?-\n silent = true\n pass = pass[1..-1]\n else silent = false end\n\n # Auto detect hashed passwords.\n hashed_pw = false\n if (p = u['password'])\n if p.length == 40 and p =~ /^[0-9a-f]{40}$/\n pass = Digest::SHA1.hexdigest pass\n hashed_pw = true\n end\n end\n\n # Check if the given password is correct.\n if !p or p != pass\n irc.reply 'Incorrect password given.'\n return\n end\n\n # Auto hash password, if needed.\n unless hashed_pw\n u['password'] = Digest::SHA1.hexdigest pass\n irc.reply \"Your password was rehashed.\" unless silent\n end\n\n if (s = @serv[sn]) and s[nnn]\n irc.reply \"You're already identified, #{nn} :-).\" unless silent\n else\n real_nn = irc.from.nnick\n irc.server.channels.each_value do |chan|\n if chan.users.include?(real_nn)\n @serv[sn] = (s = {}) unless s\n seen_user(irc, s, real_nn, nnn)\n unless silent\n usr_str = (real_nn == nnn) ? '' : \"real nick: #{nn}, \"\n irc.reply \"Alright, you're now identified (#{usr_str}using mask: #{irc.from.mask})!\"\n end\n global_actions(irc, nnn)\n return\n end\n end\n irc.reply 'You need to join at least one channel I am on, before you identify.'\n end\n end\n end",
"title": ""
}
] |
f809625b8598b0d3763ab12f2ca57149
|
Sleep In The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in. sleep_in(False, False) > True sleep_in(True, False) > False sleep_in(False, True) > True
|
[
{
"docid": "ecd91a06a8547ca61a3c934cf308430f",
"score": "0.7102728",
"text": "def sleep_in(weekday, vacation)\n # Please write your code in here\nend",
"title": ""
}
] |
[
{
"docid": "9b3b537dd619479c145244d8fafcda35",
"score": "0.76963085",
"text": "def sleep_in?(weekday, vacation)\n\tif !weekday || vacation\n\t\treturn true\n\tend\n\treturn false\nend",
"title": ""
},
{
"docid": "cef45244f2a7b42f5ccfd8df29b63697",
"score": "0.72281677",
"text": "def sleep_in(is_weekday, is_vacation)\n if is_weekday != true || is_vacation == true\n puts \"True\"\n else\n puts \"False\"\n end\nend",
"title": ""
},
{
"docid": "4da5b06519d91e05453e87871475f942",
"score": "0.70773566",
"text": "def sleep_in?(options = {})\n currentTime = Time.now \n #the vacation is the key in the options hash and it tests to see if the vacation is in there, if it is true it is there \n #also tests if the day is saturday oor sunday \n if options[:vacation] == true || currentTime.saturday? || currentTime.sunday? \n return true\n else \n false\n end\nend",
"title": ""
},
{
"docid": "205fb9762419887a64e125c062fe5502",
"score": "0.67725015",
"text": "def sleep_in?(option_hash)\n\tif option_hash[:vacation] == true \n\t\treturn true\n\telsif Time.now.day % 7 == 0 || Time.now.day % 6 == 0\n\t\treturn true\n\telse return false\n\tend\nend",
"title": ""
},
{
"docid": "1c132978f7f9f59c07f6b5fb0a195aa0",
"score": "0.54059196",
"text": "def check_in\n self.in_at = Time.zone.now.to_datetime\n halt \"All components must be inventoried before check in\" unless check_in_components_inventoried?\n\n # TODO: move this up into the authorization layer\n #halt \"In attendant must have the 'attendant' role\" unless in_attendant_has_proper_roles?\n #halt \"In attendant can not check in equipment to themselves\" unless in_attendant_is_not_the_client?\n end",
"title": ""
},
{
"docid": "3c3d4392ed847d6149691c709abd8503",
"score": "0.525701",
"text": "def is_sleeping=(state)\n @is_sleeping = state\n end",
"title": ""
},
{
"docid": "c312d4e957217b1507a40e59c940d13f",
"score": "0.5222559",
"text": "def duty_day?(wday)\n return Setting.plugin_scheduler['duty'].include?(wday.to_s)\nend",
"title": ""
},
{
"docid": "6d1c87ddf40a9b14eda858b14d9ce2a2",
"score": "0.5216872",
"text": "def is_sleeping?\n @is_sleeping\n end",
"title": ""
},
{
"docid": "4cdf4012d79d2515b5aab2665cd29fac",
"score": "0.51881295",
"text": "def check_in\n self.in_at = DateTime.current\n halt \"All components must be inventoried before check in\" unless check_in_components_inventoried?\n\n # TODO: move these up into the authorization layer:\n #halt \"In attendant must have the 'attendant' role\" unless in_attendant_has_proper_roles?\n #halt \"In attendant can not check in equipment to themselves\" unless in_attendant_is_not_the_client?\n end",
"title": ""
},
{
"docid": "8071da7a825b2b75a10d88c0ceb714d8",
"score": "0.51847255",
"text": "def get_worked_out(current_week, day_of_week)\n \t\t# return true or false\n \tend",
"title": ""
},
{
"docid": "77e7d18507f27aa4c3773fe2f6490bc7",
"score": "0.5177232",
"text": "def within_week?(day)\n (start_date..end_date).cover?(day)\n end",
"title": ""
},
{
"docid": "3cc3229ce9473aa8e639ffba975c7efa",
"score": "0.5163181",
"text": "def working?(start_time, end_time)\n return false unless venue.in_business?(start_time, end_time)\n day_offs.each do |dayoff|\n return false if dayoff.covers?(start_time, end_time)\n end\n true\n end",
"title": ""
},
{
"docid": "97358a595b2e2a04d4623df037012356",
"score": "0.51436746",
"text": "def check_in_periodically\n @check_in_thread = Thread.new do\n loop do\n sleep CHECK_IN_INTERVAL\n check_in\n end\n end\n end",
"title": ""
},
{
"docid": "86e80229258a75862bceb63f6238602f",
"score": "0.512381",
"text": "def weekday?\n BusinessTime::Config.weekdays.include?(wday)\n end",
"title": ""
},
{
"docid": "65cc97d732cc392702565535e140dbc8",
"score": "0.5118735",
"text": "def check_in_out\n if TimeLogConfig.first.check_in_time?(Time.at(params[:timestamp].to_i))\n @check_in = true\n check_in\n else\n @check_in = false\n check_out\n end\n end",
"title": ""
},
{
"docid": "aeb40b3c4754aa6509c360b695e86937",
"score": "0.5089718",
"text": "def workday?(day)\n Time.weekday?(day) &&\n !BusinessTime::Config.holidays.include?(day.to_date)\n end",
"title": ""
},
{
"docid": "aeb40b3c4754aa6509c360b695e86937",
"score": "0.5089718",
"text": "def workday?(day)\n Time.weekday?(day) &&\n !BusinessTime::Config.holidays.include?(day.to_date)\n end",
"title": ""
},
{
"docid": "aeb40b3c4754aa6509c360b695e86937",
"score": "0.5089718",
"text": "def workday?(day)\n Time.weekday?(day) &&\n !BusinessTime::Config.holidays.include?(day.to_date)\n end",
"title": ""
},
{
"docid": "b7decaad73c1ccbde74a176975dc4e0f",
"score": "0.5078017",
"text": "def check_in \n # User already checked in thru SMS before deadline\n if self.check_in_current == true \n good_check_in_tally\n check_if_still_active\n else \n # User has NOT checked in via SMS or website and is NOW DUE\n if any_goals_on_stage? # If there is already something on stage\n go_on_queue\n schedule_two_hour_check_in_deadline\n schedule_check_in_deadline\n else # If stage has nil, go on stage for pending SMS reply\n go_on_stage\n schedule_two_hour_check_in_deadline\n send_check_in_sms\n schedule_check_in_deadline\n end\n end\n end",
"title": ""
},
{
"docid": "80b7cb904e94c6d08bb349a59820f3b0",
"score": "0.5076025",
"text": "def asleep?\n !awake?\n end",
"title": ""
},
{
"docid": "f0218efb724e031a571493386c5ddcd8",
"score": "0.5066315",
"text": "def working_day?\n !weekend? and !public_holiday?\n end",
"title": ""
},
{
"docid": "48d6d3c72be36a6403d3211850b15b60",
"score": "0.5055996",
"text": "def is_sleeping?(user, time = Time.now)\n # build sleep range\n sleep = %w{bgn end}.map { |s| user[\"sleep_#{s}\"].to_i }\n\n # compare user sleep time\n time.hour >= sleep.first && time.hour <= sleep.last\n end",
"title": ""
},
{
"docid": "2e3fddda59b24e2112800420af0f4a3a",
"score": "0.504915",
"text": "def delayed_day\n index_yesterday = Time.now.strftime(\"%w\").to_i - 1\n if index_yesterday < 0\n index_yesterday = 6\n end\n abbreviation_array = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\n yesterday = abbreviation_array[index_yesterday]\n if yesterday == self.day_in_week\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "73700018f8ab277e67b55eddcf7271ca",
"score": "0.5029693",
"text": "def happen_in_day_of_the_week?(date)\n byday = @rec['BYDAY']\n if byday\n byday.include?(DAYS_IN_THE_WEEK[date.wday])\n else\n date.wday == start_date.wday\n end\n end",
"title": ""
},
{
"docid": "49be9f3a3595f5472e815b586e33612f",
"score": "0.4988117",
"text": "def working_day?\n weekday? && ! public_holiday?\n end",
"title": ""
},
{
"docid": "49be9f3a3595f5472e815b586e33612f",
"score": "0.4988117",
"text": "def working_day?\n weekday? && ! public_holiday?\n end",
"title": ""
},
{
"docid": "8a9b01046dc181a0a22dcec588d8f02d",
"score": "0.49680328",
"text": "def meow_asleep\n\t\t\"MEOW\" unless !@sleeping\n\tend",
"title": ""
},
{
"docid": "a4ef023646c98a0ef28848449dc0edab",
"score": "0.4960912",
"text": "def dayIs2( aDay )\r\n\tworking_overtime = true\r\n\tif aDay == 'Saturday' || aDay == 'Sunday' && !working_overtime # note: can't use 'not' here!\r\n\t\tdaytype = 'holiday'\r\n\t\tputs( \"Hurrah!\" )\r\n\telse\r\n\t\tdaytype = 'working day'\r\n\tend\r\n\treturn daytype\r\nend",
"title": ""
},
{
"docid": "6b5380cf45163f4ab6bacc2f44f5f4b5",
"score": "0.49604073",
"text": "def dayIs2(aDay)\n working_overtime = true\n # note: can't use 'not' here!\n if aDay == 'Saturday' || aDay == 'Sunday' && !working_overtime\n daytype = 'holiday'\n puts('Hurrah!')\n else\n daytype = 'working day'\n end\n daytype\nend",
"title": ""
},
{
"docid": "197256d66cfe2b066122ab90d6e06ae6",
"score": "0.49479792",
"text": "def weekday?\n !weekend?\n end",
"title": ""
},
{
"docid": "46c64a771a866201cbd5ec382faddd56",
"score": "0.49306",
"text": "def is_today_the_weekend?(d)\r\n if d == 'sat' || (d == 'sun' && !$work_overtime) ### if d is saturday or sunday and not overtime return false, if any other day return false\r\n return true ### true equals sat and sun\r\n else\r\n return false ### false equals mon to friday\r\n end\r\nend",
"title": ""
},
{
"docid": "f9e49275ea24d29f9858e4cef3177cac",
"score": "0.49194548",
"text": "def weekday?\n self.wday.between?(1,5)\n end",
"title": ""
},
{
"docid": "395f4e62e9a544b06bd9ef2fd1b09fdd",
"score": "0.4909849",
"text": "def wake_up\n @sleeping = false\n \"Waking up the squirrel\"\n end",
"title": ""
},
{
"docid": "6935c802e1500ab84a27c74f9f9ed938",
"score": "0.490496",
"text": "def business_day?\n (monday? || tuesday? || wednesday? || thursday? || friday?) && not_holiday?\n end",
"title": ""
},
{
"docid": "96756272095ebc4f1f820847d183876b",
"score": "0.48956555",
"text": "def weekday?(day)\n BusinessTime::Config.weekdays.include? day.wday\n end",
"title": ""
},
{
"docid": "96756272095ebc4f1f820847d183876b",
"score": "0.48956555",
"text": "def weekday?(day)\n BusinessTime::Config.weekdays.include? day.wday\n end",
"title": ""
},
{
"docid": "96756272095ebc4f1f820847d183876b",
"score": "0.48956555",
"text": "def weekday?(day)\n BusinessTime::Config.weekdays.include? day.wday\n end",
"title": ""
},
{
"docid": "166f46da7ce3dfc1a0a03a08c36b3626",
"score": "0.48661625",
"text": "def set_alarm(employed, vacation)\n if employed == true && vacation == false\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "166f46da7ce3dfc1a0a03a08c36b3626",
"score": "0.48661625",
"text": "def set_alarm(employed, vacation)\n if employed == true && vacation == false\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "b9494168d53d2645f1d3110037bb991e",
"score": "0.48404717",
"text": "def perform_in(interval, *args); end",
"title": ""
},
{
"docid": "a61f9aa3b48334b0ef57d1acae77c635",
"score": "0.4833191",
"text": "def scheduled_within(time_from_now = 3.days)\n if !self.scheduled?\n return false\n else \n return (self.player_budge.day_starts_at <= self.player_budge.day_starts_at + time_from_now)\n end\n end",
"title": ""
},
{
"docid": "782cff74d547a79f45b6de071fe394db",
"score": "0.48253146",
"text": "def is_in\n self.current_status.nil? || self.current_status.in\n end",
"title": ""
},
{
"docid": "6138e398b92edaba5475a10dd84b74d4",
"score": "0.47914225",
"text": "def is_weekday(the_day)\n ! is_weekend(the_day)\n end",
"title": ""
},
{
"docid": "7e572f3f26b498b9e62642d3af01dd75",
"score": "0.47848046",
"text": "def inside(player)\n @while_in.call(player) unless @while_in.nil?\n end",
"title": ""
},
{
"docid": "290e4572017964073a9440f36f9cfe74",
"score": "0.47838387",
"text": "def workday?(day, options={})\n ActiveSupport::Deprecation.warn(\"`Time.workday?(time)` is deprecated. Please use `time.workday?`\")\n day.workday?(options)\n end",
"title": ""
},
{
"docid": "3a570d1e2a80fd2c1507265141b9dd46",
"score": "0.4783771",
"text": "def offduty_time?\n return true if [0, 6].include?(Time.now.wday)\n if @monitor_config['onduty_time_start'] and @monitor_config['onduty_time_end']\n return !(@monitor_config['onduty_time_start'] < Time.now.hour \\\n and @monitor_config['onduty_time_end'] > Time.now.hour)\n end\n end",
"title": ""
},
{
"docid": "59b05a9c45763133cedd1d231024d9f3",
"score": "0.47688586",
"text": "def in?\n !!@in\n end",
"title": ""
},
{
"docid": "34bba08f359f3c139ef3ff3900161784",
"score": "0.4766317",
"text": "def weekend_checker\n time = Time.now\n puts time\n weekend = false\n\n if time.sunday? == false\n weekend = time.saturday?\n end\n\n if time.saturday? == false\n weekend = time.sunday?\n end\n \n weekend\n #binding.pry\nend",
"title": ""
},
{
"docid": "7a08fe08f3fd42bc309a18b3647a9dbe",
"score": "0.4753834",
"text": "def perform_in(interval, *args)\n schedule(args: args, time_in: interval)\n end",
"title": ""
},
{
"docid": "08eb0d7235a4503baf40547c12c27a77",
"score": "0.47477865",
"text": "def set_alarm(employed, vacation)\n employed && !vacation\nend",
"title": ""
},
{
"docid": "d42f398839e8d40cc343972f0c18d569",
"score": "0.4729935",
"text": "def monday?\n wday == 1\n end",
"title": ""
},
{
"docid": "4569d6ad2db2dca28a70b757d132a6f9",
"score": "0.4720022",
"text": "def weekend?\n scheduled_on.saturday? || scheduled_on.sunday?\n end",
"title": ""
},
{
"docid": "5b105810f936098b1133d479f6bec9a1",
"score": "0.47144184",
"text": "def wf_on_enter_asleep\n puts \"I peed all over the bed\"\n end",
"title": ""
},
{
"docid": "d23815c0a472572d68c24da82eb9a154",
"score": "0.4704496",
"text": "def business_day?(date)\n date = date.to_date\n working_day?(date) && !holiday?(date)\n end",
"title": ""
},
{
"docid": "a089b674edb5bd4432302ce75d6f3557",
"score": "0.47043726",
"text": "def waiting?\n !checked_in?\n end",
"title": ""
},
{
"docid": "117a414e0a08c028495b8c3987c0a905",
"score": "0.4694953",
"text": "def when_do_you_meet_for_standup\n Standup.new(10, 15, Standup::DAYS_IN_WEEK[0])\n end",
"title": ""
},
{
"docid": "89ed8999cf534dedabc34ca6453cd7eb",
"score": "0.46836647",
"text": "def meow_awake\n\t\t\"MEOW\" unless self.sleeping\n\tend",
"title": ""
},
{
"docid": "d8463fa1efe59c765487c5e545a65b24",
"score": "0.46834847",
"text": "def schedule\n CheckWorker.perform_in(interval, id) \n end",
"title": ""
},
{
"docid": "bfecbb12b969cb1a10397349b3f3971e",
"score": "0.46826",
"text": "def business_day?(day, open_sat)\n formated_day = day.strftime('%d-%m')\n\n if open_sat\n if day.on_weekday?\n OFFICIAL_HOLIDAYS.exclude?(formated_day) && day.on_weekday?\n else\n day.saturday?\n end\n else\n OFFICIAL_HOLIDAYS.exclude?(formated_day) && day.on_weekday?\n end\n end",
"title": ""
},
{
"docid": "03dd8884b7e925c23e5a228cf698f0d3",
"score": "0.4676752",
"text": "def tuesday?\n wday == 2\n end",
"title": ""
},
{
"docid": "8bc90854247031460a0819fd56e8fcde",
"score": "0.46725586",
"text": "def check_in_params\n params.require(:check_in).permit(:name, :weekday, :start_date, :account_id, :user_id, :schedule_period, :time, :status)\n end",
"title": ""
},
{
"docid": "ef62d21e38f4044b96ff6d900d6c4b87",
"score": "0.46717116",
"text": "def skipped_day?(day_inxeces)\n Time.zone.today.wday.in?(day_inxeces)\n end",
"title": ""
},
{
"docid": "9bd2680c886a6a319efac787138aba15",
"score": "0.46716756",
"text": "def weekday?\n (1..5).include?(self.wday)\n end",
"title": ""
},
{
"docid": "67b6c8cf53495fd310d5677261c6f50c",
"score": "0.46634927",
"text": "def saturday?\n wday == 6\n end",
"title": ""
},
{
"docid": "5b3387d4c9a7593758541600952cef96",
"score": "0.46592963",
"text": "def during? time\n @time_span.cover? time\n end",
"title": ""
},
{
"docid": "e8ebf5ba57649232f8549f425e2ae9c1",
"score": "0.46566954",
"text": "def on_schedule\n DateTime.current <= last_checkin + extract_interval\n end",
"title": ""
},
{
"docid": "65dee8a660ff7ebf3ec42e6fc79470da",
"score": "0.46554673",
"text": "def sleeping?\n MSPhysics::Newton::Body.is_sleeping?(@address)\n end",
"title": ""
},
{
"docid": "65dee8a660ff7ebf3ec42e6fc79470da",
"score": "0.46552616",
"text": "def sleeping?\n MSPhysics::Newton::Body.is_sleeping?(@address)\n end",
"title": ""
},
{
"docid": "24b61a20bd16c78022bc874c9f22525c",
"score": "0.46531954",
"text": "def toggle_for_range(togglr, dates)\n dates.each do |date|\n if togglr.date_has_entry? date\n puts \"#{date} has entry.\"\n elsif togglr.date_is_holiday? date\n puts \"#{date} is umich holiday.\"\n elsif date.sunday? || date.saturday?\n puts \"#{date} is a weekend.\"\n else\n puts \"#{date} creating entry.\"\n #togglr.create_entry current_day \n end\n sleep(1)\n end\nend",
"title": ""
},
{
"docid": "242264c206a0067d05559fae1e519fd8",
"score": "0.4649461",
"text": "def scheduled?\n downcased_state == SCHEDULED\n end",
"title": ""
},
{
"docid": "2302d53502adebb5887f254c9df25233",
"score": "0.46395174",
"text": "def windsday?; @wday == Vanadiel::Day::WINDSDAY; end",
"title": ""
},
{
"docid": "fba3f7148ed2da4f6b20df3d89a0da3d",
"score": "0.46393618",
"text": "def has_in_or_out\n (self.playfrom && self.playfrom_seconds.to_i > 0) || (self.playto && self.playto_seconds.to_i > 0) && self.playfrom_seconds != self.playto_seconds\n end",
"title": ""
},
{
"docid": "f398c9779719243c7114ce68a73cb1ad",
"score": "0.46223637",
"text": "def on_weekend?\n WEEKEND_DAYS.include?(wday)\n end",
"title": ""
},
{
"docid": "5fd03716250e257c45434a2943585408",
"score": "0.46214652",
"text": "def timekeeping\n if is_clocked_in == true\n option = ask('You are clocked in, would you like to clock out?(y/n)')\n if option == 'y'\n clock_out\n else\n puts 'You were not clocked out'\n end\n else\n divider\n scope_project\n divider\n scope_task\n clock_in\n end\n end",
"title": ""
},
{
"docid": "b3877e5fa67a047693d3b3aa118fd90a",
"score": "0.4614711",
"text": "def day_inside_calendar?(week, day)\n !(\n (week == 1 && day < starts_on) ||\n (current_day > Time.days_in_month(date.month, date.year)) ||\n (week == 5 && day > ends_on )\n )\n end",
"title": ""
},
{
"docid": "5f30aa66464161d3bb805e7a89435319",
"score": "0.46083978",
"text": "def open?(time = Time.current)\n # Figure out if the time is between the hours for the appropriate part of\n # the week\n hours = Location.weekday?(time) ? weekdays : weekends\n return false if hours.blank?\n\n # TODO: find a better way to do this that won't break when moving between\n # weekdays and weekends\n hours.any? do |time_range|\n logger.debug \"Checking to see if #{time} is between \" \\\n \"#{time_range.begin} and #{time_range.end}.\"\n start_time = time.midnight + time_range.begin\n end_time = time.midnight + time_range.end\n IceCube::Schedule.new(start_time, end_time: end_time).occurs_at? time\n end\n end",
"title": ""
},
{
"docid": "a9405c2c141e864ce027d5b04919fa6b",
"score": "0.45989057",
"text": "def in_days; end",
"title": ""
},
{
"docid": "a9405c2c141e864ce027d5b04919fa6b",
"score": "0.45989057",
"text": "def in_days; end",
"title": ""
},
{
"docid": "392bf84aa3e7ae5b8fee84f88020f36d",
"score": "0.45921105",
"text": "def suspend\n appointment = @ubs.appointments.scheduled.not_checked_in.find(params[:id])\n appointment.update!(active: false, suspend_reason: params[:appointment][:suspend_reason])\n\n redirect_to operator_appointments_path,\n flash: {\n notice: \"Agendamento suspenso para #{appointment.patient.name}\"\n }\n end",
"title": ""
},
{
"docid": "a7f7701cdce004fa21a3a4aa9f16e653",
"score": "0.45885417",
"text": "def weekday?\n ItsBusinessTime.configuration.work_week.include?(tz_adjusted.wday)\n end",
"title": ""
},
{
"docid": "397e3f543461f3c175234efcc47f0a50",
"score": "0.45831266",
"text": "def is_saturday?\n Time.now.saturday?\nend",
"title": ""
},
{
"docid": "4d7432a525bb06333bceaa4baa007243",
"score": "0.45825788",
"text": "def asleep?\n return @status == GameData::States::ASLEEP\n end",
"title": ""
},
{
"docid": "2365fa49221bf55bdeb5140cb0ea3088",
"score": "0.4578398",
"text": "def check_in\n if self.status != 'available'\n self.status = 'available'\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "15385ee49ddf83fd3e217f97b98e7944",
"score": "0.45781475",
"text": "def should_alarm?\n now = Time.now\n days.include?(WEEKDAYS[now.wday]) && now.localtime.min == time.localtime.min && now.localtime.hour == time.localtime.hour && enabled\n end",
"title": ""
},
{
"docid": "78fc8a4363a6050c30268a5d398d8ee9",
"score": "0.457741",
"text": "def wake\n if @awake\n\n else\n @awake = true\n puts \"You gently wake #{@name}\"\n end\n end",
"title": ""
},
{
"docid": "3f203219ebc7bee440d5df8539c3ae1b",
"score": "0.45759478",
"text": "def is_today_weekend?\n Date.today.saturday? || Date.today.sunday?\n end",
"title": ""
},
{
"docid": "7851ee93341db6196e8c6faad9783036",
"score": "0.4572939",
"text": "def wednesday?\n wday == 3\n end",
"title": ""
},
{
"docid": "57c66fd91e400b6e837924fc7735ca85",
"score": "0.4572227",
"text": "def sunday?\n wday == 0\n end",
"title": ""
},
{
"docid": "9111643367d1f5bf9c8264a52ffecf2e",
"score": "0.4562746",
"text": "def scheduled?\n state == \"scheduled\"\n end",
"title": ""
},
{
"docid": "9bc31b73000a4e6fcd82f73b46ba067a",
"score": "0.4561931",
"text": "def checkWeekClosed\n w = Week.where(weeknum: session[:currentWeek]).first\n logger.debug DateTime.now\n if DateTime.now <= w.starttime\n logger.debug \"The week is open\"\n return false\n else \n logger.debug \"The week is locked\"\n return true\n end\n end",
"title": ""
},
{
"docid": "f62f6895e0d1232c064ca459c9f70c6b",
"score": "0.45611393",
"text": "def date_in(date_obj)\n return @driver.date_in(date_obj) if @driver.respond_to?(:date_in)\n Datet.in(date_obj)\n end",
"title": ""
},
{
"docid": "ae2a50ecec50713235a5d390623dfe9b",
"score": "0.45595214",
"text": "def in(t,*args)\n at(time.now+t,*args)\n end",
"title": ""
},
{
"docid": "cf0bd903ce83850c843e45f032d1d125",
"score": "0.45553666",
"text": "def flag_for_pickup \n self.one_week_schedule = 0 #Start clean\n 0.upto(7) do |idx|\n if (start_dt_tm.to_date <= Time.zone.now.to_date + idx) && (end_dt_tm.to_date >= Time.zone.now.to_date + idx)\n if Schedulehelper.IsEntryDueOn(self, Time.zone.now.to_date + idx)\n self.one_week_schedule |= (1 << idx) \n end\n end\n end\n end",
"title": ""
},
{
"docid": "1db882dab2b03f1f83765c19c53545d7",
"score": "0.45508566",
"text": "def is_user_on_holiday?(usr, at=Time.now)\n get_attendees(\"staff_holiday\").include?(usr)\n end",
"title": ""
},
{
"docid": "e795001a68a9a0cbf8045334082df7fb",
"score": "0.4548864",
"text": "def test_scheduler_5\n\n scheduler = Rufus::Scheduler.new\n scheduler.start\n\n touched = false\n\n scheduler.schedule_in \"100\" do\n touched = true\n end\n\n assert touched\n\n scheduler.sstop\n end",
"title": ""
}
] |
32122ccdf285ad6761e58f203b725740
|
PATCH/PUT /forums/1 PATCH/PUT /forums/1.json
|
[
{
"docid": "c4ce68167bc34bdd059a61bc9ab0efd3",
"score": "0.68533546",
"text": "def update\r\n @forum = Forum.find(params[:id])\r\n respond_to do |format|\r\n if @forum.update(forum_params)\r\n\r\n format.json { render :show, status: :ok, location: @forum }\r\n else\r\n\r\n format.json { render json: @forum.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
}
] |
[
{
"docid": "92cdb4c8c91d107fafe2a220eeb86220",
"score": "0.6840303",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: I18n.t(\"forums.updated_success\") }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c1a9c539f157f925c4b261eb66dd63d",
"score": "0.6823006",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, :notice => 'Forum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d3bfe0d118ff62e5fe6c515a5ce54a1",
"score": "0.68083274",
"text": "def update\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ded4cad25df00c3268227dc69f324bc8",
"score": "0.68044823",
"text": "def update\n\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bc4e7b3719124f1f49b49f64f04d2",
"score": "0.67776036",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bc4e7b3719124f1f49b49f64f04d2",
"score": "0.67776036",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bc4e7b3719124f1f49b49f64f04d2",
"score": "0.67776036",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bc4e7b3719124f1f49b49f64f04d2",
"score": "0.67776036",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1ebba388c3d62577412e25e5c4b26e6",
"score": "0.67523736",
"text": "def update\n @forums_forum = Forums::Forum.find(params[:id])\n\n respond_to do |format|\n if @forums_forum.update_attributes(params[:forums_forum])\n format.html { redirect_to(@forums_forum, :notice => 'Forum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forums_forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bfd66fb4462ca0653c6e2d5094cd5ab",
"score": "0.6695662",
"text": "def update\n @forum = Forum.find(params[:forum_id])\n @topic = @forum.topics.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to [@forum, @topic], notice: 'Topic was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66081e258f76a561edb581928c873fde",
"score": "0.66776204",
"text": "def update\n @title = t('view.forums.edit_title')\n\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to [@owner, @forum], notice: t('view.forums.correctly_updated') }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n rescue ActiveRecord::StaleObjectError\n redirect_to edit_polymorphic_url([@owner, @forum]), alert: t('view.forums.stale_object_error')\n end",
"title": ""
},
{
"docid": "227dcbe1aba8a5a9105e677709729907",
"score": "0.6669232",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227dcbe1aba8a5a9105e677709729907",
"score": "0.6669232",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227dcbe1aba8a5a9105e677709729907",
"score": "0.6669232",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227dcbe1aba8a5a9105e677709729907",
"score": "0.6669232",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227dcbe1aba8a5a9105e677709729907",
"score": "0.6669232",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2cc57c1add910c6dd4f60bce5f68bd95",
"score": "0.6661464",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html do\n redirect_to @forum, notice: 'Forum was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json do\n render json: @forum.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8e0a6f8d3a0c4f6ed195734a89869f02",
"score": "0.66233337",
"text": "def update\n @thread_forum = ThreadForum.find(params[:id])\n\n respond_to do |format|\n if @thread_forum.update_attributes(params[:thread_forum])\n format.html { redirect_to @thread_forum, notice: 'Thread forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thread_forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fd62344297eb0130c8e5599ad601b6a",
"score": "0.66122866",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: \"Forum was successfully updated.\" }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dfab60d3ff5031749f97e7c73878727",
"score": "0.65708417",
"text": "def update\n @forums_topic = Forums::Topic.find(params[:id])\n\n respond_to do |format|\n if @forums_topic.update_attributes(params[:forums_topic])\n format.html { redirect_to(@forums_topic, :notice => 'Topic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forums_topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad529feb472d3a2f45ef2df0228f70a0",
"score": "0.65651894",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3121e456280c5425509065d1d0b6549e",
"score": "0.6562218",
"text": "def update\n @forums_post = Forums::Post.find(params[:id])\n\n respond_to do |format|\n if @forums_post.update_attributes(params[:forums_post])\n format.html { redirect_to(\"/forums/topics/#{@forums_post.topic_id}\", :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forums_post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "446bd8e7b0dae02cab253156917d2cae",
"score": "0.6506227",
"text": "def update\n authorize! :update, @forum\n\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to [@group, @forum], notice: 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf439d4b0223d64b004a0f0bd9956e64",
"score": "0.64973915",
"text": "def update\n if can? :update, @forum_thread\n respond_to do |format|\n if @forum_thread.update(forum_thread_params)\n format.html { redirect_to @forum_thread, notice: 'Forum thread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum_thread.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to :root\n end\n end",
"title": ""
},
{
"docid": "8e54692ef3b8cf80dbb7f202d3a01edb",
"score": "0.6430419",
"text": "def update\n authorize! :update, @forum_topic\n\n respond_to do |format|\n if @forum_topic.update(forum_topic_params)\n format.html { redirect_to @forum_topic, notice: 'Forum topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum_topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "197d6957518dcd8427a53bc1d8371081",
"score": "0.64134276",
"text": "def update\n\t\t@forum = Forum.find(params[:forum_id])\n\t\t@topic = @forum.topics.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @topic.update_attributes(params[:topic])\n\t\t\t\tformat.html { redirect_to forum_url(@forum), notice: 'Το θέμα άλλαξε με επιτυχία' }\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: @topic.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ad01e01190348374288c1953a2f775ef",
"score": "0.6412815",
"text": "def update\n @title=\"Forums\"\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to(@forum, :notice => 'Forum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60fb77faa9684c33b99105777894238e",
"score": "0.6379032",
"text": "def update\n respond_to do |format|\n if @forum_post.update(update_params)\n format.html { redirect_to @forum_post, notice: 'Forum post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @forum_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d359137181fd904ba1c2b5676466925",
"score": "0.63454914",
"text": "def update\n respond_to do |format|\n if @watch_forum.update(watch_forum_params)\n format.html { redirect_to @watch_forum, notice: 'Watch forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @watch_forum }\n else\n format.html { render :edit }\n format.json { render json: @watch_forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98e0dcceceb221fc2877e383a104521f",
"score": "0.63318527",
"text": "def update\n respond_to do |format|\n if @forum.update(forum_params)\n format.html { redirect_to @forum, notice: 'Fórum atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit, @current_usuario => current_usuario }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87af80e7634848cb978f46bfcbc3dceb",
"score": "0.6330215",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to(@forum, :notice => 'Forum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87af80e7634848cb978f46bfcbc3dceb",
"score": "0.6330215",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to(@forum, :notice => 'Forum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87af80e7634848cb978f46bfcbc3dceb",
"score": "0.6330215",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n format.html { redirect_to(@forum, :notice => 'Forum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "941259aa9573d16faa5e5b6836436e5d",
"score": "0.63263077",
"text": "def update\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n flash[:notice] = \"Forum #{@forum.name} was successfully updated.\"\n format.html { redirect_to(@forum) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e9ea1d7247e2b59308e470e3592f052",
"score": "0.63255167",
"text": "def update\n @forum_thread = ForumThread.find(params[:id])\n @forum_threads = @forum_thread.subtree\n\n respond_to do |format|\n if @forum_thread.update_attributes(params[:forum_thread])\n format.html { redirect_to forum_threads_path(:id => @forum_thread.root.id, :parent_id => @forum_thread.root.id), notice: 'Forum thread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum_thread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d55c74ece1e8776e48129c7fa0079f4c",
"score": "0.63229924",
"text": "def update\n @forum = Forum.find_by_permalink(params[:forum_id])\n @topic = Topic.find_by_permalink(params[:topic_id])\n @post = @topic.posts.find(params[:id])\n\n @topic.latest_post_id = @post.id\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to forum_topic_path(@forum, @topic, :anchor => @post.id), notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57455db9e3a679d260f8cd68b82363e6",
"score": "0.62683094",
"text": "def update\n @admin_forum = Forum.find(params[:id])\n \n respond_to do |format|\n if @admin_forum.update_attributes(params[:forum])\n format.html { redirect_to :action => 'index', :notice => 'Forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render :json => @admin_forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62cc7e0429814c496dfc4152e0f2be61",
"score": "0.62577975",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update_attributes(params[:forum])\n flash[:notice] = 'Forum was successfully updated.'\n format.html { redirect_to(@forum) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20a9c6ab1b0e87a55fc2129e4e6d4a8f",
"score": "0.62497455",
"text": "def update\n respond_to do |format|\n if @forum_discussion.update(forum_discussion_params)\n format.html { redirect_to @forum_discussion, notice: 'Forum discussion was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum_discussion }\n else\n format.html { render :edit }\n format.json { render json: @forum_discussion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1140e26475a84144bfbf032c45f7ca88",
"score": "0.62403536",
"text": "def update\n respond_to do |format|\n if @mdl_forum.update(mdl_forum_params)\n format.html { redirect_to @mdl_forum, notice: 'Mdl forum was successfully updated.' }\n format.json { render :show, status: :ok, location: @mdl_forum }\n else\n format.html { render :edit }\n format.json { render json: @mdl_forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "611999ec9d4d1b804366afb5b95e605c",
"score": "0.62005144",
"text": "def update\n json_update(topic,topic_params, Topic)\n end",
"title": ""
},
{
"docid": "4d60d38da6be5564769a0e35f02f1942",
"score": "0.61761653",
"text": "def update\n @topic = Topic.find(params[:id])\n params[:topic][:forum_id] = @forum.id\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to(forum_topic_path(@forum, @topic), :notice => 'Topic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93ddf3ec56720b2c8fcbe35fab34162e",
"score": "0.6167299",
"text": "def update\n @forum = Forum.find_by_permalink(params[:forum_id])\n @topic = Topic.find_by_permalink(params[:id])\n @post = @topic.posts.order(\"id asc\").first\n\n @topic.permalink = create_permalink(params[:topic][:title]) if params[:update_permalink]\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic]) && @post.update_attributes(params[:post])\n @post.title = @topic.title\n @post.save\n format.html { redirect_to forum_topic_path(@forum, @topic), notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fa9440a9b6be43dae55602e40d43f20",
"score": "0.616649",
"text": "def update\n @forum = Forum.find(params[:id])\n if @forum.update_attributes(params[:forum])\n redirect_to root, notice: 'Post was updated successfully.'\n else\n render 'edit', notice: 'Update failed!'\n end\n end",
"title": ""
},
{
"docid": "caa28649591b03aae575884e9cb20046",
"score": "0.6150904",
"text": "def update\n respond_to do |format|\n if @topic.update(topic_params)\n format.html { redirect_to forum_topic_path(@forum, @topic), notice: 'Topic was successfully updated.' }\n format.json { render :show, status: :ok, location: @topic }\n else\n format.html { render :edit }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "488dddce2982772fb9c11b20aee6fd80",
"score": "0.6148968",
"text": "def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n \n \n # adds a create event to the board feed\n feed = Feed.new\n \n feed.message = \"Updated\" + @feature.title\n feed.feature_id = @feature.id\n feed.user_id = current_user.id\n feed.doc_id = @feature.parent_doc_list[0]\n feed.feedtype = \"Feature update\" \n feed.save\n \n \n # email notificaiton\n doc = Doc.find(@feature.parent_doc_list[0])\n @followers = doc.followers\n\n @followers.each do |f|\n user = current_user\n send_to_user = f\n # Tell the UserMailer to send a welcome Email after save\n #UserMailer.comment_email(user, doc, feature, comment).deliver\n UserMailer.section_email(user, doc, @feature, send_to_user).deliver\n end\n \n format.html { redirect_to @feature, notice: 'Story was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b6071e979ea8983a7a895c30d5b14da",
"score": "0.61457986",
"text": "def update\n @forum = @topic.forum\n @reply = @topic.replies.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n flash[:notice] = 'Reply was successfully updated.'\n format.html { redirect_to(@topic) }\n # format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n #format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d43fa58a85b0287afd28f4d19cfcf0ce",
"score": "0.6145487",
"text": "def update\n respond_to do |format|\n if @forum_post.update(forum_post_params)\n format.html { redirect_to @forum_post, notice: 'Forum post was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum_post }\n else\n format.html { render :edit }\n format.json { render json: @forum_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85fa1d6ec51404059d1ae5fff5e2b3d7",
"score": "0.6141887",
"text": "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to forum_topic_posts_path(params[:forum_id], params[:topic_id]), notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cdb58774c6b22f0f731f1e826efcca5",
"score": "0.6136634",
"text": "def update\n @forum_section = ForumSection.find(params[:id])\n\n respond_to do |format|\n if @forum_section.update_attributes(params[:forum_section])\n format.html { redirect_to @forum_section, :notice => 'Forum section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @forum_section.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c9ccad50040c4ee0f85788759c888b7",
"score": "0.6125322",
"text": "def update\n\t\t@forum = Forum.find(params[:id])\n\t\[email protected]_accessor(current_user)\n\t\trespond_to do |format|\n\t\t\tif @forum.update_attributes(params[:forum])\n\t\t\t\tflash[:notice] = t(:ctrl_object_updated, :typeobj => t(:ctrl_forum), :ident => @forum.ident)\n\t\t\t\tformat.html { redirect_to(@forum) }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_updated,:typeobj =>t(:ctrl_forum),:ident=>@forum.ident)\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "161351a527f06a9e70b573f9732716e7",
"score": "0.61200285",
"text": "def update\n @forum_forum = ForumForum.find(params[:id])\n\n respond_to do |format|\n if @forum_forum.update_attributes(params[:forum_forum])\n flash[:notice] = 'ForumForum was successfully updated.'\n format.html { redirect_to(@forum_forum) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum_forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40811c2a232a5b64fadd2d9c4a73aa80",
"score": "0.61190873",
"text": "def update\n if @forum.update_attributes(forum_params)\n redirect_to forum_path(@forum)\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "ee0ff6564f8dfb19548c13d28dc9ca3c",
"score": "0.61145145",
"text": "def update\n @subforum = Subforum.find(params[:id])\n\n respond_to do |format|\n if @subforum.update_attributes(params[:subforum])\n format.html { redirect_to(@subforum, :notice => 'Subforum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subforum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8bc847208950823ae36a7731e2e00a5",
"score": "0.6094769",
"text": "def update\n @company_forum = CompanyForum.find(params[:id])\n\n respond_to do |format|\n if @company_forum.update_attributes(company_forum_params)\n format.html { redirect_to @company_forum, notice: 'Company forum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company_forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "259e106a50d65bc47aa599f312f8ccbf",
"score": "0.6078428",
"text": "def update\n @forum = Forum.find(params[:id])\n\n respond_to do |format|\n if @forum.update(forum_params)\n flash[:notice] = 'Forum was successfully updated.'\n format.html { redirect_to admin_communities_path }\n format.xml { head :ok }\n else\n format.html { render :edit }\n format.xml { render :xml => @forum.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "50a24311310f43fcec6b70e11cf211ff",
"score": "0.6071373",
"text": "def update\n\t\t@topic = Topic.find(params[:id])\n\t\[email protected]_id = params[:topic][:forum_id]\n\n\t\trespond_to do |format|\n\t\t\tif @topic.update_attributes(params[:topic])\n\t\t\t\tformat.html { redirect_to admin_topic_path(@topic), notice: 'Το θέμα άλλαξε με επιτυχία' }\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: @topic.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "86b620ea14152d4a461be7a1e52a47c7",
"score": "0.6063302",
"text": "def update\n @forum.attributes = params[:forum]\n\n respond_to do |format|\n if @commit_type == 'preview' && @forum.valid?\n format.html do\n find_forum_topics\n render :template => 'admin/shared/update_preview', :locals => { :record => @forum }, :layout => 'admin/admin_preview'\n end\n format.xml { render :xml => @forum, :status => :created, :location => @forum }\n elsif @commit_type == 'save' && @forum.save(:user => current_user)\n format.html { render 'admin/shared/update' }\n format.xml { head :ok }\n else\n format.html { render :action => :edit, :status => :unprocessable_entity }\n format.xml { render :xml => @forum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36a9ffc6cf8326c7863c1f9a001915b6",
"score": "0.6044821",
"text": "def update(thread_id, url)\n data = {\n :forum_api_key => FORUM_KEY,\n :thread_id => thread_id,\n :url => url\n }\n\n puts \"Updating thread #{thread_id} with URL = #{url}\"\n response = JSON.parse( DISQUS['update_thread'].post(data) )\nend",
"title": ""
},
{
"docid": "36a9ffc6cf8326c7863c1f9a001915b6",
"score": "0.6044821",
"text": "def update(thread_id, url)\n data = {\n :forum_api_key => FORUM_KEY,\n :thread_id => thread_id,\n :url => url\n }\n\n puts \"Updating thread #{thread_id} with URL = #{url}\"\n response = JSON.parse( DISQUS['update_thread'].post(data) )\nend",
"title": ""
},
{
"docid": "f9b150f59faa5feb8b91e9a4a1294234",
"score": "0.60395074",
"text": "def update\n @post = Post.find(params[:post][:id])\n respond_to do |format|\n if @topic.update(topic_params) && @post.update(post_params)\n format.html { redirect_to forum_topic_path(@topic.forum_id, @topic), notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "389a0746a929f8e1b381e2d3e726c1f2",
"score": "0.60273236",
"text": "def update\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: t(\"topics.topic_updated\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ddb461634b5d1f9c41a5e7f24751620",
"score": "0.602182",
"text": "def update\n respond_to do |format|\n if @forum_post.update_attributes(params[:forum_post])\n\n format.html { redirect_to [ @forum_thread.forum_topic, @forum_thread ] }\n format.xml { head :ok }\n else\n format.html { render :action => :edit }\n format.xml { render :xml => @forum_post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e18af52871b2687d7b96763d84066080",
"score": "0.60077924",
"text": "def update\n respond_to do |format|\n if @f_thread.update(f_thread_params)\n format.html { redirect_to @f_thread, notice: 'F thread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @f_thread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04c751b5584949d77ebd92798a86da0f",
"score": "0.60076535",
"text": "def update\n@topic = Topic.find(params[:id])\nrespond_to do |format|\nif @topic.update_attributes(params[:topic])\nflash[:notice] = 'Topic was successfully updated.'\nformat.html { redirect_to posts_path(:topic_id => @topic,\n:forum_id => @topic.forum) }\nformat.xml { head :ok }\nelse\nformat.html { render :action => \"edit\" }\nformat.xml { render :xml => @topic.errors.to_xml }\nend\nend\nend",
"title": ""
},
{
"docid": "2c3a02df077ffc4fa9e47f6c531b90ba",
"score": "0.59858733",
"text": "def update\n if @topic.update(params[:topic])\n head :no_content\n else\n render json: @topic.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e95f98cf05664c2667475816b571c549",
"score": "0.59848994",
"text": "def update\n @forums_category = Forums::Category.find(params[:id])\n\n respond_to do |format|\n if @forums_category.update_attributes(params[:forums_category])\n format.html { redirect_to(@forums_category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forums_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "254dc0a1247eb972dc4b25079b2de032",
"score": "0.5977928",
"text": "def update\n @topic = Topic.find(params[:id])\n\n if @topic.update(params[:topic])\n head :no_content\n else\n render json: @topic.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9009f3ad5e1aa274ba608f776fc3af10",
"score": "0.5973798",
"text": "def update\n respond_to do |format|\n if @forum.update(category_params)\n format.html { redirect_to [:admin, @forum], notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum }\n else\n format.html { render :edit }\n format.json { render json: @forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96354e64c0733105bdac1cf1d85b16e3",
"score": "0.59678686",
"text": "def update\n respond_to do |format|\n if @discussion_thread.update(discussion_thread_update_params)\n format.html { redirect_to discussion_thread_url(@discussion_thread),\n notice: 'Discussion thread was successfully updated.' }\n format.json { render :show, status: :ok, location: @discussion_thread }\n else\n format.html { render :edit }\n format.json { render json: @discussion_thread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2f33f6cbbc53cc2c2809aa0c6e8d5c4",
"score": "0.5962614",
"text": "def update\n @forum_question = ForumQuestion.find(params[:id])\n\n respond_to do |format|\n if @forum_question.update_attributes(params[:forum_question])\n format.html { redirect_to @forum_question, notice: 'Forum question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "655a43ef1e00cfb5f6c7513aeb0e195d",
"score": "0.59566104",
"text": "def update\n respond_to do |format|\n if @forum_category.update(forum_category_params)\n format.html { redirect_to @forum_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: @forum_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "587543d0f0a8c0d6c0249c3ebaaa4b62",
"score": "0.59422636",
"text": "def update\n @forum_link = ForumLink.find(params[:id])\n\n respond_to do |format|\n if @forum_link.update_attributes(params[:forum_link])\n format.html { redirect_to @forum_link, notice: 'Forum link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forum_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40f48df9067301dac0640bfe5cf736be",
"score": "0.5940259",
"text": "def update\n respond_to do |format|\n if @fellow_topic.update(fellow_topic_params)\n format.html { redirect_to @fellow_topic, notice: 'Fellow topic was successfully updated.' }\n format.json { render :show, status: :ok, location: @fellow_topic }\n else\n format.html { render :edit }\n format.json { render json: @fellow_topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03bf8bf0deeb62cf66d414ca6951dc83",
"score": "0.59400433",
"text": "def update\n respond_to do |format|\n if @mdl_forum_post.update(mdl_forum_post_params)\n format.html { redirect_to @mdl_forum_post, notice: 'Mdl forum post was successfully updated.' }\n format.json { render :show, status: :ok, location: @mdl_forum_post }\n else\n format.html { render :edit }\n format.json { render json: @mdl_forum_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1da9e43943f1236025c3d85b98f7247f",
"score": "0.5936156",
"text": "def update\n \n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5409c05017a5a13e61164180003ab274",
"score": "0.592533",
"text": "def update\n @topic = Topic.find(params[:id])\n pt = params[:topic]\n @topic.topic_node_id = pt[:topic_node_id]\n @topic.title = pt[:title]\n @topic.body = pt[:body]\n @topic.director_list = pt[:directors]\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: t(\"topics.update_topic_success\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61ed59f8989b7670ccf81fc5b5fbe3d7",
"score": "0.59230435",
"text": "def update\n @forum_topic = ForumTopic.find(params[:id])\n\n respond_to do |format|\n if @forum_topic.update_attributes(params[:forum_topic])\n flash[:notice] = 'ForumTopic was successfully updated.'\n format.html { redirect_to(@forum_topic) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum_topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61ed59f8989b7670ccf81fc5b5fbe3d7",
"score": "0.59230435",
"text": "def update\n @forum_topic = ForumTopic.find(params[:id])\n\n respond_to do |format|\n if @forum_topic.update_attributes(params[:forum_topic])\n flash[:notice] = 'ForumTopic was successfully updated.'\n format.html { redirect_to(@forum_topic) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forum_topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9a3eab0417a76e6ec0794f5f63b3e0",
"score": "0.59182173",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { render text: \"ok\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: false, status: :unprocessable_entity }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be29eb95e237d35d1a9fa7be699c7f08",
"score": "0.5914102",
"text": "def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to @feature, flash: { success: '专题更新成功。' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f003f440c328f9be96eb91fa9ef263f7",
"score": "0.5904899",
"text": "def update\n respond_to do |format|\n if @students_forum.update(students_forum_params) # 修改论坛话题内容\n format.html { redirect_to @students_forum, notice: 'Students forum was successfully updated.' } # 成功,跳转到论坛话题列表页面,\n # format.json { render :show, status: :ok, location: @students_forum }\n else\n format.html { render :edit } # 失败,跳转到修改论坛话题内容页面,\n # format.json { render json: @students_forum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f365873a24b4f2b187db2f2e8b191f4",
"score": "0.5896544",
"text": "def update\n if @topic.update_attributes(params[:topic])\n head :no_content\n else\n render json: @topic.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "78fee6f29228a593bee685415af58d0d",
"score": "0.58959776",
"text": "def update\n respond_to do |format|\n if @forum_category.update(forum_category_params)\n format.html { redirect_to @forum_category, notice: 'Forum category was successfully updated.' }\n format.json { render :show, status: :ok, location: @forum_category }\n else\n format.html { render :edit }\n format.json { render json: @forum_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfb14f20be9f310d10c299fe0c7887da",
"score": "0.5890217",
"text": "def update_thread(conversation_id:, thread_id:, op:, path:, value:)\n body = {}\n body[:op] = op\n body[:path] = path\n body[:value] = value\n\n patch(\"conversations/#{conversation_id}/threads/#{thread_id}\", body: body.to_json)\n\n last_response.code == HTTP_NO_CONTENT\n end",
"title": ""
},
{
"docid": "9084612efcbe4489fb6776541a7e80c9",
"score": "0.58894295",
"text": "def update\n @discussion = Discussion.find(params[:id])\n\n if @discussion.update(discussion_params)\n head :no_content\n else\n render json: @discussion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3d02d90eba02b4181959ea6b2b5268a5",
"score": "0.58885115",
"text": "def update\n # @topic = Topic.find(params[:id])\n # authorize! :manage, @topics\n\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1914c1d4bb5bf789db42989ae64adb7a",
"score": "0.5884953",
"text": "def update\n# @category = Category.friendly.find(params[:category_id])\n# @board = set_board\n# @topic = @board.topics.find(params[:id])\n# @Topic.user_id = current_user.id\n# @topic.category_id = @category.id\n# @topic.board_id = @board.id\n\n respond_to do |format|\n if @topic.update_attributes(topic_params)\n format.html { redirect_to [@category, @board, @topic], notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7b61fc7492f0700a051168d758ce5ff",
"score": "0.5827675",
"text": "def update\n @forum_topic.attributes = params[:forum_topic]\n\n respond_to do |format|\n if @commit_type == 'preview' && @forum_topic.valid?\n format.html do\n find_forum_threads\n render :template => 'admin/shared/update_preview', :locals => { :record => @forum_topic }, :layout => 'admin/admin_preview'\n end\n format.xml { render :xml => @forum_topic, :status => :created, :location => @forum_topic }\n elsif @commit_type == 'save' && @forum_topic.save(:user => current_user)\n format.html { render 'admin/shared/update' }\n format.xml { head :ok }\n else\n format.html { render :template => 'admin/shared/edit', :locals => { :record => @forum_topic }, :status => :unprocessable_entity }\n format.xml { render :xml => @forum_topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f89ca62734b51be3e3d426c1be69103",
"score": "0.58202124",
"text": "def update\n @message_thread = MessageThread.find(params[:id])\n\n respond_to do |format|\n if @message_thread.update_attributes(params[:message_thread])\n format.html { redirect_to @message_thread, notice: 'Message thread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message_thread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed246d62f8132ad2487c29866eb4fdb",
"score": "0.5814318",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n flash[:notice] = 'Topic was successfully updated.'\n format.html { redirect_to posts_path(:topic_id => @topic, \n :forum_id => @topic.forum) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topic.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "8fbb7b9c13613b35b33d511af93ba4da",
"score": "0.58107316",
"text": "def update\n @message_thread = @community.message_threads.find(params[:id])\n\n # If coming from show page, we pass the user token\n if params[:user] and params[:user][:token].present?\n @user = User.where(token: params[:user][:token]).first\n else\n @user = current_user\n end\n thread = @message_thread.reply!(@user, reply_parameters[:message]) if @user and reply_parameters[:message].present?\n respond_to do |format|\n format.html { redirect_to structure_path(@structure, anchor: \"thread-#{@message_thread.id}\"), notice: 'Merci pour votre réponse !' }\n format.json { render json: Community::MessageThreadsSerializer.new(@message_thread) }\n end\n end",
"title": ""
},
{
"docid": "4769cff956e067d2ff50e82b41ddae1f",
"score": "0.58062196",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n flash[:notice] = '主题编辑成功'\n format.html { redirect_to forum_topic_posts_path(:topic_id => @topic,\n :forum_id => @topic.forum) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12488e1c6e4f023e25e754cee5c5731",
"score": "0.5801417",
"text": "def update\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
a90953de25b432e424f64119db4c097e
|
Called from current_user. Now, attempt to login by basic authentication information.
|
[
{
"docid": "b9f97e3fcbc4f9acf6e544245c01b6b2",
"score": "0.79081744",
"text": "def login_from_basic_auth?\n username, passwd = get_auth_data\n if username && passwd\n set_session_user User.authenticate(username, passwd)\n end\n end",
"title": ""
}
] |
[
{
"docid": "eec7247d5f949c01aa0a492e245d1333",
"score": "0.85675675",
"text": "def login_from_basic_auth\n username, passwd = get_auth_data\n self.current_user = User.authenticate(username, passwd) if username && passwd\n end",
"title": ""
},
{
"docid": "734f79e3e2ce85c229534c6234e22a23",
"score": "0.85094064",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n @current_user = (user_class.authenticate(username, password) if session[:http_authentication_used]) || false\n auto_login(@current_user) if @current_user\n @current_user\n end\n end",
"title": ""
},
{
"docid": "05491848f07c23e8bee08cf6af280f1c",
"score": "0.84302646",
"text": "def login_from_basic_auth\n\t\t#username, passwd = get_auth_data\n\t\t#self.current_user = User.authenticate(username, passwd) if username && passwd\n\t\tauthenticate_with_http_basic do |username, password|\n\t\t\tself.current_user = User.authenticate(username, password)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "437bf29f3832d315d7ec9f62e420d2b7",
"score": "0.8350626",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_user = User.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "325ad76da9f853de3d93ed3eb97c3034",
"score": "0.83337253",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n self.current_user = User.authenticate(login, password)\n end\n end",
"title": ""
},
{
"docid": "50fea6c33d9da67f21da86407cb92bba",
"score": "0.8284306",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_user = Account.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "149ea3fbbce146744335a47b1099b1b6",
"score": "0.8282685",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_user = User.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "322a3a39f5a57447882802af3912d03b",
"score": "0.82772636",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n self.current_user = User.authenticate(login, password)\n end\n end",
"title": ""
},
{
"docid": "03e7a227113362bd9b1aa8d6a8cbb773",
"score": "0.8171411",
"text": "def login_from_basic_auth\n accountname, passwd = get_auth_data\n self.current_account = SecureMagic::Account.authenticate(accountname, passwd) if accountname && passwd\n end",
"title": ""
},
{
"docid": "5a860c5e9dba78e85eda51f90e13c4a6",
"score": "0.81697434",
"text": "def login_from_basic_auth\n username, passwd = get_auth_data\n #added work around for sanity sake check this out\n if username && passwd\n local_user = LocalUser.authenticate(username, passwd)\n return nil if local_user.nil?\n self.current_account = Account.find_by_id(local_user.account_id)\n end\n end",
"title": ""
},
{
"docid": "fa6a7767bb10b355171bebcdac1726e5",
"score": "0.8076733",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_account = Account.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "4e0dab219a2023c95b783d764839ee80",
"score": "0.8062711",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n if username == \"anonymous\" && password == \"\"\n @current_user = false\n return true\n else\n if username == \"test\" && password == \"test\"\n @current_user = \"TestUser\"\n return true\n else\n return false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "09b1f588427ecc0f9fad940cefe1dde9",
"score": "0.8006919",
"text": "def login_from_basic_auth\n if (defined? ::User) == 'constant'\n authenticate_with_http_basic do |login, password|\n self.current_user = ::User.authenticate(login, password)\n end\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "ad63e5828ceab0b4d6d00422978d08cb",
"score": "0.7940432",
"text": "def login_from_basic_auth\n user_modelname, passwd = get_auth_data\n self.current_user_model = UserModel.authenticate(user_modelname, passwd) if user_modelname && passwd\n end",
"title": ""
},
{
"docid": "996408f6dd6237fca78ad0760b4b0e87",
"score": "0.7924433",
"text": "def login_from_basic_auth?\n username, passwd = get_auth_data\n if username && passwd\n set_session_user User.authenticate(username, passwd)\n end\n end",
"title": ""
},
{
"docid": "20c015b412edd818dd719a20f923b577",
"score": "0.785556",
"text": "def login_from_basic_auth?\n username, passwd = get_auth_data\n if username && passwd\n set_session_user ::User.authenticate(username, passwd)\n end\n end",
"title": ""
},
{
"docid": "bee9608b4df929e5d6641787e99cf567",
"score": "0.7709075",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n u = User.authenticate(login, password)\n last_ip = Logstasher.ip_from_request_env(request.env)\n if u && u.last_ip != last_ip\n u.update_attribute(:last_ip, last_ip)\n end\n self.current_user = u\n end\n end",
"title": ""
},
{
"docid": "29571fd35f286a582833591ff82b958b",
"score": "0.77021265",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n login_by_password! login, password\n end\n end",
"title": ""
},
{
"docid": "a7c8a793d80ed1cfd7491d5f46e5242b",
"score": "0.76764566",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_person = Person.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "2a5f689f9bc4518e81aec9afbb436444",
"score": "0.758941",
"text": "def login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_member = Member.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "0a552461bc3c3bd7f4197f96cb7139d3",
"score": "0.7589224",
"text": "def try_to_autologin_with_http_basic\n if http_authorization?\n authenticate_with_http_basic do |username, _password|\n logger.info \"Successful authentication for '#{username}'\" \\\n \"from #{request.remote_ip} at #{Time.now.utc}\"\n self.logged_user = User.find_by_login(username) ||\n create_http_authorization_user(username)\n end\n else\n try_to_autologin_without_http_basic\n end\n end",
"title": ""
},
{
"docid": "2bf9a43231e17d449a09d1b256121575",
"score": "0.7569598",
"text": "def log_in_before\n self.current_user = log_in_with_cookie || log_in_with_http_basic\n end",
"title": ""
},
{
"docid": "c8cfd2e43f189f8542a73e85c494275b",
"score": "0.74537694",
"text": "def login_from_basic_auth\n username, passwd = get_auth_data\n self.current_team = Team.authenticate(username, passwd) if username && passwd\n end",
"title": ""
},
{
"docid": "06989df16a12ae550849f194ca6bd97f",
"score": "0.74508315",
"text": "def authenticate_basic_auth\n\tauthenticate_or_request_with_http_basic do |username, password|\n\t @current_user = User.authenticate(username, password)\n\t @current_user\n\tend\n end",
"title": ""
},
{
"docid": "5a85a48f98e8b70f90635cbcde9f5656",
"score": "0.7447157",
"text": "def basic_auth_required\n user = super\n self.current_user = user if User === user\n end",
"title": ""
},
{
"docid": "f01cf8b036b7b077fdc6212dca99a5f3",
"score": "0.7401648",
"text": "def log_in_with_http_basic\n authenticate_with_http_basic do |email, passphrase|\n return User.authenticate(email, passphrase)\n end\n end",
"title": ""
},
{
"docid": "229c31c03d7ded7466b15f4768bc2349",
"score": "0.7346755",
"text": "def user_auth\n\t\tlogger.info \"Authenticating...\"\n\t\tauthenticate_or_request_with_http_basic do |username, password|\n\t\t\tuser = User.find_by_name(username)\n\t\t\treturn invalid_username unless user\n\t\t\tlogger.info \"Found user: #{user.name}\"\n\t\t\tuser.authenticate(password)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "afdc2ab2b43dd1891ccb6385e47a4790",
"score": "0.73209643",
"text": "def authenticate\n authenticate_or_request_with_http_basic do |email, password|\n Rails.logger.info \"API authentication: #{email} #{password}\"\n if !email.include? \"@\"\n email = email + \"@nilpeter.com\"\n end\n user = User.find_by_email(email)\n if user && user.authenticate(password)\n @current_user = user\n Rails.logger.info \"Logging in #{user.inspect}\"\n true\n else\n Rails.logger.warn \"No valid credentials\"\n render status: 401, json: {\n message: \"Failed to find user\"\n }.to_json\n true\n end\n end\n end",
"title": ""
},
{
"docid": "76a69205db058cbfa6c18d93548cb165",
"score": "0.7299035",
"text": "def radiant_authentication\n basic_auth_required {|username, password| session[:user] = User.authenticate(username,password) }\n end",
"title": ""
},
{
"docid": "1eb95787e6c000f14d11db13d9a67982",
"score": "0.7296707",
"text": "def login\n enterCredentials\n authenticate\n end",
"title": ""
},
{
"docid": "51bb313132d25aea4c302c772304dc48",
"score": "0.7237415",
"text": "def login_admin_from_basic_auth\n username, passwd = get_auth_data\n self.current_admin = Admin.authenticate(username, passwd) if username && passwd\n end",
"title": ""
},
{
"docid": "9808ae640d6b9e80ceb1db45322f96d4",
"score": "0.72194743",
"text": "def manage_login_from_basic_auth\n authenticate_with_http_basic do |username, password|\n self.current_manage = Manage.authenticate(username, password)\n end\n end",
"title": ""
},
{
"docid": "0e71578a0929d6534245240ad38b1f0b",
"score": "0.72060525",
"text": "def login_from_basic_auth_token\n if params[:token].present?\n logout_killing_session!\n token = params[:token].gsub(' ', '+')\n account = Core::User.find_by_auth_token(token)\n if account \n session[:user_id] = account.id \n @current_user = account \n end\n elsif session[:user_id]\n @current_user = Core::User.find(session[:user_id]) \n end \n end",
"title": ""
},
{
"docid": "e1404c54ac7f93abbc1c739f298ce8f2",
"score": "0.7144535",
"text": "def login_required\n return if authorized?\n unauthorized! unless auth.provided?\n bad_request! unless auth.basic?\n unauthorized! unless authorize(*auth.credentials)\n request.env[\"REMOTE_USER\"] = auth.username\n end",
"title": ""
},
{
"docid": "a2cc7d52790d72da36a6637ddc9a4e95",
"score": "0.7135772",
"text": "def authenticate_user!\n authenticate_or_request_with_http_basic(auth_realm) do |login,password|\n if login.present?\n @authenticated_user = BasicUser.new :login => login, :password => password\n else\n raise Console::AccessDenied\n end\n end\n end",
"title": ""
},
{
"docid": "24772ec92bd68487d4e191f07945a428",
"score": "0.7120771",
"text": "def before_basic_auth login, password\n user = nil\n if ApplicationController.basic_auth_is_authoritative \n if user = User[login]\n # Update password in User.\n unless user.authenticated?(password)\n user.password = password\n user.password_confirmation = password\n user.save!\n=begin\n $stderr.puts \"user.password = #{user.password.inspect}\"\n $stderr.puts \"user.crypted_password = #{user.crypted_password.inspect}\"\n=end\n end\n end\n\n if ApplicationController.basic_auth_use_auth_user_creator\n # Create a new user and/or update its roles.\n creator = Contenter::AutoUserCreator.new\n user = creator.create_user!(:user => user, :login => login, :password => password)\n end\n end\n\n user\n end",
"title": ""
},
{
"docid": "b23049e9ee6e14567fa363ea465ec320",
"score": "0.7080204",
"text": "def authenticate_user!\n authenticate_or_request_with_http_basic do |username, password|\n username == \"my_user\" && password == \"my_password\"\n end\n end",
"title": ""
},
{
"docid": "b380b1739cb695911116880a2c5b0a5c",
"score": "0.707973",
"text": "def basic_login(email, password)\n @request.env['HTTP_AUTHORIZATION'] =\n ActionController::HttpAuthentication::Basic.encode_credentials(email, password)\n end",
"title": ""
},
{
"docid": "af82157c434434684ca2a3a86998a823",
"score": "0.70668787",
"text": "def login\n prepareBaseContext\n end",
"title": ""
},
{
"docid": "f953a4069633b8392f2fa6f5acb701f7",
"score": "0.7026745",
"text": "def require_login_from_http_basic\n (request_http_basic_authentication(realm_name_by_controller) && (session[:http_authentication_used] = true) && return) if request.authorization.nil? || session[:http_authentication_used].nil?\n require_login\n session[:http_authentication_used] = nil unless logged_in?\n end",
"title": ""
},
{
"docid": "ab563c5af952204588ca540353536b98",
"score": "0.7018629",
"text": "def basic_authenticated?; end",
"title": ""
},
{
"docid": "20adadd191b66d2340e6762fc25d4a5e",
"score": "0.70169795",
"text": "def authenticate!\n @auth = Rack::Auth::Basic::Request.new(env)\n\n unless @auth.provided?\n halt 401 # unauthorized\n end\n\n unless @auth.basic?\n halt 400 # bad request\n end\n\n @account = Account.find_from_auth(@auth)\n session[:account] = @account\n\n if @account\n env['REMOTE_USER'] = @account\n else\n halt 401 # unauthorized\n end\n end",
"title": ""
},
{
"docid": "a64505a616b649d9984a4c291eb7bec7",
"score": "0.70147824",
"text": "def auth_attempt\n begin\n user = params[:basic_auth][:username]\n pass = params[:basic_auth][:password]\n rescue NoMethodError\n raise MissingCredentialsError, 'Neo4j authentication is enabled, username/password are required but missing'\n end\n connection.post(\"#{url}/authentication\", 'username' => user, 'password' => pass)\n end",
"title": ""
},
{
"docid": "0920b3fe2660c3acfe53d426fe698774",
"score": "0.69944316",
"text": "def login(email, password)\n self.class.basic_auth email, \"X\" #API requires no pass, just an API key\n @logged_in = true\n end",
"title": ""
},
{
"docid": "8e5ef9536ffce2a27857717ccff5bf60",
"score": "0.6975849",
"text": "def login_from_http_basic\n redirect_to root_url, :notice => 'Login from basic auth successful'\n end",
"title": ""
},
{
"docid": "96a5cbb8d557b4a6431dd7717d728a40",
"score": "0.6949907",
"text": "def require_login\n authenticate_user!\n end",
"title": ""
},
{
"docid": "9722356cb5c2666ad6eb31397c9bd78b",
"score": "0.69374764",
"text": "def authentication\n if dummy_user?\n reset_session\n end\n login_required and \n (params[\"commit\"] == \"Login\" or verify_authenticity_token) \n end",
"title": ""
},
{
"docid": "18d880f5cbeda22644e74877626ba888",
"score": "0.69127154",
"text": "def login\n self.current_user = User.authenticate(params[:login], params[:password])\n login_required\n end",
"title": ""
},
{
"docid": "e737e973596d37b4c16ee36c7889041f",
"score": "0.6909679",
"text": "def basic_http_auth!\n return false unless request.authorization.present?\n\n email, password = ActionController::HttpAuthentication::Basic.user_name_and_password(request)\n user = User.find_by_email(email)\n\n if user.present? and user.valid_password?(password)\n sign_in(user)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "889bb7e26cd772f68b4b4253c3b984a0",
"score": "0.6898092",
"text": "def authenticate\n\t\tif APP_CONFIG['perform_authentication']\n \tauthenticate_or_request_with_http_basic do |username, password|\n \t username == APP_CONFIG['username'] && password == APP_CONFIG['password']\n \tend\n\t\tend\n end",
"title": ""
},
{
"docid": "d2f7c0c4c0805aa5f65de0c9c48dee57",
"score": "0.68814534",
"text": "def api_authenticate\n @user = nil\n if has_parameters?(params, %w(username password))\n @attempted_authentication = true\n if User.exists?({ :login => params[:username].downcase, :password => params[:password] })\n @user = User.first(:conditions => { :login => params[:username].downcase, :password => params[:password] }) \n end\n end\n if request.env.has_key? 'HTTP_AUTHORIZATION'\n if request.env['HTTP_AUTHORIZATION'].start_with?(\"Basic\")\n logger.info \"Basic Authentication Attempt Detected: BASIC HTTP as Priority Method\"\n authenticate_or_request_with_http_basic do |username, password|\n @attempted_authentication = true\n if User.exists?({ :login => username.downcase, :password => password })\n @user = User.first(:conditions => { :login => username.downcase, :password => password })\n end\n end\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "bf334ff1cb270978844f04565de217f5",
"score": "0.6877994",
"text": "def authenticate\n if user = authenticate_with_http_basic { |u, p| User.authenticate(u, p) }\n @user = user\n else\n request_http_basic_authentication\n end\n end",
"title": ""
},
{
"docid": "5d36e2da2ae85dc707f003f96f669d99",
"score": "0.6870208",
"text": "def http_login(username, password = \"welcome\")\n create_user\n request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(username,password)\nend",
"title": ""
},
{
"docid": "d8207d52050dff362cf314c64ba0145b",
"score": "0.6859228",
"text": "def authenticate_user!\n identify_user(true)\n end",
"title": ""
},
{
"docid": "d8207d52050dff362cf314c64ba0145b",
"score": "0.6859228",
"text": "def authenticate_user!\n identify_user(true)\n end",
"title": ""
},
{
"docid": "c58c953f2895f678db88c9205a1f279e",
"score": "0.6855424",
"text": "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == self.username && password == self.password\n end\n end",
"title": ""
},
{
"docid": "455ccb12c54d73ccf6721ef33808612a",
"score": "0.6842003",
"text": "def authenticate!\n return unauthorized unless auth.provided? and auth.basic? and auth.credentials\n credentials = auth.credentials.map do |credential|\n config.hash_credentials ? Digest::SHA2.new(256).update(credential).to_s : credential\n end\n user = config.lookup.call(credentials.first, credentials.last)\n return user ? success!(auth.credentials.first) : unauthorized\n end",
"title": ""
},
{
"docid": "d0f8ef5720f625cbcac5d6c95f904fc0",
"score": "0.68416196",
"text": "def add_authentication\n if session.open?\n self['Cookie'] = session.cookie\n else\n basic_auth(user, password)\n end\n end",
"title": ""
},
{
"docid": "d8cfc110e73e1c9d31dc65eea8d9490e",
"score": "0.6839513",
"text": "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n config = Configuration.find(:first)\n if not config.nil?\n username == config.user_name and password == config.password\n end\n end\n end",
"title": ""
},
{
"docid": "30f034c4d726542b7f3a1831f96e96e9",
"score": "0.68365216",
"text": "def authenticate\n request_access('password', username: @username, password: @password)\n end",
"title": ""
},
{
"docid": "18995449e7d3ef7e0e84ebd354ff4060",
"score": "0.68285376",
"text": "def authenticate_user!\n optionally_authenticate_user!(true)\n end",
"title": ""
},
{
"docid": "d2e67553ffb80307ba0fa5ab7516527c",
"score": "0.68277436",
"text": "def login\n if ext_auth?(:saml_enabled) && ext_auth?(:local_login_disabled)\n redirect_to(saml_protected_page)\n return\n end\n\n if ext_auth?(:oidc_enabled) && ext_auth?(:local_login_disabled)\n redirect_to(oidc_protected_page)\n return\n end\n\n if ::Settings.product.allow_passed_in_credentials # Only pre-populate credentials if setting is turned on\n @user_name = params[:user_name]\n @user_password = params[:user_password]\n end\n @settings = copy_hash(DEFAULT_SETTINGS) # Need settings, else pages won't display\n @more = params[:type] && params[:type] != \"less\"\n add_flash(_(\"Session was timed out due to inactivity. Please log in again.\"), :error) if params[:timeout] == \"true\"\n logon_details = MiqServer.my_server(true).logon_status_details\n @login_message = logon_details[:message] if logon_details[:status] == :starting && logon_details[:message]\n\n if session[:user_validation_error]\n add_flash(session[:user_validation_error], :error)\n session[:user_validation_error] = nil\n end\n\n render :layout => \"login\"\n end",
"title": ""
},
{
"docid": "900fe44a6db431c4bcdac35052bf8be8",
"score": "0.6823061",
"text": "def login_required\n # Gather data from HTTP-based authentication.\n username, password = get_auth_data\n \n self.current_user ||= User.authenticate(username, password) || User.find_by_login(\"anonymous\") if username && password\n if !logged_in?\n flash[:notice] = t(:you_must_be_logged_in)\n redirect_to login_path\n end\n end",
"title": ""
},
{
"docid": "4b68a1b9df625221c7b68805daa22996",
"score": "0.6813706",
"text": "def authenticate\n # if session is complete and current, then proceed\n return true if session_authenticated?\n\n # Didn't like something so start totally clean\n reset_session\n \n if request.env.has_key? \"REMOTE_USER\"\n apache_authenticate\n elsif request.headers.has_key?('HTTP_X_FORWARDED_USER')\n proxy_apache_authenticate\n else\n logger.info(\"attempt to authenticate with http_basic\")\n authenticate_or_request_with_http_basic \"Bluepages Authentication\" do |user_name, password|\n # After much sole searching and net surfing, there is no way\n # to get a fast path through the authentication process\n # without introducing some test specific code into the\n # application. Most other methods also require mocking and\n # code to set a cookie or some other piece of magic.\n #\n # I decided to just make the code obvious and not bother with\n # all the sneaky stuff. The logic is this: In the test\n # environment, if the user is 'testuser', then the\n # authentication process is mostly bypassed; Otherwise the\n # normal process is followed. This allows a fast path and a\n # path to fully test all the real paths and the ability to\n # pick between the two quickly and obviously.\n if Rails.env.test? && user_name == 'testuser'\n test_authenticate(user_name, password)\n else\n ldap_authenticate(user_name, password)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e1f47d83e6f263d2dc06bce19cfe2154",
"score": "0.68108344",
"text": "def authenticate!\n error!('401 Unauthorized', 401) unless current_user\n end",
"title": ""
},
{
"docid": "d1c970d3548b066c19624d0c31a5ccba",
"score": "0.68072903",
"text": "def basic_auth_login\n @env ||= {}\n @env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('admin','')\n end",
"title": ""
},
{
"docid": "e27b160ac701437a8a69bc63fff3cd87",
"score": "0.6805897",
"text": "def authenticate\n puts '#> authenticating'\n uname = params[:uname]\n upassword = params[:upassword]\n \n # no creadentials\n if uname.nil? or upassword.nil?\n # check if already logged in\n ticket = session[:ticket]\n if not ticket.nil?\n @user_id = decrypt(ticket)\n else\n record_user\n end\n else # check credentials\n get_user_from_credentials(uname, upassword)\n end\n \n if @user.nil? # we haven't got a user yet\n get_user_from_id\n end\n if @user.nil? and @user_id != Globals::DEFAULT[:user_id] # retry 'anon' as we might have picked up a crap cookie\n get_user_from_uid('anon')\n end\n if @user.nil? # FAILURE\n throw 'Authentication failed, unable to find even a default user to authenticate as'\n end\n # add the users details to the view state\n # but ensure that their password isn't exposed while\n # noting that an empty/null password will present\n # 'anon' as the password\n @user.set_password('')\n @view_state[:user] = @user\n end",
"title": ""
},
{
"docid": "3ad796d157ac73069f45760737312906",
"score": "0.6796027",
"text": "def basic_auth(login, pass); end",
"title": ""
},
{
"docid": "5169eb2f573a0490408cfe7656e32aed",
"score": "0.67929333",
"text": "def authenticate\n# logger.debug \"Host name is: \" + request.host\n# logger.debug \"session user is:\" + (session[:user].nil? ? \"nil\" : session[:user])\n# logger.debug request.headers[\"HTTP_AUTHORIZATION\"].nil? ? \"No auth present in request\" : \"Auth headers present\"\n if session[:user]\n set_auth_vars\n elsif fake_auth_permitted?\n set_fake_auth\n else\n force_auth\n end\n @user\nend",
"title": ""
},
{
"docid": "bea398407c817ccc1e49b63f6fc76b17",
"score": "0.67680687",
"text": "def authenticate!\n\t\terror!('Unauthorized', 401) if !is_authenticated\n @request_user\n\tend",
"title": ""
},
{
"docid": "8042c2c1498926c60e22902b98134e0c",
"score": "0.67596585",
"text": "def authenticate\n\t authenticate_or_request_with_http_basic do |username, password|\n\t \tif (username == Beeronrails::Application.config.user && password == Beeronrails::Application.config.pass)\n\t \t\ttrue\n\t else\n\t \traise UnAuth\n\t end\n\t end\n\tend",
"title": ""
},
{
"docid": "b804b1bda16e636208cc4abf0d1f9e33",
"score": "0.67589444",
"text": "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == CONFIG.username.to_s && password == CONFIG.password.to_s\n end\n end",
"title": ""
},
{
"docid": "b804b1bda16e636208cc4abf0d1f9e33",
"score": "0.67589444",
"text": "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == CONFIG.username.to_s && password == CONFIG.password.to_s\n end\n end",
"title": ""
},
{
"docid": "b828a90a63ffab6eabab9659cb52cbbb",
"score": "0.6757928",
"text": "def authenticate_admin!\n if Facebase.password && Facebase.username\n authenticate_or_request_with_http_basic do |username, password|\n username == Facebase.username && password == Facebase.password\n end\n end\n end",
"title": ""
},
{
"docid": "36ccb8e726a6d48a029414c0cffb8865",
"score": "0.6752416",
"text": "def login!\n login(true)\n end",
"title": ""
},
{
"docid": "65b0a84676b264ea91965586b1b99d8b",
"score": "0.67365205",
"text": "def login_required_with_basic\n respond_to do |accepts|\n # alias_method_chain will alias the app's login_required to login_required_without_basic\n accepts.html { login_required_without_basic }\n \n # access_denied_with_basic_auth is defined in LoggedExceptionsController\n # get_auth_data returns back the user/password pair\n accepts.rss do\n access_denied_with_basic_auth unless self.current_user = User.authenticate(*get_auth_data)\n end\n end\n end",
"title": ""
},
{
"docid": "5617a8b000921d76d8983d4f3cea26cd",
"score": "0.6730528",
"text": "def authenticate\n if [Information::StorageController, Information::ExperimentsController, Information::ChartController,\n Information::DbInstancesController, Information::DbConfigServicesController,\n Information::SupervisorController, Information::DbRoutersController].include? self.class\n\n authenticate_or_request_with_http_basic do |username, password|\n username == Rails.application.secrets.information_service_user && password == Rails.application.secrets.information_service_pass\n end\n elsif self.is_a? Information::StatusController\n # pass\n else\n super\n @current_user = current_user.convert_to(ScalarmUser) if current_user\n @sm_user = sm_user.convert_to(SimulationManagerTempPassword) if sm_user\n @user_session = user_session.convert_to(UserSession) if user_session\n end\n end",
"title": ""
},
{
"docid": "cf4f9db8085d64b007f416379a37360d",
"score": "0.6730346",
"text": "def login_with username=nil, password=nil\n\tself.username = username\n\tself.password = password\n\tself.login\n end",
"title": ""
},
{
"docid": "fa9c3d996e62ab0ba26f8570ab90cf85",
"score": "0.67284757",
"text": "def http_authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == \"skills\" && password == \"safety\"\n end\n warden.custom_failure! if performed?\nend",
"title": ""
},
{
"docid": "4a75dbae3d0d305c3f0dedeb3c20b6e0",
"score": "0.6727126",
"text": "def authenticate_basic_auth\n credentials = ::Base64.decode64(request.authorization.split(' ', 2).last || '')\n login, api_key = credentials.split(/:/, 2)\n DanbooruLogger.add_attributes(\"param\", login: login)\n authenticate_api_key(login, api_key)\n end",
"title": ""
},
{
"docid": "ceca3b5e15e11f0ce6abfe5019f85ad0",
"score": "0.67222583",
"text": "def require_http_auth_user\n\n render :json => { :errors => 'unauthorized', status: 401 } unless Setting.api_open?\n\n authenticate_or_request_with_http_basic do |username, password|\n user = User.where(:email => username).first\n if user.valid_password?(password) # this is an Authlogic method\n @current_user = user\n true # nothing pays attention to true/false anymore from filters\n else\n @current_user = nil\n render :json => { :errors => 'unauthorized', status: 401 }\n end\n end\n end",
"title": ""
},
{
"docid": "4416bdabcac0f8fbeee7041df9913be9",
"score": "0.672139",
"text": "def authenticate_site_access\n authenticate_or_request_with_http_basic do |u, p|\n u == Rails.application.credentials.http_basic_username &&\n p == Rails.application.credentials.http_basic_password\n end\n end",
"title": ""
},
{
"docid": "f0a144c79ec8130182b9ecad0659aa25",
"score": "0.6712023",
"text": "def http_header_auth_login\n if !user_signed_in? && request.headers.key?('HTTP_API_AUTHENTICATION')\n credentials = api_credentials(request.headers)\n if http_header_auth?\n u = User.where(email: credentials[:config][:username]).first\n sign_in :user, u\n authenticate_user!\n else\n warden.custom_failure!\n render json: 'Unable to authenticate user.', status: 422\n end\n end\n end",
"title": ""
},
{
"docid": "00b3c3d620b96156b71f2e2bc3971786",
"score": "0.6708959",
"text": "def require_login\n authenticate_or_request_with_http_basic do |username, password|\n username == \"blueprint-api-client\" && password == \"callipygian\"\n end\n end",
"title": ""
},
{
"docid": "05aaecc2a7ac028bba8ba5fd0ff1f687",
"score": "0.6705817",
"text": "def login(username, password)\n connection.basic_auth(username, password)\n @logged_in = true\n end",
"title": ""
},
{
"docid": "f378d150962ff2719cedd562ee288b96",
"score": "0.670257",
"text": "def basic_auth\n authenticate_or_request_with_http_basic do |username, password|\n # username == '59_mercari_a' && password == '59a'\n username == ENV[\"BASIC_AUTH_USER\"] && password == ENV[\"BASIC_AUTH_PASSWORD\"]\n end\n end",
"title": ""
},
{
"docid": "e556e91bd487f6b14653565774701056",
"score": "0.67011154",
"text": "def login_to_system(username='admin', password='dirtybird')\n self.username = username\n self.password = password\n login\n end",
"title": ""
},
{
"docid": "29eaec8b7201fa23c629e3c91f625ca9",
"score": "0.6701098",
"text": "def authenticate\n head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "49d768b9e6b80f469aca26193535bf22",
"score": "0.66992676",
"text": "def login_from_token\n if auth_id = request.headers['Authorization']\n @current_user = ::User.find auth_id\n else\n user_not_authenticated\n end\n rescue\n user_not_authenticated\n end",
"title": ""
},
{
"docid": "f8635aad986a26efe8c39170ef666325",
"score": "0.6699186",
"text": "def require_login\n authenticate_user!\n end",
"title": ""
},
{
"docid": "bb930964c162561c8d7dd2f1f28a2870",
"score": "0.6697063",
"text": "def basic_auth\n\n return if Rails.env.development?\n\n return if Rails.env.production? && GlobalConstant::Base.is_public_launch_done?\n\n users = {\n GlobalConstant::BasicAuth.username => GlobalConstant::BasicAuth.password\n }\n\n authenticate_or_request_with_http_basic do |username, password|\n if users[username].present? && users[username] == password\n true\n else\n false\n end\n end\n\n end",
"title": ""
},
{
"docid": "bb930964c162561c8d7dd2f1f28a2870",
"score": "0.6697063",
"text": "def basic_auth\n\n return if Rails.env.development?\n\n return if Rails.env.production? && GlobalConstant::Base.is_public_launch_done?\n\n users = {\n GlobalConstant::BasicAuth.username => GlobalConstant::BasicAuth.password\n }\n\n authenticate_or_request_with_http_basic do |username, password|\n if users[username].present? && users[username] == password\n true\n else\n false\n end\n end\n\n end",
"title": ""
},
{
"docid": "e5bcbe3437fb5ec27498935b5728d1f4",
"score": "0.6683279",
"text": "def try_to_login\n \n User.login(self.user_name, self.password)#||\n #User.find_by_user_name(user_name)\n end",
"title": ""
},
{
"docid": "872e135bea49b97c835d6db99bd31612",
"score": "0.6682773",
"text": "def initiate_authentication\n @connection_state = :waiting_for_username\n send_login_prompt\n end",
"title": ""
},
{
"docid": "4fc238a4a3801056f01242b1ac9199b3",
"score": "0.66778934",
"text": "def login\n authenticate_with_http_basic do |email, password|\n user = User.find_by_email(email)\n unless user && user.authenticate(password)\n render status: :unauthorized\n return\n end\n token, exp = JsonWebToken.encode({\n user_public_id: user.public_id\n })\n render json: {\n access_token: token,\n exp: Time.zone.at(exp).to_datetime\n }, status: :ok\n return\n end\n render status: :bad_request\n end",
"title": ""
},
{
"docid": "27c74c3a0f5feb93ea5b06ebf31d1957",
"score": "0.66714835",
"text": "def login\n @context.login\n end",
"title": ""
},
{
"docid": "17447e4851d5a5831a6a10e4de23190f",
"score": "0.6661643",
"text": "def authenticate!\n unless @current_user\n redirect_to OmniAuth.login_path(:provider)\n end\n end",
"title": ""
},
{
"docid": "89e38e00feb2e78817bff8aa540f9851",
"score": "0.6647196",
"text": "def authenticate!\n unless logged_in?\n redirect_to login_url, alert: \"You must be logged in to continue.\"\n end\n end",
"title": ""
},
{
"docid": "e16f2a659aa01b24eea8d7743eb124aa",
"score": "0.6647007",
"text": "def success\n authenticate_or_request_with_http_basic do | username, password |\n session[:redirect] = false\n session[:expires] = Time.now\n session[:uname] = username\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "3932d24be1322e99ea1a1e850e4f27a9",
"score": "0.6642366",
"text": "def authenticate\n @me = CurrentUser.find_by(uname: session[:uname])\n return true\n end",
"title": ""
}
] |
16e098d12fa2252e5384b3b45131e681
|
Has the job started?
|
[
{
"docid": "58d6bfb2dd046d38ffacbc2208f80e5d",
"score": "0.7183085",
"text": "def started?\n return @actual_start_time != nil\n end",
"title": ""
}
] |
[
{
"docid": "8941ed4dbe82f020325e50fe17185512",
"score": "0.77718776",
"text": "def running?\n @started\n end",
"title": ""
},
{
"docid": "8fda23e13f563b82860b0b1076372ada",
"score": "0.7751229",
"text": "def started?\r\n @started\r\n end",
"title": ""
},
{
"docid": "7ab8422c8dcd52a216ed98d5533dc35c",
"score": "0.7738784",
"text": "def running?\n # If the #running? method is being called for but the job hasn't started, reload\n # to check to see if it has been assigned\n self.reload if started_at.nil? || completed_at.nil?\n\n started_at && !completed_at\n end",
"title": ""
},
{
"docid": "1d18f94f5378a6b66c2248a1b33e4e09",
"score": "0.769916",
"text": "def running?\n return @started\n end",
"title": ""
},
{
"docid": "c2b0741ee9709fe782c62d6b0149cd65",
"score": "0.7678886",
"text": "def started?\n status == RUNNING_STATE\n end",
"title": ""
},
{
"docid": "7ab0620e38a3d1bda7af4e1b5d6da64a",
"score": "0.7651748",
"text": "def started?\n status == RUNNING_STATE\n end",
"title": ""
},
{
"docid": "281c9a5c9779871f9bd869bce82a0a7f",
"score": "0.76353574",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "f009b65fbcb6d4a8834ed20491628879",
"score": "0.7611173",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "bb6d42c8e1d81588b7c1734b8300c0cd",
"score": "0.7591696",
"text": "def has_jobs?\n @em_lock.synchronize{\n @em_jobs > 0\n }\n end",
"title": ""
},
{
"docid": "ff08816a750ddb65ad880d21dd8273d6",
"score": "0.7555574",
"text": "def started?\n @mutex.synchronize do\n @state == :started\n end\n end",
"title": ""
},
{
"docid": "010ae77402b1fe1de14b388d4b261d67",
"score": "0.75455093",
"text": "def started?\n @started == true\n end",
"title": ""
},
{
"docid": "5a9d21d35c0eed1a202e88dcc2a7e31c",
"score": "0.75401336",
"text": "def running?\n\t\t\treturn @jobs && [email protected]?\n\t\tend",
"title": ""
},
{
"docid": "ff33d7dc9f930b18ceaf88fd1b63e52e",
"score": "0.7523585",
"text": "def started?\n synchronize { @started }\n end",
"title": ""
},
{
"docid": "009f3655023fcd0cc704cd36ccdbb0e2",
"score": "0.7511731",
"text": "def started?\n state == :started\n end",
"title": ""
},
{
"docid": "922974cd8ef630c5cffddb9de4b424dd",
"score": "0.75057197",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "922974cd8ef630c5cffddb9de4b424dd",
"score": "0.75057197",
"text": "def started?\n @started\n end",
"title": ""
},
{
"docid": "9d0dadf114cf027251fed675fe6d0efe",
"score": "0.7498222",
"text": "def started?\n @current_worker_thread != nil\n end",
"title": ""
},
{
"docid": "a214c90ae8441c6d14ddf586fb50aa64",
"score": "0.7488458",
"text": "def started?\n @status == Started\n end",
"title": ""
},
{
"docid": "a246ed581a5a2bf419e31c0a8419c4d2",
"score": "0.74755424",
"text": "def job?\n [email protected]?\n end",
"title": ""
},
{
"docid": "5fe12c8cd9ed64507958dd1ee01089ab",
"score": "0.74750334",
"text": "def running?\n\t\treturn ! self.start_time.nil?\n\tend",
"title": ""
},
{
"docid": "5d44fb993a8585c87d829f8e6d1d5922",
"score": "0.7461203",
"text": "def job_in_progress?\n !job_in_progress_id.nil?\n end",
"title": ""
},
{
"docid": "03fbf1e5ced1ad2983f1f67015f84d0c",
"score": "0.74469304",
"text": "def completed?\n return self.shift_jobs.count > 0\n end",
"title": ""
},
{
"docid": "007f504008ff746c66ccafbcba299eda",
"score": "0.7445971",
"text": "def started?\n !!@started\n end",
"title": ""
},
{
"docid": "e3d7467107c7a25b3c1f8d71cbf80483",
"score": "0.74445415",
"text": "def ready?\n return @jobs.length < 1\n end",
"title": ""
},
{
"docid": "a9fe0ab6afa57363a3ca57004e57ce5d",
"score": "0.7443918",
"text": "def started?\n state?(STATE_STARTED)\n end",
"title": ""
},
{
"docid": "646da064aa58bec18b826bd13cad2e6f",
"score": "0.7426766",
"text": "def running?\n @lock.synchronize { @start_time != nil } && !done?\n end",
"title": ""
},
{
"docid": "ec53a5847dcecdd5c311ce7831edfd01",
"score": "0.74034464",
"text": "def started?\n state == \"STARTED\"\n end",
"title": ""
},
{
"docid": "eb7d565182d48ca25f9a9e34b6a18c1c",
"score": "0.7382922",
"text": "def started?\n !(waiting_to_start?)\n end",
"title": ""
},
{
"docid": "eb7d565182d48ca25f9a9e34b6a18c1c",
"score": "0.7382922",
"text": "def started?\n !(waiting_to_start?)\n end",
"title": ""
},
{
"docid": "022f07badc8766d23b9fa9d93839de52",
"score": "0.7375169",
"text": "def started?\n ! @state.nil?\n end",
"title": ""
},
{
"docid": "837490c2ad6cab9dcf33943bb41282e5",
"score": "0.7356181",
"text": "def force_started?\n has_status(:started) and not has_status(:queued)\n end",
"title": ""
},
{
"docid": "91992564c366499fe95edf84ca4bb735",
"score": "0.73559874",
"text": "def started?\n return Time.now > start_time\n end",
"title": ""
},
{
"docid": "6c41e268e2675b33e3b615b0f2868e6b",
"score": "0.7347072",
"text": "def started?\n synchronize do\n !(!@request_queue)\n end\n end",
"title": ""
},
{
"docid": "a70c820b6bf60ee18bd576ac4b576373",
"score": "0.733616",
"text": "def job_running!\n @job_running = true\n end",
"title": ""
},
{
"docid": "04565ba36844b73766bdfb5e32de8b8f",
"score": "0.73307455",
"text": "def has_job_progress?\n !job_progress_queue.empty?\n end",
"title": ""
},
{
"docid": "67b30465ea149c1dffe529223f428a06",
"score": "0.7326179",
"text": "def running?\n return started? && !completed?\n end",
"title": ""
},
{
"docid": "dc3c3139fd5dad52b6fb0c19f090d1cc",
"score": "0.73063284",
"text": "def active?\n interface.active_job_monitor?(self)\n end",
"title": ""
},
{
"docid": "eb98790728a5955b745c0d323a4fcbf3",
"score": "0.72770023",
"text": "def running?\n return false unless @current_resource.created\n profile(status).map { |l| return true if l.include?('is STARTED') }\n\n false\n end",
"title": ""
},
{
"docid": "de0a6e7817c1f0f1723b45f6727e76d8",
"score": "0.7274447",
"text": "def started?\n logger.debug(\"checking if started... list size is #{ worker_threads }\")\n @total_threads == worker_threads && @workers.list.all? { |w| w[:status] }\n end",
"title": ""
},
{
"docid": "aac7053d97f7a3e64be5dbaa205e56fa",
"score": "0.72684026",
"text": "def job_start\n # Only start if it isn't running\n if (self.jobs_running == 0)\n # Try to add ir to the schedule\n return self.job_schedule_next\n else\n return false # If it's already running\n end\n end",
"title": ""
},
{
"docid": "cdbad63648f5bc2d3b0bc9c5c90f7180",
"score": "0.7236067",
"text": "def been_active?\n # Shell out to grep with -m 1 for lazy match, as the log files can grow quite large\n # and we only need to know if one job has ever started.\n any_job = `egrep -m 1 ';pbs_mom;Job;.+;Started' /var/spool/pbs/mom_logs/*`.strip\n any_job.length > 0\nend",
"title": ""
},
{
"docid": "4fdbfd91528acd24d9cf463b615680da",
"score": "0.7233872",
"text": "def started?\n @thread_pool&.running?\n end",
"title": ""
},
{
"docid": "4fdbfd91528acd24d9cf463b615680da",
"score": "0.7233872",
"text": "def started?\n @thread_pool&.running?\n end",
"title": ""
},
{
"docid": "abe34967b9963f440c4b4cea7cf79390",
"score": "0.72023666",
"text": "def already_started?\n if started?\n TingYun::Agent.logger.info(\"Agent Started Already!\")\n true\n end\n end",
"title": ""
},
{
"docid": "b9042db3765f34a35d108c5d46f7592f",
"score": "0.71984506",
"text": "def started?\n @_service_state == :started\n end",
"title": ""
},
{
"docid": "c1dcb6a6851473974b6ea32269ca110d",
"score": "0.71971446",
"text": "def started?\n not synchronize(:thread) { self.thread }.nil?\n end",
"title": ""
},
{
"docid": "01e3ceff974a0274d0d404fa32021ea4",
"score": "0.7185485",
"text": "def completed?\r\n # ShiftJob.find_all_by_shift_id(self.id).size > 0\r\n self.shift_jobs.count > 0\r\n end",
"title": ""
},
{
"docid": "1e765bcd7412070f3b40a34d1dbdd600",
"score": "0.71849406",
"text": "def started?\n !@start_time.nil?\n end",
"title": ""
},
{
"docid": "55afe6272b240b511db3d253a19442d5",
"score": "0.7178022",
"text": "def started?\n statuses.include?(:start)\n end",
"title": ""
},
{
"docid": "df8e645a2e079b0f073a2d5b070d623f",
"score": "0.71609336",
"text": "def background_alive?\n Marathonr::WorkRequest.find(session[:job_request_id])\n end",
"title": ""
},
{
"docid": "2cbc6ad06921ddb14e8bc2cd51f1e4de",
"score": "0.7160763",
"text": "def started?\n !self.started_at.nil?\n end",
"title": ""
},
{
"docid": "2cbc6ad06921ddb14e8bc2cd51f1e4de",
"score": "0.7160763",
"text": "def started?\n !self.started_at.nil?\n end",
"title": ""
},
{
"docid": "4dc54ef8f9c6f4254d5753ae0939d36e",
"score": "0.715951",
"text": "def started?\n Context.started?\n end",
"title": ""
},
{
"docid": "19a5ecf825fa8fdd99be5a2deb8e9a15",
"score": "0.71471626",
"text": "def running?\n !!@started_at\n end",
"title": ""
},
{
"docid": "76e9f7e37d2bd0f488f5e562f32925bb",
"score": "0.71458405",
"text": "def started?\n\t\treturn @main_thread && @main_thread.alive?\n\tend",
"title": ""
},
{
"docid": "76e9f7e37d2bd0f488f5e562f32925bb",
"score": "0.71458405",
"text": "def started?\n\t\treturn @main_thread && @main_thread.alive?\n\tend",
"title": ""
},
{
"docid": "7fe5a1129a471619a2f95a1e06985a0d",
"score": "0.7132447",
"text": "def started?\n @start_time\n end",
"title": ""
},
{
"docid": "c9c6b5c0e3fd8d24d846beceb1a0a227",
"score": "0.7119018",
"text": "def is_job_running\n\tget_db_status =~ /^RUNNING$/ ? true : false\nend",
"title": ""
},
{
"docid": "b06600271d4a2ab4e120c63567eb8e72",
"score": "0.7117753",
"text": "def running?\n\t\treturn self.started? && self.timing_event_count.nonzero?\n\tend",
"title": ""
},
{
"docid": "5aef015f8901f8161a5c324796fad171",
"score": "0.7115875",
"text": "def building?\n jobs.any? {|job| job.incompleted?}\n end",
"title": ""
},
{
"docid": "598b15dd35eea61aba7a8531f46141c6",
"score": "0.71156675",
"text": "def started?\n !!@start_instant\n end",
"title": ""
},
{
"docid": "e3e3b2f94028f1555166363edbb6683d",
"score": "0.71121466",
"text": "def is_running?\n @running\n end",
"title": ""
},
{
"docid": "e3e3b2f94028f1555166363edbb6683d",
"score": "0.71121466",
"text": "def is_running?\n @running\n end",
"title": ""
},
{
"docid": "e3e3b2f94028f1555166363edbb6683d",
"score": "0.71121466",
"text": "def is_running?\n @running\n end",
"title": ""
},
{
"docid": "e40a94f1570a9c8144a897e088a975d4",
"score": "0.711073",
"text": "def running?\n probe if @running.nil?\n @running\n end",
"title": ""
},
{
"docid": "5da8251ecb3ce7df9d80b206654d8827",
"score": "0.70961535",
"text": "def started?\n !start_time.nil?\n end",
"title": ""
},
{
"docid": "5da8251ecb3ce7df9d80b206654d8827",
"score": "0.70961535",
"text": "def started?\n !start_time.nil?\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "963b717951fa7b98c47a4e9991cb0776",
"score": "0.7090595",
"text": "def running?\n @running\n end",
"title": ""
},
{
"docid": "4cc4f51015be56f8f4a6d7a8f4d9a865",
"score": "0.7082006",
"text": "def is_asked?\n self.started\n end",
"title": ""
},
{
"docid": "6f374ce213c87cbd34cf10b740021634",
"score": "0.70674556",
"text": "def started?; @started; end",
"title": ""
},
{
"docid": "43cd94f5cd14a9a3454d4036150d6291",
"score": "0.7064584",
"text": "def started?\n !!@id\n end",
"title": ""
},
{
"docid": "43cd94f5cd14a9a3454d4036150d6291",
"score": "0.7064584",
"text": "def started?\n !!@id\n end",
"title": ""
},
{
"docid": "aacfcd7526e68321856f6a99ba1dbfd3",
"score": "0.70640343",
"text": "def started?\n !stopped?\n end",
"title": ""
},
{
"docid": "aacfcd7526e68321856f6a99ba1dbfd3",
"score": "0.70640343",
"text": "def started?\n !stopped?\n end",
"title": ""
},
{
"docid": "5aab95783b647b66e777c33284e3f620",
"score": "0.70629597",
"text": "def started?\n Thread.main[:ruote_amqp_started] == true\n end",
"title": ""
},
{
"docid": "b84da61b06be77ac7351c815b693d594",
"score": "0.7056511",
"text": "def started?\n puts 'started called'\n true #always started.\n end",
"title": ""
},
{
"docid": "b84da61b06be77ac7351c815b693d594",
"score": "0.7056009",
"text": "def started?\n puts 'started called'\n true #always started.\n end",
"title": ""
},
{
"docid": "9adb9898f6359aea39dc3d23ed65af37",
"score": "0.7054279",
"text": "def em_running?\n @@em_jobs > 0 && EventMachine.reactor_running?\n end",
"title": ""
},
{
"docid": "89fd97ec479bc93a0493b2ee38c4e7fc",
"score": "0.70537317",
"text": "def completed?\n\t\t# if there are no jobs associated with this shift, then it is not \n\t\t# completed and this should return false\n\t\treturn self.shift_jobs.count > 0\n\tend",
"title": ""
},
{
"docid": "58e74cbdb2b8972a675e4a8f94d35f12",
"score": "0.7051286",
"text": "def is_running\n\t\tend",
"title": ""
},
{
"docid": "58e74cbdb2b8972a675e4a8f94d35f12",
"score": "0.7051286",
"text": "def is_running\n\t\tend",
"title": ""
},
{
"docid": "4bed8063f6f1e4d8eacfae6be9bd9ebc",
"score": "0.70491344",
"text": "def job?\n job_class.present?\n end",
"title": ""
}
] |
60a26645ce4bc461e5b7cfb2c6975c19
|
This is commented out, so the minimize menu item is disabled def on_minimize(menu) end window/zoom
|
[
{
"docid": "cde71cdeb53cdf21f50ca7b9577c2f7c",
"score": "0.62851954",
"text": "def on_zoom(menu)\n end",
"title": ""
}
] |
[
{
"docid": "39f5f9ce456cba522feabbc7372e67ae",
"score": "0.8803367",
"text": "def on_minimize(menu)\n end",
"title": ""
},
{
"docid": "39f5f9ce456cba522feabbc7372e67ae",
"score": "0.8803367",
"text": "def on_minimize(menu)\n end",
"title": ""
},
{
"docid": "7222ad74cd9f93a4cf9dabb24a0e0685",
"score": "0.7598511",
"text": "def minimize; set_window_state :SW_MINIMIZE; end",
"title": ""
},
{
"docid": "90948deee63bd24101b83dbd23bf8ed9",
"score": "0.7377001",
"text": "def minimize; set_window_state (:SW_MINIMIZE); end",
"title": ""
},
{
"docid": "2d9fb0e9803bccf9c98c21b532e7b818",
"score": "0.71710217",
"text": "def minimize\n @bridge.minimize_window\n end",
"title": ""
},
{
"docid": "a8f6277115df6a77e9604e95509567e7",
"score": "0.7027082",
"text": "def window_minimized\n end",
"title": ""
},
{
"docid": "843a7674a2351e552211e079c74c1cd0",
"score": "0.69112724",
"text": "def force_minimize!\n ret=WinUser.ShowWindow(hwnd, SW_FORCEMINIMIZE)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "eec4e8b80aa3807e51e27bf97fd6599c",
"score": "0.6689475",
"text": "def minimize\n Functions.show_window(hwnd, Constants::SW_MINIMIZE)\n sleep 1\n end",
"title": ""
},
{
"docid": "52d33a56301ef0c1d75ce245548f3cfb",
"score": "0.6474177",
"text": "def minimize!\n ret=WinUser.ShowWindow(hwnd, SW_MINIMIZE)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "031d9c6e7b788b7249d1b728d01f0820",
"score": "0.63932437",
"text": "def maximize; set_window_state :SW_MAXIMIZE; end",
"title": ""
},
{
"docid": "b07336053b32d93556f27003a1527c1d",
"score": "0.6334476",
"text": "def toggle_maximize\n maximize(!maximize())\n end",
"title": ""
},
{
"docid": "a594a9b32421dd2b283691c82e6cd7d9",
"score": "0.62802696",
"text": "def apply_minimize\n @minimize=true\n end",
"title": ""
},
{
"docid": "ac0625e696d1758c62bb0c24abe0a4ad",
"score": "0.62439364",
"text": "def minimized?\n end",
"title": ""
},
{
"docid": "e73a1e910c8312a78e252163e769cf99",
"score": "0.62228703",
"text": "def maximize; set_window_state (:SW_MAXIMIZE); end",
"title": ""
},
{
"docid": "d7a38a398a7f516d45f1ebdc2ff10d0b",
"score": "0.6172556",
"text": "def window_maximized\n end",
"title": ""
},
{
"docid": "0b48225f74cb589a220fd24333419f61",
"score": "0.6131724",
"text": "def window_maximize()\n do_command(\"windowMaximize\", [])\n end",
"title": ""
},
{
"docid": "b1386876a7e641b057d8e9141c4ad0fd",
"score": "0.607801",
"text": "def add_tray_minimize(window, tiptxt, icon_path) \n icon = $ExtractIcon.call(0, icon_path, 0)\n \n $pnid = NOTIFYICONDATA.new\n $pnid.hWnd = window.winfo_id.to_i(16)\n $pnid.uID = 'ruby'.hash \n $pnid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_SHOWTIP\n $pnid.uCallbackMessage = WM_TRAYICON\n $pnid.hIcon = icon\n $pnid.szTip = tiptxt\n\n #-------WNDPROC OVERRIDE---------#\n # Custom windowProc override\n $my_window_proc = Win32::API::Callback.new('LIIL', 'I') { |hwnd, umsg, wparam, lparam|\n\n if umsg == WM_TRAYICON && lparam == WM_LBUTTONUP\n # Restore window\n window.deiconify\n $Shell_NotifyIcon.call(NIM_DELETE, $pnid.pack)\n end\n\n # I HAVE NO IDEA IF THIS IS THE ACTUAL MINIMIZE MESSAGE but it seems to work okay\n # These messages seem to be different from what is documented in the Windows API\n if umsg == 24 && wparam == 0 && $tray_listen\n window.withdraw\n $Shell_NotifyIcon.call(NIM_ADD, $pnid.pack)\n end\n\n # Pass messages to original windowProc\n $CallWindowProc.call($old_window_proc, hwnd, umsg, wparam, lparam)\n }\n\n # Intercept windowProc messages, original windowProc should be returned\n $old_window_proc = $SetWindowLong.call(window.winfo_id.to_i(16), GWL_WNDPROC, $my_window_proc)\n #------END WNDPROC OVERRIDE------#\n\nend",
"title": ""
},
{
"docid": "c5e4f68e4e6174068f1b05bc1c622f65",
"score": "0.6067617",
"text": "def minimized?\n Functions.minimized(hwnd)\n end",
"title": ""
},
{
"docid": "8e2a85abd1fd4f400c87106f44f7f954",
"score": "0.59881973",
"text": "def show_minimized!\n ret=WinUser.ShowWindow(hwnd, SW_SHOWMINIMIZED)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "ddbc981c7021be2a677d22fbcf14c2f2",
"score": "0.59468186",
"text": "def minimize!\n replace minimize\n end",
"title": ""
},
{
"docid": "8dbb3074f2f63008bbee76a2b3062219",
"score": "0.5826756",
"text": "def IsRestored(hwnd) (GetWindowStyle(hwnd) & (WS_MINIMIZE | WS_MAXIMIZE)) == 0 end",
"title": ""
},
{
"docid": "97450f505ffa956473d85723b74c771c",
"score": "0.579158",
"text": "def unminimize!\n replace unminimize\n end",
"title": ""
},
{
"docid": "7e5ba1e391edfae1a878c5cc6f745e75",
"score": "0.5757019",
"text": "def maximize\n Functions.show_window(hwnd, Constants::SW_MAXIMIZE)\n sleep 1\n end",
"title": ""
},
{
"docid": "e49fb58f4a200f2d545f537cdae136e4",
"score": "0.5745095",
"text": "def minimize(options = {})\n Minimize::Hopcroft.execute(self, options)\n end",
"title": ""
},
{
"docid": "62b0f323417517225a2b03bd0b5e6789",
"score": "0.5704619",
"text": "def maximize_window\n #execute_script(\"window.resizeTo(window.screen.width, window.screen.height - 50); window.moveTo(0, 0);\")\n end",
"title": ""
},
{
"docid": "60173072880055d87f2effcf510c7fed",
"score": "0.5663293",
"text": "def start_menu_hide_user_tile\n return @start_menu_hide_user_tile\n end",
"title": ""
},
{
"docid": "3ff839a4671d231be32549798ba7a06e",
"score": "0.56413436",
"text": "def expand # maximize \n e = ResizeEvent.new @current_component, :EXPAND\n fire_handler :COMPONENT_RESIZE_EVENT, e\n end",
"title": ""
},
{
"docid": "40a9904fe1e6b6f67ca1402538af0b16",
"score": "0.56398803",
"text": "def is_minimized?\n is_minimized\n end",
"title": ""
},
{
"docid": "d2b04827b1984f428541564c384b5c0f",
"score": "0.5615929",
"text": "def maximize\n @bridge.maximize_window\n end",
"title": ""
},
{
"docid": "79094559927420fe3fcee26c2ee60d84",
"score": "0.5521952",
"text": "def hide_all_windows_smooth\n y = Graphics.height\n @help_window.close\n @c_help_window.close\n @overview_window.smooth_move(0, y, smooth_speed)\n @role_window.smooth_move(0, y, smooth_speed)\n @params_window.smooth_move(0, y, smooth_speed)\n @states_window.smooth_move(0, y, smooth_speed)\n @stats_window.smooth_move(0, y, smooth_speed)\n end",
"title": ""
},
{
"docid": "d409e9c1811ca85a80b664c377418e9a",
"score": "0.55141795",
"text": "def minimize\n end",
"title": ""
},
{
"docid": "edd4caae324c3210e21b592468d893da",
"score": "0.55129087",
"text": "def window_exposed\n end",
"title": ""
},
{
"docid": "98b3eb6752669d903326bfc8f68a64da",
"score": "0.5508253",
"text": "def signal_main_menu\n unless @main_menu_signalled\n `pkill -USR1 main_menu`\n @main_menu_signalled = true\n end\n end",
"title": ""
},
{
"docid": "c3fbb523f8094675acba1affaad87acb",
"score": "0.5505644",
"text": "def minimize!\n # I'll implement this when I need it\n end",
"title": ""
},
{
"docid": "9bdaebb053c166164f2804ed135a23a1",
"score": "0.54952186",
"text": "def lock_windows(menu_item)\n Configuration.windows_locked ? menu_item.title = 'Lock Windows'._ : menu_item.title = 'Unlock Windows'._\n\n Configuration.windows_locked = !Configuration.windows_locked\n end",
"title": ""
},
{
"docid": "c6b6e4604e0ae5aff16e46cbf1e91872",
"score": "0.5487839",
"text": "def hide_windows\n x = @boosts_window.x\n y = Graphics.height\n @boosts_window.smooth_move(x, y)\n @skills_window.smooth_move(x, y)\n @milks_window.smooth_move(x, y)\n @elements_window.smooth_move(x, y)\n @affinity_window.smooth_move(x, y)\n @power_window.smooth_move(x, y) unless @power_window.nil?\n end",
"title": ""
},
{
"docid": "0fc9ea7d4b16869f288bcd639cb9e355",
"score": "0.5479298",
"text": "def start_menu_hide_power_button\n return @start_menu_hide_power_button\n end",
"title": ""
},
{
"docid": "77e7e303c826583e5fb4a2ced660c32f",
"score": "0.542828",
"text": "def resizable?; true; end",
"title": ""
},
{
"docid": "ce811c20c855c8fc7c2577d28633de56",
"score": "0.54189223",
"text": "def maximize!\n ret=WinUser.ShowWindow(hwnd, SW_MAXIMIZE)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "35c7097b9f0bccbd4813a1f38fa976ac",
"score": "0.53721255",
"text": "def on_main_menu\n\t\tadmin.workspace.display\n\tend",
"title": ""
},
{
"docid": "67d522ba30dbf30617919aae3f6c214f",
"score": "0.5344837",
"text": "def on_toggle_zoom\n # Set the zoom value\n @viewport_map.zoom = @viewport_map_cursor.zoom = @viewport_map_zones.zoom = \n @viewport_map_markers.zoom = @zoom = (@zoom == 0.5 ? 1 : 0.5)\n # Correct map display\n @viewport_map.ox *= @zoom\n @viewport_map.oy *= @zoom\n @viewport_map_cursor.ox *= @zoom\n @viewport_map_cursor.oy *= @zoom\n @viewport_map_markers.ox *= @zoom\n @viewport_map_markers.oy *= @zoom\n @viewport_map_zones.ox *= @zoom\n @viewport_map_zones.oy *= @zoom\n end",
"title": ""
},
{
"docid": "d11f91f2d2419e3a6f9d2cab585d1020",
"score": "0.53412974",
"text": "def make_window_menu( nsapp, menubar )\n ptr = FFI.find_type(:pointer)\n \n item = Cocoa::NSMenuItem.new.initWithTitle(\"Window\")\n menu = Cocoa::NSMenu.new.initWithTitle(\"Window\")\n item.submenu = menu\n menubar.addItem(item)\n nsapp.msg(\"setWindowsMenu:\", ptr, menu)\n \n menu.addItemWithTitle(\"Minimize\", \"performMiniaturize:\")\n \n item.release\n menu.release\n end",
"title": ""
},
{
"docid": "400b259fb185cc59a830fdd92b7d7d58",
"score": "0.5340114",
"text": "def updated()\n window.onresize()\n end",
"title": ""
},
{
"docid": "3bbd60b16ec3cb8727e1fa10c265da0d",
"score": "0.5321205",
"text": "def local_window; end",
"title": ""
},
{
"docid": "3bbd60b16ec3cb8727e1fa10c265da0d",
"score": "0.5321205",
"text": "def local_window; end",
"title": ""
},
{
"docid": "9bc736499d8d80d4d414ea2415f4ed1c",
"score": "0.53053135",
"text": "def maximize() \n @driver.sc_window_maximize\n end",
"title": ""
},
{
"docid": "a44cf7fd7c9dfc0a9fad9176e0d2bf37",
"score": "0.5296234",
"text": "def toggle_size\n w, h = Graphics.width, Graphics.height\n @tiny_window ? resize_window(w, h) : resize_window(w / 2, h / 2)\n @tiny_window = !@tiny_window\n end",
"title": ""
},
{
"docid": "0b69fc38f2a9615a31f164b0a5f025ab",
"score": "0.52860576",
"text": "def hide_windows\n end",
"title": ""
},
{
"docid": "54d0df1e7d93c567f1e8c382053fb35c",
"score": "0.5283306",
"text": "def windows; end",
"title": ""
},
{
"docid": "54d0df1e7d93c567f1e8c382053fb35c",
"score": "0.5283306",
"text": "def windows; end",
"title": ""
},
{
"docid": "9bcb27ba435965cb30ffdd9bfe812fd3",
"score": "0.5280958",
"text": "def start_menu_hide_shut_down\n return @start_menu_hide_shut_down\n end",
"title": ""
},
{
"docid": "77cdaa074ff778e46bd71e2563844cd1",
"score": "0.52754253",
"text": "def minimized?\n wait_until_present\n @window.minimized?\n end",
"title": ""
},
{
"docid": "45bdff648602d5de3000bfd956c2c3bc",
"score": "0.5274746",
"text": "def gtk_window\n @gtk_expander\n end",
"title": ""
},
{
"docid": "4095850964bf5487b6bbc0bbe32851dc",
"score": "0.52719635",
"text": "def show_windows\n end",
"title": ""
},
{
"docid": "73f18d23c971558875c953fb0b130b43",
"score": "0.52664346",
"text": "def reset_zoom\r\n @window.zoom = 1\r\n reset_cursor_pos if @cursor_sprite\r\n reset_pause_pos if @pause_sprite\r\n end",
"title": ""
},
{
"docid": "1c79420d37308c4c7d9a289b1555cb2f",
"score": "0.52663153",
"text": "def minimize; end",
"title": ""
},
{
"docid": "233691e280f06ab3c2c87d10926c1b89",
"score": "0.52538943",
"text": "def main_window ; end",
"title": ""
},
{
"docid": "63d54ee78b41de169975776b3bb44128",
"score": "0.5232269",
"text": "def hide_confirm_window\n @alchemy_window.close\n @item_window.smooth_move(0, @item_window.y)\n @mp_window.smooth_move(0, @mp_window.y)\n @mats_window.smooth_move(Graphics.width / 2, @mats_window.y)\n @details_window.smooth_move(Graphics.width / 2, @mats_window.bottom_corner)\n @item_window.activate\n end",
"title": ""
},
{
"docid": "1a01f4a4fe1cdd86e9be2374e9e912d2",
"score": "0.5216237",
"text": "def update_vista(jump = false)\n hide_windows unless jump\n show_selected_window\n end",
"title": ""
},
{
"docid": "6a8bd91b6e24e6f6a66e42e2e544d9a7",
"score": "0.5211341",
"text": "def is_minimized\n if attributes[\"is_minimized\"].nil?\n return false\n else\n attributes[\"is_minimized\"]\n end\n end",
"title": ""
},
{
"docid": "c9c6ccf4ff200a5f2010aa06b644a5a3",
"score": "0.52004945",
"text": "def handle_bad_thresh\n\t\t@asm_op.set_menu(:yn_fix_thresh)\n\tend",
"title": ""
},
{
"docid": "761afd6108c7c8c0d0c16ea5d1d72beb",
"score": "0.51909196",
"text": "def hide_info?\n @window_width < 81\n end",
"title": ""
},
{
"docid": "fee9b33751cfd2855bbd3947d1edfc85",
"score": "0.5186819",
"text": "def fullscreen; end",
"title": ""
},
{
"docid": "a33f648482349b7e9f3692dfb8b4dd77",
"score": "0.5185563",
"text": "def start_menu_hide_hibernate\n return @start_menu_hide_hibernate\n end",
"title": ""
},
{
"docid": "e884df07d9a6bf175be70001b425070b",
"score": "0.5182351",
"text": "def on_open_location(menu)\n create_window unless main_papernet_window\n main_papernet_window.focus_location_bar\n end",
"title": ""
},
{
"docid": "1b5c2a787c7b0fa7516c875d12bd55bb",
"score": "0.5177602",
"text": "def show_maximized!\n ret=WinUser.ShowWindow(hwnd, SW_SHOWMAXIMIZED)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "e67e3a881d17cfa8625bda954a12668b",
"score": "0.5168028",
"text": "def restore; set_window_state :SW_RESTORE; end",
"title": ""
},
{
"docid": "73ac308a6737a09467591eb4440df6b0",
"score": "0.5167856",
"text": "def tools_menu()\n # Nothing\n end",
"title": ""
},
{
"docid": "ea4227e953702bf5961b4bdfd4138be6",
"score": "0.5165549",
"text": "def start_menu_hide_restart_options\n return @start_menu_hide_restart_options\n end",
"title": ""
},
{
"docid": "8cc70d734dc6266d8a600d814048316d",
"score": "0.514349",
"text": "def start_menu_hide_frequently_used_apps\n return @start_menu_hide_frequently_used_apps\n end",
"title": ""
},
{
"docid": "9da437ced7050ae30e919981466bea6a",
"score": "0.5131837",
"text": "def start_menu_hide_lock\n return @start_menu_hide_lock\n end",
"title": ""
},
{
"docid": "f0e0b233ce961a690a9961996a024da8",
"score": "0.5129758",
"text": "def maximize_browser\n @browser.window_maximize\n return true\n end",
"title": ""
},
{
"docid": "904b45c10dac5bbc3fe0202debdf938b",
"score": "0.5107113",
"text": "def show_target_window(right)\n @item_window.active = false\n @target_window.x = 0 - @target_window.width\n @viewport.smooth_move(@target_window.width, 0)\n @target_window.smooth_move(0, 0)\n @target_window.visible = true\n @target_window.active = true\n #if @item_popup\n @item_popup.set_item(@item_window.item)\n @item_popup.visible = true\n @item_popup.x = 10\n #end\n end",
"title": ""
},
{
"docid": "e8c6b0b2bdc5d648d75d3bfc6bc84d5c",
"score": "0.5094062",
"text": "def enter_xon_mode\n Kernel.raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6896435cd4b587dbeda8382de9761425",
"score": "0.5093459",
"text": "def maximize() \n exec_driver_in_context do |driver|\n driver.sc_window_maximize\n end\n end",
"title": ""
},
{
"docid": "5b336d7599289863432dca4d1c7cef07",
"score": "0.5084832",
"text": "def restore; set_window_state (:SW_RESTORE); end",
"title": ""
},
{
"docid": "2011feb2f407b012d5ba810553aeb2c3",
"score": "0.50656563",
"text": "def show_min_no_active!\n ret=WinUser.ShowWindow(hwnd, SW_SHOWMINNOACTIVE)\n ret != WIN_FALSE\n end",
"title": ""
},
{
"docid": "63e4296232755a78bcc5522fb32a5ee8",
"score": "0.50640893",
"text": "def windows?; end",
"title": ""
},
{
"docid": "63e4296232755a78bcc5522fb32a5ee8",
"score": "0.50640893",
"text": "def windows?; end",
"title": ""
},
{
"docid": "63e4296232755a78bcc5522fb32a5ee8",
"score": "0.50640893",
"text": "def windows?; end",
"title": ""
},
{
"docid": "63e4296232755a78bcc5522fb32a5ee8",
"score": "0.50640893",
"text": "def windows?; end",
"title": ""
},
{
"docid": "fe8e1f1aaead530c2ad8e687811500ee",
"score": "0.50537413",
"text": "def onMButtonDoubleClick(flags, x, y, view)\n MSPhysics::ControlPanel.bring_to_front unless AMS::IS_PLATFORM_WINDOWS\n end",
"title": ""
},
{
"docid": "5d931a90d1c3a5f5e7170535c066e0c9",
"score": "0.50317955",
"text": "def tramplesMinimize?(_param=1); return false; end",
"title": ""
},
{
"docid": "df5bea7c51338b3662ec3913bc035364",
"score": "0.50168514",
"text": "def remove_active_hint\n values = ary2pary([0]);\n \n XCB::change_window_attributes(manager.connection, get_window.id, XCB::CW_BORDER_PIXEL, values); \n XCB::flush(manager.connection) \n \n get_window.configure(XCB::CONFIG_WINDOW_BORDER_WIDTH, ary2pary([0])); \n end",
"title": ""
},
{
"docid": "074733a269178516d04d273c498f576d",
"score": "0.5002379",
"text": "def window_restored\n end",
"title": ""
},
{
"docid": "c36ccb63a31ed03f57e934d36ea0086f",
"score": "0.49919644",
"text": "def minimize\n Marshal.load(Marshal.dump(self)).minimize!\n end",
"title": ""
},
{
"docid": "a1cc9c041ce5f922254ed45872d039c5",
"score": "0.49862686",
"text": "def set_event_popup\n RXtAddEventHandler(@parent, RButtonPressMask, false,\n lambda do |w, c, i, f|\n if Rbutton(i) == 3\n if @before_popup_hook.run_hook_bool(w, c, i)\n RXmMenuPosition(@menu, i)\n RXtManageChild(@menu)\n end\n end\n end)\n end",
"title": ""
},
{
"docid": "342458c96c12a38c8e1dfa177b35a92b",
"score": "0.49806875",
"text": "def on_options_activate\n\t\t MsfPreferences::Main.new()\n\t end",
"title": ""
},
{
"docid": "4f4557b7f767591096311b45ca83ac0a",
"score": "0.4978106",
"text": "def start_menu_hide_change_account_settings\n return @start_menu_hide_change_account_settings\n end",
"title": ""
}
] |
22100eccafb4716fe1fb18863a5ad786
|
Accept a membership request (instance method).
|
[
{
"docid": "4a20ca9c4acf83b6b8cf11db0e72f650",
"score": "0.63214767",
"text": "def accept\n Membership.accept(dog_id, group_id)\n end",
"title": ""
}
] |
[
{
"docid": "abb601c646a8db876a92f2447a50296c",
"score": "0.6846305",
"text": "def accept\n Membership.accept(user_id, group_id)\n end",
"title": ""
},
{
"docid": "c03934ebf5cedfc46b5c2e578dba6d6c",
"score": "0.6297061",
"text": "def accept_invite\n group = Group.find(params[:group_id])\n user = User.find(params[:user_id])\n membership = Membership.find_by_group_id_and_user_id(group, user)\n unless membership.nil?\n membership.update_attributes :acceptance_status => true\n respond_to do |format|\n format.html { redirect_to group_path(group), alert: \"Now member of #{group.name}\" }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to groups_path, alert: \"Not accepted. You have not been invited to the group\" }\n format.json { render json: \"You have not been invited to the group\", status: :forbidden}\n end\n end\n end",
"title": ""
},
{
"docid": "21574d3fc63b07acc33f7f08fe166a7d",
"score": "0.6284275",
"text": "def acceptRequest\n\t\t# Ensure user is logged in to view this page\n\t\tif(session.has_key?(\"logged_in\"))\n\t\t\n\t\t\t# If the user is not logged in redirect to homepage\n\t\t\tif(session['logged_in'] != 1) \n\t\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\t\tend\n\n\t\t\t# Get your user id.\n\t\t\tuserID = session['user_id']\n\n\t\t\t# Person id to accept request\n\t\t\totherID = params[:id]\n\n\t\t\t# Set approved to true.\n\t\t\tCollaboration.find_by(first_id:otherID, second_id:userID).update(approved:true)\n\n\t\t\tredirect_to url_for(:action => :showRequests)\n\t\telse\n\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "adefcae6b0667ee96881d232c82d8eab",
"score": "0.6140711",
"text": "def create_membership_request\n member = Member.new(squad: @squad, user: current_user, membership: 'request')\n member.save(validate: false)\n end",
"title": ""
},
{
"docid": "26c12f7435359f56284ac4dd13458b25",
"score": "0.61261654",
"text": "def accept! = self.user.create_accepted_request",
"title": ""
},
{
"docid": "31fa43e90518eb017411d73a5523fc8d",
"score": "0.612291",
"text": "def membership_params\n params.require(:membership).permit(:user_via_email, :privileges)\n end",
"title": ""
},
{
"docid": "ac25db7a884da84102f97dc1df01a323",
"score": "0.6119637",
"text": "def accept # rubocop:disable Metrics/MethodLength\n respond_to do |format|\n if @member_registration_request.accept(user: current_user)\n format.html { redirect_to admin_room_member_registration_request_path(id: @member_registration_request.id), notice: t('.accepted') }\n format.json { render :show, status: :ok, location: @member_registration_request }\n else\n format.html do\n flash[:alert] = @member_registration_request.errors.full_messages.join(', ')\n render :show\n end\n format.json { render json: @member_registration_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ba04bfa1c6508b6460b5735ae998e95",
"score": "0.6080895",
"text": "def create\n #sanity checks, can only modify memberships that you own\n if params[:user_id].to_i != current_user.id then\n render json: {message:'You do not own the membership list'}, :status => :unprocessable_entity\n return\n end\n\n #ensure the membership params is there\n unless params.has_key? :memberships then\n #render json: {message:'memberships list not found'}, :status => :unprocessable_entity\n #return\n #this could me no membership at all\n params[:memberships] = {}\n end\n\n #set the new memberships state\n current_user.set_memberships params[:memberships]\n\n render json: {\n message:'message received from server',\n memberships:User.find(params[:user_id]).memberships.map{ |x| x.attributes.merge({club_name: x.club_name})}\n }\n end",
"title": ""
},
{
"docid": "865a1342bfd9b9b0b6dddb4ea4734a60",
"score": "0.6019373",
"text": "def accept_invitation\n \n end",
"title": ""
},
{
"docid": "802da973e36899e2aa269be44f9e6609",
"score": "0.5875129",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :year, :type, :stripe_card_token, :subscribe, privileges: [], membership: %i[info]).tap do |allowlisted|\n allowlisted[:info] = params[:membership][:info]\n end\n end",
"title": ""
},
{
"docid": "45b4c6df927c9abeeb4b87a754ee2bbf",
"score": "0.58731216",
"text": "def create\n @membership = Membership.new(params[:membership])\n @membership.member = current_member\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to sub_clubs_path, :notice => 'You requested membership.' }\n format.json { render :json => @membership, :status => :created, :location => @membership }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc02fd8f4855b294544e4f517e94e777",
"score": "0.5858695",
"text": "def friend_request\n\nend",
"title": ""
},
{
"docid": "1292ebe42c2e42ac0744a9a424851dfa",
"score": "0.57892793",
"text": "def accept\n @group_user = GroupUser.find(params[:id])\n @group_user.approve!\n respond_to do |format|\n flash[:notice] = 'Membership was accepted.'\n format.html { redirect_to account_path }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df758d5331a26b5bf3fbc02b21b93bb7",
"score": "0.5786208",
"text": "def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\n end",
"title": ""
},
{
"docid": "46851620b2e92f53f924c923db9a8a5a",
"score": "0.5764939",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "5524b68e9d5f846f102b2dd11c6f11e2",
"score": "0.5746912",
"text": "def membership_params\n params.require(:membership).permit(:is_admin, :remote_uid)\n end",
"title": ""
},
{
"docid": "5524b68e9d5f846f102b2dd11c6f11e2",
"score": "0.5746912",
"text": "def membership_params\n params.require(:membership).permit(:is_admin, :remote_uid)\n end",
"title": ""
},
{
"docid": "6ac46e42827e3eff863c6c9d41a9a12d",
"score": "0.57421076",
"text": "def accept\n @card = Card[params[:card][:key]] or raise(Wagn::NotFound, \"Can't find this Account Request\") #ENGLISH\n @user = @card.extension or raise(Wagn::Oops, \"This card doesn't have an account to approve\") #ENGLISH\n System.ok?(:create_accounts) or raise(Wagn::PermissionDenied, \"You need permission to create accounts\") #ENGLISH\n \n if request.post?\n @user.accept(params[:email])\n if @user.errors.empty? #SUCCESS\n redirect_to (System.setting('*invite+*thanks') || '/')\n return\n end\n end\n render :action=>'invite'\n end",
"title": ""
},
{
"docid": "47b025f66e73a307ed5a2727697f79d7",
"score": "0.56850326",
"text": "def create\n\t\t@membership = Membership.new(params[:membership])\n\n\t\trespond_to do |format|\n\t\t\tif @membership.save\n\t\t\t\tformat.html { redirect_to(@membership, :notice => 'Membership was successfully created.') }\n\t\t\t\tformat.xml\t{ render :xml => @membership, :status => :created, :location => @membership }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml\t{ render :xml => @membership.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d73e5f1e9516b83ed1da1dbeb5528d72",
"score": "0.56698436",
"text": "def accept_invite(requestor_id)\n respond_to_invite(requestor_id, true)\n end",
"title": ""
},
{
"docid": "c7b0bcca0d9b5a453cd6c85420505d89",
"score": "0.5637724",
"text": "def approve_join_request\n join_request = JoinRequest.find(params[:id])\n team = join_request.team\n # Only authorize the captain to do this\n if current_user.id == team.captain_id\n membership = Membership.create(\n team_id: join_request.team_id,\n user_id: join_request.user_id,\n admin: false\n )\n if membership.valid?\n join_request.destroy\n render json: {\n team: TeamSerializer.new(team),\n user: UserSerializer.new(current_user)\n }, status: :accepted\n else\n # invalid request\n render json: {\n message: \"Invalid request\",\n errors: membership.errors.full_messages\n }, status: :not_acceptable\n end\n else\n render json: { message: \"Only the captain is allowed to accept join requests\"}, status: :not_acceptable\n end\n end",
"title": ""
},
{
"docid": "95a7673f7ddf95ca7eaf52c29f943153",
"score": "0.5629103",
"text": "def can_accept?\n SpaceMembershipPolicy.can_accept?(object, space_membership)\n end",
"title": ""
},
{
"docid": "7534598dd9c5727547576eec5f64595f",
"score": "0.5624052",
"text": "def create\n @membership = Adhocracy::Membership.new(membership_params)\n\n if @membership.save\n render json: @membership, status: :created, location: api_v1_membership_path(@membership)\n else\n render_validation_errors @membership.errors\n end\n end",
"title": ""
},
{
"docid": "4a944b3567e93f076481303da0d84e32",
"score": "0.5613713",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :valid_from, :duration, :purchase_date, :cancellation_date, :refund, :price_paid)\n end",
"title": ""
},
{
"docid": "c5e6fe6c5af788c7e2b13f5b9d7a6b08",
"score": "0.56037927",
"text": "def accept_invite(_token)\n # stub\n end",
"title": ""
},
{
"docid": "cf207a4429e96f8d499de1410444836d",
"score": "0.5595642",
"text": "def create\n if MemberRequest.req!(@club, current_user)\n flash[:success] = \"Request Sent!\" \n redirect_to view_club_path(path: @club.path)\n else\n flash[:danger] = 'ERROR: There was an error processing your request'\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "9779e37a57a63b33b5ec6dccd0746d21",
"score": "0.5594051",
"text": "def set_membership\n @membership = Membership.find(params[:id])\n end",
"title": ""
},
{
"docid": "7b17dcd45d02ae42dc59f8d0cf36dd80",
"score": "0.5593955",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :group_id, :email, :title)\n end",
"title": ""
},
{
"docid": "b15c9f2f620f13020468d9187eaf9a96",
"score": "0.5567053",
"text": "def permit\n user = User.find(params[:user_id])\n group = Group.find(params[:id])\n membership = Membership.find_by(user: user, group: group)\n if membership\n membership.update_column(:active, true)\n membership.touch # For showing on dashboard.\n end\n redirect_back fallback_location: '/'\n end",
"title": ""
},
{
"docid": "90c35f3de7e5c903bb214f45c6b28d19",
"score": "0.5565933",
"text": "def membership(unit)\n unit.membership(self)\n end",
"title": ""
},
{
"docid": "5e08f9cea99137df02844b0ad241ac8d",
"score": "0.5564037",
"text": "def create\n # TODO: test if \"user_established_at\" and \"network_established_at\" can be hacked (ie: set) through API calls,\n # thereby creating memberships that are already 'accepted' at creation.\n user = User.find_by_id(params[:membership][:user_id])\n if user.nil?\n render_404(\"User not found.\")\n elsif !Membership.find_by_user_id_and_network_id(params[:membership][:user_id], params[:membership][:network_id]) ||\n Network.find(params[:membership][:network_id]).owner?(user)\n\n @membership = Membership.new(params[:membership])\n\n @membership.user_established_at = nil\n @membership.network_established_at = nil\n if @membership.message.blank?\n @membership.message = nil\n end\n \n respond_to do |format|\n\n if @membership.save\n # Take into account network's new member policy setting\n if (@membership.network.open?)\n @membership.accept!\n \n begin\n user = @membership.user\n network = @membership.network\n Notifier.deliver_auto_join_group(user, network, base_host) if network.administrators(true).any? {|a| a.send_notifications?}\n rescue\n logger.error(\"ERROR: failed to send email notification for auto join group. Membership ID: #{@membership.id}\")\n end\n \n flash[:notice] = 'You have successfully joined the Group.'\n elsif (@membership.network.membership_by_request?)\n @membership.user_establish!\n \n begin\n user = @membership.user\n network = @membership.network\n Notifier.deliver_membership_request(user, network, @membership, base_host) if network.administrators(true).any? {|a| a.send_notifications?}\n rescue Exception => e\n logger.error(\"ERROR: failed to send Membership Request email notification. Membership ID: #{@membership.id}\")\n logger.error(\"EXCEPTION:\" + e)\n end\n \n flash[:notice] = 'Membership was successfully requested.'\n end\n\n format.html { redirect_to user_membership_path(current_user.id, @membership) }\n else\n format.html { render :action => \"new\" }\n end\n end\n else\n respond_to do |format|\n flash[:error] = \"Membership not created (already exists)\"\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "f8baa060ffe3f0bf5557a144ace30b85",
"score": "0.5563728",
"text": "def update\n @membership = Adhocracy::Membership.find(params[:id])\n\n authorize! :manage, @membership\n\n if @membership.update(membership_params)\n head :no_content\n else\n render_validation_errors @membership.errors\n end\n end",
"title": ""
},
{
"docid": "676dfb6d1671d934d9641c16dc11ee4b",
"score": "0.5560635",
"text": "def members_application_received\n# @member = Member.find(params[:id])\n# @products = Product.membership.all\n \n respond_to do |format|\n format.html # show.html.erb\n# format.json { render :json => @member }\n end\n end",
"title": ""
},
{
"docid": "dd6d3576ded534547bbeea92a3e2edb2",
"score": "0.55590916",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :org_guid => HttpClient::Preconditions.assert_class_or_nil('org_guid', HttpClient::Helper.to_uuid(opts.delete(:org_guid)), String),\n :org_key => HttpClient::Preconditions.assert_class_or_nil('org_key', opts.delete(:org_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :role => HttpClient::Preconditions.assert_class_or_nil('role', opts.delete(:role), String),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/membership_requests\").with_query(query).get.map { |hash| Apidoc::Models::MembershipRequest.new(hash) }\n end",
"title": ""
},
{
"docid": "f131ce8c50888c44900d4da17aaaecd8",
"score": "0.5557322",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :stripe_customer_id, :mode, :status, :expiration_date, :stripe_token, :referer_path)\n end",
"title": ""
},
{
"docid": "f3caa52d993c9566b49c35dd95590313",
"score": "0.5525457",
"text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n MessageLog.recent_project_membership_requests(user.try(:person),self).empty?\n end",
"title": ""
},
{
"docid": "8787c2ced45d912b2ddeeb3bc507aa07",
"score": "0.5525106",
"text": "def match(req)\n end",
"title": ""
},
{
"docid": "869b8a0628b80d6283c6f570efc72ab0",
"score": "0.5524977",
"text": "def user_must_own_membership\n # User ID match\n @membership = @user.memberships.find_by(id: params[:id])\n return if @membership && @membership.invite_status != 'left'\n\n alert_and_redirect('Invalid membership or user has left.', login_path, :bad_request)\n end",
"title": ""
},
{
"docid": "c5fc1a7046c792dd91538385b15ed739",
"score": "0.5521798",
"text": "def welcome\n @membership = Membership.find(params['subscription_id'])\n end",
"title": ""
},
{
"docid": "f327b808c5e203b70495bcf5b49926cc",
"score": "0.5508466",
"text": "def set_membership\n @membership = Membership.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "5df055e0da33a4a6a85558ab6658ba30",
"score": "0.5499692",
"text": "def accept_member_to(user_group, user)\n if user_group.is_admin? self\n membership = Membership.find_by_user_group_id_and_user_id(user_group.id, user.id)\n unless membership.blank?\n membership.accepted_at = Time.now\n membership.accepted_by = self\n membership.save!\n return true\n end\n end\n false\n end",
"title": ""
},
{
"docid": "d6f036734e8a9f93a87e1981c516cd8c",
"score": "0.5498869",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end",
"title": ""
},
{
"docid": "b01ac775cb1e5bf54abf45c39f1ae08b",
"score": "0.54938996",
"text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n ProjectMembershipMessageLog.recent_requests(user.try(:person),self).empty?\n end",
"title": ""
},
{
"docid": "cfb6c959ce4504038f0f9102fd366cba",
"score": "0.5491928",
"text": "def add_member\n return unless (request.post? && params[:student_user_name])\n # add member to the group with status depending if group is empty or not\n grouping = Grouping.find(params[:grouping_id])\n @assignment = Assignment.find(params[:id], include: [{groupings: [{student_memberships: :user, ta_memberships: :user}, :group]}])\n student = Student.find_by_user_name(params[:student_user_name])\n if student.nil?\n @error = \"Could not find student with user name #{params[:student_user_name]}\"\n render :error_single\n return\n end\n set_membership_status = grouping.student_memberships.empty? ?\n StudentMembership::STATUSES[:inviter] :\n StudentMembership::STATUSES[:accepted]\n grouping.invite(params[:student_user_name], set_membership_status)\n grouping.reload\n @grouping = construct_table_row(grouping, @assignment)\n end",
"title": ""
},
{
"docid": "842420fd191d043332db0ffe82156cd4",
"score": "0.5491633",
"text": "def show\n\t\t@membership = Membership.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 => @membership }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eeea7385433a1ccd1a7a160c62c085b3",
"score": "0.5485132",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :beer_club_id)\n end",
"title": ""
},
{
"docid": "db21f27051cd8508b2934b998df957f7",
"score": "0.54806596",
"text": "def accept_invitation\n if params[:type] && params[:type]==\"Discussion\"\n @nsu = NonSiteUser.find(params[:id])\n @disc = Discussion.find(@nsu.invitable_id)\n @ud = UserDiscussion.create(:user_id=>@login_user.id, :discussion_id=>@disc.id) if !@login_user.is_discussed?(@disc.id)\n @notice = @ud && @ud.save && @nsu.destroy ? \"You have joined discussion successfully.\" : \"Could not join discussion.\"\n else\n @accept = DiscussionGroupUser.find(params[:id])\n @notice = @accept.update_attribute(:is_member, true)\n end\n\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "380ca1ebdda49acb1f1f34c7dbf529a5",
"score": "0.54755104",
"text": "def accepted_team_member(project, current_user, params)\n @project = project\n @current_user = current_user\n\n team_membership = params[:project][:team_memberships_attributes]['0']\n role = Role.find(team_membership['role_id'])\n member = User.find(team_membership['member_id'])\n percentage = team_membership['percentage']\n\n tokens = {\n 'Role' => role.try(:name),\n 'New Team Member' => member.try(:name),\n 'Percentage' => percentage + '%',\n 'Effective Date' => \"#{params[:accept_member_effective_date][:year]} / #{params[:accept_member_effective_date][:month]} / #{params[:accept_member_effective_date][:day]}\"\n }\n\n user_subject = \"Accept Team Member from #{@current_user.name} for #{@project.book_title}\"\n admin_subject = \"New \" + user_subject\n\n send_email_message('accept_team_member', tokens, get_project_recipient_list(@project), user_subject)\n send_email_message('accept_team_member_admin', tokens, admin_accept_team_member_list, admin_subject)\n end",
"title": ""
},
{
"docid": "f8723069775644665b51e2fa696fc084",
"score": "0.54664826",
"text": "def accept_request\n\t\tuser = current_user\n\n\t\tassignment = Assignment.find_by(request_id: params[:request_id])\n\t\tuser.accepteds << assignment\n\t\taccepted_status = RequestStatus.find_by(description: \"accepted\")\n\t\taccepted_status.assignments << assignment\n\n\t\tredirect_back fallback_location: '/home'\n\tend",
"title": ""
},
{
"docid": "8dcdf5d26b409261082f91ab78b1ce6f",
"score": "0.546288",
"text": "def check_membership\n unless @room.member?(current_user)\n message = 'Unauthorized: you are not a member of this private room.'\n respond_to do |format|\n format.html { redirect_to @room, notice: message }\n format.json { render json: { room: @room, notice: message }, status: :forbidden }\n end\n end\n end",
"title": ""
},
{
"docid": "278b36e6d033d200ea13fd18f867d7d7",
"score": "0.54617035",
"text": "def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end",
"title": ""
},
{
"docid": "28449a38acba4941c9e910471eac8350",
"score": "0.5452639",
"text": "def request_membership_of(user_group)\n Membership.create!(:user => self,\n :admin => false,\n :user_group => user_group)\n end",
"title": ""
},
{
"docid": "d1c402785e9ad7d1f63cb5198c53741c",
"score": "0.54508847",
"text": "def update\n @membership = Membership.find(params[:id])\n auth!\n respond_to do |format|\n if (@membership.can_resign_leadership?(membership_params['level'])) && (@membership.update_attributes(membership_params))\n format.html { redirect_to(edit_group_path(@group), :notice => t(:membership_updated)) }\n format.xml { head :ok }\n else\n format.html { redirect_to @group, :notice => @group.errors }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f115c3b4d83ad2e96f8de5c0c3293e",
"score": "0.544789",
"text": "def update\n\t\t@membership = Membership.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @membership.update_attributes(params[:membership])\n\t\t\t\tformat.html { redirect_to(@membership, :notice => 'Membership was successfully updated.') }\n\t\t\t\tformat.xml\t{ head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml\t{ render :xml => @membership.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e73407c35636581a7d6f5e02f25676d4",
"score": "0.54455197",
"text": "def membership_params\n params.require(:membership).permit(:beer_club_id, :user_id)\n end",
"title": ""
},
{
"docid": "381f2ded203a1db9acad36f7c75c9e01",
"score": "0.5439811",
"text": "def accept\n\tRelationship.where(:accessed_id => params[:id], :accessor_id => params[:request_id]).first.update_attribute(:accepted, true)\n\tredirect_to(requests_user_path(current_user))\n end",
"title": ""
},
{
"docid": "5ced52511aea34f17cb8919bff5a06ce",
"score": "0.543731",
"text": "def accept_resource\n # resource = resource_class.accept_invitation!(update_resource_params)\n # ## Report accepting invitation to analytics\n # Analytics.report('invite.accept', resource.id)\n # resource\n end",
"title": ""
},
{
"docid": "a151b8a0d262895b50e1d50ba6b6d886",
"score": "0.5436755",
"text": "def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end",
"title": ""
},
{
"docid": "2c3ddf96277e0fd3e086df420e894667",
"score": "0.5435529",
"text": "def do_accept\n InviteRequest.clear_pending_request_activities(self.user, self.wants_to_join)\n end",
"title": ""
},
{
"docid": "121763e07b03afc7aceda097a96c7e6e",
"score": "0.5428813",
"text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n MessageLog.recent_project_membership_requests(user.try(:person),self).empty?\n end",
"title": ""
},
{
"docid": "a32f1c3d3b425cb675a5a111e041177f",
"score": "0.5427359",
"text": "def membership_params\n params.require(:membership).permit(:teacher, :nickname)\n end",
"title": ""
},
{
"docid": "9b08a6471bea56bb33108f52757c82ff",
"score": "0.54273427",
"text": "def membership_params\n params.require(:membership).permit(:gym_id, :client_id, :charge)\n end",
"title": ""
},
{
"docid": "dd66ebcdf721c47ac6b6e9416f98ae5a",
"score": "0.5425972",
"text": "def create\n @user = GetUserInfo.run(membership_params)\n if @user == :no_github_user\n session[:new_member_msg] = :no_github_user\n session[:new_member_id] = membership_params['nickname']\n redirect_to class_group_memberships_url\n return\n end\n if membership_params['teacher'] == 'on'\n kind = 'teacher'\n else \n kind = 'student'\n end\n @membership = Membership.new(\n user_id: @user.id,\n kind: kind,\n class_group_id: @class_group.id)\n respond_to do |format|\n if @membership.save\n session[:new_member_msg] = :successful_save\n session[:new_member_id] = @user.id\n format.html { redirect_to class_group_memberships_url, notice: 'Membership was successfully created.' }\n format.json { render :show, status: :created, location: @membership }\n else\n format.html { render :new }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e541b7717e1d43800aca2f6a2fc1fed3",
"score": "0.5424235",
"text": "def invite_member\n @organization = MnoEnterprise::Organization.find(params[:id])\n\n # Find or create a new user - We create it in the frontend as MnoHub will send confirmation instructions for newly\n # created users\n user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirmed_user(user_params)\n\n # Create the invitation\n invite = @organization.org_invites.create(\n user_email: user.email,\n user_role: params[:user][:role],\n referrer_id: current_user.id,\n status: 'staged' # Will be updated to 'accepted' for unconfirmed users\n )\n\n @user = if user.confirmed?\n invite.accept!(user)\n invite.reload\n else\n user.reload\n end\n end",
"title": ""
},
{
"docid": "756a8e914c9327b4b0d6e833f900d2aa",
"score": "0.5417602",
"text": "def invite\n \n end",
"title": ""
},
{
"docid": "0a929636d8190b46a8de15194938bc3d",
"score": "0.541425",
"text": "def membership(user)\n memberships.find_by_user_id(user.id)\n end",
"title": ""
},
{
"docid": "17159a619c540cb6185d50e3eae84203",
"score": "0.5398547",
"text": "def memberships options = {}\n request = if options.delete(:recursive) == false\n options[\"memberships\"] = true\n else\n options[\"all\"] = true\n end\n if filter = options.delete(:filter)\n filter = [filter] unless filter.is_a?(Array)\n options[\"filter\"] = filter.map(&Id.method(:new))\n end\n\n result = JSON.parse(rbac_role_resource[options_querystring options].get)\n if result.is_a?(Hash) && ( count = result['count'] )\n count\n else\n host = Conjur.configuration.core_url\n result.collect do |item|\n if item.is_a?(String)\n build_object(item, default_class: Role)\n else\n RoleGrant.parse_from_json(item, self.options)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8f655f4671366ed59885a8a4f88b2228",
"score": "0.5385922",
"text": "def membership_params\n params.require(:membership).permit(:creator_id, :user_id, :belongable_id, :belongable_type, :scope, :state)\n end",
"title": ""
},
{
"docid": "7b7b18ed1045fc889e60b99db2b9f3fe",
"score": "0.538265",
"text": "def user_params\n params.require(:membership).permit(:user_id, :email, :id)\n end",
"title": ""
},
{
"docid": "f52c32fd07c51f089905ef69311ac73e",
"score": "0.5376859",
"text": "def accept\n Connection.accept(user_id, contact_id)\n end",
"title": ""
},
{
"docid": "782449e28a9c62792dce93fc0ad55fb7",
"score": "0.53763264",
"text": "def update!(**args)\n @membership = args[:membership] if args.key?(:membership)\n end",
"title": ""
},
{
"docid": "782449e28a9c62792dce93fc0ad55fb7",
"score": "0.53763264",
"text": "def update!(**args)\n @membership = args[:membership] if args.key?(:membership)\n end",
"title": ""
},
{
"docid": "5e94501d89961f85efbbf003de37cb90",
"score": "0.53708273",
"text": "def update\n respond_to do |format|\n if @membership.update(membership_params)\n format.html { redirect_to @member, notice: 'Membership was successfully updated.' }\n format.json { render :show, status: :ok, location: @membership }\n else\n format.html { render :edit }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70a2fb73c56f640650f16adc9e52c099",
"score": "0.53651816",
"text": "def handle_incoming_invite(*args); false; end",
"title": ""
},
{
"docid": "cf053a6e97571ccab9613a7546e4db62",
"score": "0.5364121",
"text": "def accept_request\n friendship = Friend.find(params[:request_id])\n\t if friendship\n\t\t friendship.accepted = true\n\t\t friendship.save\n\t\t render text: friendship.id\n\t else\n\t\t render text: '-1'\n end\n end",
"title": ""
},
{
"docid": "289027b62a87686808127a8ebc5627ac",
"score": "0.535832",
"text": "def match_to_invitation_or_send_email\n if invitation = joinable.membership_invitation_for(user)\n invitation.accept(invitation.user)\n else\n UserMailer.project_membership_request_created_email(joinable.who_can?(:manage), self).deliver\n end\n end",
"title": ""
},
{
"docid": "fae3c23e238fb45f6531bb836a4c99cf",
"score": "0.5355748",
"text": "def create\n @membership = Membership.where(user_id: params[:membership][:user_id], group_id: params[:group_id]).first_or_create\n\n if params[:autoconfirm] || current_user.is_admin?\n @membership.update_attributes(level: Membership::LEVELS[:regular])\n else\n @membership.update_attributes(level: Membership::LEVELS[:pending])\n end\n\n @membership.perms[:screen] = params[:screen]\n @membership.perms[:feed] = params[:feed]\n\n auth!\n\n respond_to do |format|\n if @membership.save\n process_notification(@membership, {}, process_notification_options({\n params: {\n level: @membership.level_name,\n member_id: @membership.user.id,\n member_name: @membership.user.name,\n group_id: @membership.group.id,\n group_name: @membership.group.name\n },\n recipient: @membership.group}))\n if can? :update, @group\n format.html { redirect_to(manage_members_group_path(@group), notice: t(:membership_created)) }\n else\n format.html { redirect_to(group_path(@group), notice: t(:membership_applied_for)) }\n end\n format.xml { render xml: @group, status: :created, location: @group }\n else\n if can? :update, @group\n format.html { redirect_to manage_members_group_path(@group) }\n else\n format.html { redirect_to group_path(@group) }\n end\n format.xml { render xml: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42aee07dbf3dee45919ab15932bcfb24",
"score": "0.53518605",
"text": "def membership_params\n params.require(:membership).permit(:user_id, :beer_club_id)\n end",
"title": ""
},
{
"docid": "ed56fa8e55f0698ed75a194e8012cba5",
"score": "0.5346938",
"text": "def accepted\n FriendRequestNotifier.accepted\n end",
"title": ""
},
{
"docid": "07e687b19b2cd72fc033bf2ee3e6e1fb",
"score": "0.5343903",
"text": "def memberships\n @list.client.get(\"#{url}/memberships\")\n end",
"title": ""
},
{
"docid": "e738158a932f612cb26ee20d3cd9c6f0",
"score": "0.5336044",
"text": "def create\n @membership = Membership.find_or_create_by_user_id_and_group_id(params[:membership][:user_id], params[:group_id])\n\n if params[:autoconfirm]\n @membership.update_attributes(:level => Membership::LEVELS[:regular])\n else\n @membership.update_attributes(:level => Membership::LEVELS[:pending])\n end\n \n auth!\n\n respond_to do |format|\n if @membership.save\n process_notification(@membership, {:level => @membership.level_name, :adder => current_user.id}, :action => 'create', :owner => @membership.user, :recipient => @membership.group)\n format.html { redirect_to(edit_group_path(@group), :notice => t(:membership_created)) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { redirect_to @group }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "203c7b83f194b72e56fec9c3d6716e2c",
"score": "0.53322804",
"text": "def invite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n @user = if params[:user_id]\n User.find(params[:user_id])\n else\n User.find_by(name: params[:user_name])\n end\n @meal.invite_user @user\n redirect_to @meal\n end",
"title": ""
},
{
"docid": "62f280697c003cf4aee3626ab227aeeb",
"score": "0.532866",
"text": "def membership_params\n params[:membership][:community_id] = @community.id\n throw \"Not a superadmin!\" if params[:membership][:role_id] == Membership::ADMIN unless check_super_admin\n params.require(:membership).permit(:user_id, :community_id, :role_id, :application_info, :notes)\n end",
"title": ""
},
{
"docid": "7f18e84ed28dc7578c054e924aae5970",
"score": "0.5326604",
"text": "def members\n set_group \n @members = User.joins(:groups).where(\"group_id = ? and acceptance_status = ?\", params[:id], true) if GroupsController.group_member? current_user.id, params[:id]\n end",
"title": ""
},
{
"docid": "8eed4ff2a4be1615031deec2b94d2417",
"score": "0.53184706",
"text": "def confirm_members\n ur = UserReservation.find(params[:user_reservation_id])\n\n #need to check the current user owns the reservation\n\n if ur.check_outstanding.zero? then\n ur.reservation_confirmed!\n else\n ur.payment_attempted!\n end\n\n render json: {message:\"Members Verified for #{ur.id}\", user_reservation:ur}\n\n end",
"title": ""
},
{
"docid": "c781434d8e842809f7ebfe28de4f81aa",
"score": "0.531821",
"text": "def accept_resource\n resource_class.accept_invitation!(update_resource_params)\n ## Report accepting invitation to analytics\n \n end",
"title": ""
},
{
"docid": "17d448ba5d338d4751333a18a82b6173",
"score": "0.53144217",
"text": "def post(hash)\n HttpClient::Preconditions.assert_class('hash', hash, Hash)\n @client.request(\"/membership_requests\").with_json(hash.to_json).post { |hash| Apidoc::Models::MembershipRequest.new(hash) }\n end",
"title": ""
},
{
"docid": "f4c8dc8c90e8e82089fd603d566569d5",
"score": "0.531171",
"text": "def update\n respond_to do |format|\n if @membership.update(membership_params)\n format.html { redirect_to @membership, notice: \"Membership was successfully updated.\" }\n format.json { render :show, status: :ok, location: @membership }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e6bb9cfc668d8a7c347ce71edf5f046",
"score": "0.52925235",
"text": "def create\n @membership = @member.memberships.build(membership_params)\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership.member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @membership }\n else\n format.html { render :new }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3adeff0ea61ecd511ee944c8f1d220e9",
"score": "0.5281053",
"text": "def create\n @membership = Membership.new(membership_params)\n @membership.user = current_user\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to beer_club_path(@membership.beer_club_id), notice: current_user.username + \", your application needs to be confirmed by some member.\" }\n format.json { render :show, status: :created, location: @membership }\n else\n @beer_clubs = BeerClub.all.reject{ |b| b.members.include? current_user }\n format.html { render :new }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26cdb0cdca7deca850c349e532f53e53",
"score": "0.52792966",
"text": "def membership\n @user = Person.find(params[:user_id])\n if request.post?\n @group.people << @user\n respond_to do |format|\n format.js { render :partial => \"user\", :object => @user }\n end\n elsif request.delete?\n @group.people.delete(@user)\n respond_to do |format|\n format.js { render :nothing => true } # TODO check if successfully deleted\n end\n end\n end",
"title": ""
},
{
"docid": "6ac0c0bd84efa749d71bb5f74fcaebc2",
"score": "0.5275038",
"text": "def update\n @membership ||= Membership.find(params[:id])\n\n respond_to do |format|\n if @membership.update_attributes(params[:membership])\n format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
5035354e31682d8ed0baf528ed344c56
|
Returns a string representing this marker Used by the Map when building url.
|
[
{
"docid": "e50a603f7c432170afddf6d14dcd2117",
"score": "0.0",
"text": "def options_to_url_params # :nodoc:\n params = DEFAULT_OPTIONS.keys.map(&:to_s).sort.inject([]) do |params, attr|\n primary_getter = \"#{attr}_to_be_used_in_param\"\n secondary_getter = attr\n\n value = send(primary_getter) rescue send(secondary_getter)\n params << \"#{attr}:#{URI::DEFAULT_PARSER.escape(value.to_s)}\" unless value.nil?\n params\n end\n\n params.join('|')\n end",
"title": ""
}
] |
[
{
"docid": "081ff5610f904f4b7e0c16d575ddac57",
"score": "0.7030308",
"text": "def gen_marker(marker)\n marker.lat object.latitude\n marker.lng object.longitude\n link = h.link_to object.title, object\n info = \"#{link}<br>#{short_details}\"\n marker.infowindow info\n end",
"title": ""
},
{
"docid": "88d6998b807bea8f338c920d76bef0ba",
"score": "0.6922831",
"text": "def maps_marker\n \"&markers=color:green%7C#{place[:latitude]},#{place[:longitude]}\"\n end",
"title": ""
},
{
"docid": "c1c2aafbc6c9d8f709983c21c1998863",
"score": "0.6815593",
"text": "def to_s; @url; end",
"title": ""
},
{
"docid": "714033da0a8834f45826ee4a254f419f",
"score": "0.6713539",
"text": "def to_s\n url\n end",
"title": ""
},
{
"docid": "a761933e9ef35c5873bbf39a8a4031ea",
"score": "0.67106897",
"text": "def to_s\n \"#{self.class}#url: #{url}\"\n end",
"title": ""
},
{
"docid": "7c1846a613d547310a101769fb82ab99",
"score": "0.6656837",
"text": "def to_s\n\t\turl.to_s\n\tend",
"title": ""
},
{
"docid": "e057accf2f31a9e7a0e4499d58e8471e",
"score": "0.6574144",
"text": "def to_s\n @url\n end",
"title": ""
},
{
"docid": "8c8d25c4480585c40998e1ac35ffebd5",
"score": "0.65482354",
"text": "def to_s\n url\n end",
"title": ""
},
{
"docid": "c4292b08cdb84254c9c2f5f8b896c798",
"score": "0.6468641",
"text": "def url\n map_datum.url.split(\"?\").first\n end",
"title": ""
},
{
"docid": "880933b8c3d269bfc073b6ce074c9609",
"score": "0.64657277",
"text": "def to_s\n location\n end",
"title": ""
},
{
"docid": "500d05446c6854156c920c6f6db2ab51",
"score": "0.64573455",
"text": "def activity_map_url\n url = \"http://maps.google.com/maps/api/staticmap?\"\n parts = []\n\n stops =\n activity.map do |act|\n CGI::escape(act.location.address.to_s)\n end.uniq.reverse\n\n path_parts = []\n path_parts << \"path=color:0x0000ff\"\n path_parts << \"weight:5\"\n stops.each { |addy| path_parts << addy }\n parts << path_parts.join('|')\n\n origin = stops.shift\n last = stops.pop\n\n parts << \"markers=color:red|size:mid|#{origin}\" if origin\n parts << \"markers=color:green|#{last}\"\n\n parts << 'size=512x512'\n parts << 'maptype=roadmap'\n parts << 'sensor=false'\n url += parts.join('&')\n url\n end",
"title": ""
},
{
"docid": "500d05446c6854156c920c6f6db2ab51",
"score": "0.64573455",
"text": "def activity_map_url\n url = \"http://maps.google.com/maps/api/staticmap?\"\n parts = []\n\n stops =\n activity.map do |act|\n CGI::escape(act.location.address.to_s)\n end.uniq.reverse\n\n path_parts = []\n path_parts << \"path=color:0x0000ff\"\n path_parts << \"weight:5\"\n stops.each { |addy| path_parts << addy }\n parts << path_parts.join('|')\n\n origin = stops.shift\n last = stops.pop\n\n parts << \"markers=color:red|size:mid|#{origin}\" if origin\n parts << \"markers=color:green|#{last}\"\n\n parts << 'size=512x512'\n parts << 'maptype=roadmap'\n parts << 'sensor=false'\n url += parts.join('&')\n url\n end",
"title": ""
},
{
"docid": "500d05446c6854156c920c6f6db2ab51",
"score": "0.64573455",
"text": "def activity_map_url\n url = \"http://maps.google.com/maps/api/staticmap?\"\n parts = []\n\n stops =\n activity.map do |act|\n CGI::escape(act.location.address.to_s)\n end.uniq.reverse\n\n path_parts = []\n path_parts << \"path=color:0x0000ff\"\n path_parts << \"weight:5\"\n stops.each { |addy| path_parts << addy }\n parts << path_parts.join('|')\n\n origin = stops.shift\n last = stops.pop\n\n parts << \"markers=color:red|size:mid|#{origin}\" if origin\n parts << \"markers=color:green|#{last}\"\n\n parts << 'size=512x512'\n parts << 'maptype=roadmap'\n parts << 'sensor=false'\n url += parts.join('&')\n url\n end",
"title": ""
},
{
"docid": "013a1f7df04ea3a8402dba7ea6f86e9c",
"score": "0.6439004",
"text": "def map_key\n return \"#{SEARCH_URL}#{self.address.split.join(\"+\")}&zoom=15&size=550x300&markers=size:mid%=color:red%7Clabel:H%7C#{self.address.split.join(\"+\")}&sensor=true_or_false&key=#{ENV[\"GOOGLE_MAPS_API_KEY\"]}\"\n end",
"title": ""
},
{
"docid": "67b7653d8ec8b4483ee52b28dfa844d8",
"score": "0.6420655",
"text": "def to_s\n @location\n end",
"title": ""
},
{
"docid": "67b7653d8ec8b4483ee52b28dfa844d8",
"score": "0.6420655",
"text": "def to_s\n @location\n end",
"title": ""
},
{
"docid": "80bbcff41007d25a91cce57813f0a977",
"score": "0.6406647",
"text": "def url\n @url.to_s\n end",
"title": ""
},
{
"docid": "767b5da6cc752eb678a2f23196030eb9",
"score": "0.63960546",
"text": "def getUrl()\n url = 'http://maps.google.com/staticmap'\n url += '?center=' + @geoCenter.to_s\n url += '&key=' + @apiKey.to_s\n url += '&format=' + @imageFormat.to_s\n url += '&maptype=' + @type.to_s\n url += '&hl=' + @language.to_s if @language != nil\n url += '&span=' + @geoSpan.to_s if @geoSpan != nil\n url += '&zoom=' + @zoom.to_s if @zoom != nil\n url += '&size=' + @imageSize.to_s if @imageSize != nil\n url += '&sensor=' + (@sensor ? 'true' : 'false') if @sensor != nil\n url\n end",
"title": ""
},
{
"docid": "62a4f125e64a477523a143f6f468145e",
"score": "0.6377352",
"text": "def map_marker\n=begin\n kita_icon = GIcon.new(:image => \"/images/red-dot.png\",\n :shadow => \"/images/shadow.png\",\n :shadow_size => GSize.new(49,32),\n :icon_anchor => GPoint.new(16,32))\n=end\n GMarker.new([self.lat, self.lng], :title => \"#{self.name}\", :info_window => \"\n <p> <b>#{self.name}</b><br />#{self.street}<br />#{self.country_code}-#{self.zip} #{self.city} </p>\n <p><a href='/kitas/#{self.id}'>Mehr Details...</a></p>\n \")\n end",
"title": ""
},
{
"docid": "cf2fdcd688c7fcda8a7aa4bcdc8e75a0",
"score": "0.6325459",
"text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, url.to_s)\n end",
"title": ""
},
{
"docid": "cf2fdcd688c7fcda8a7aa4bcdc8e75a0",
"score": "0.6325459",
"text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, url.to_s)\n end",
"title": ""
},
{
"docid": "22d514c1041dcf31001d51a326c84fa7",
"score": "0.6319508",
"text": "def url\n \[email protected]_s\n end",
"title": ""
},
{
"docid": "3633bb74b430cc397ee0e7998eab8fbf",
"score": "0.62769353",
"text": "def to_s\n \"#{self.name} => #{self.link}\"\n end",
"title": ""
},
{
"docid": "788cd51805d996705deacf14c3828141",
"score": "0.62728053",
"text": "def to_s\n \"#<\" + self.class.name + \": \" + href + \">\"\n end",
"title": ""
},
{
"docid": "50678c9d09bd025430e82cb06b8d783b",
"score": "0.6193698",
"text": "def gmaps4rails_marker_picture\n {\n \"rich_marker\" => \"<div class='my-marker'>It works!<img height='30' width='30' src='http://farm4.static.flickr.com/3212/3012579547_097e27ced9_m.jpg'/></div>\"\n }\nend",
"title": ""
},
{
"docid": "934275705b2d46290ae6cdd15df2b7d2",
"score": "0.61883825",
"text": "def inspect\n sprintf(\"#<%s:%#0x URI:%s>\", URI.to_s, self.object_id, self.to_s)\n end",
"title": ""
},
{
"docid": "3c4646c44d3e3e71ad920e7c90533dd3",
"score": "0.61853904",
"text": "def to_s\n \"#{identity} (#{latitude}; #{longitude})\"\n end",
"title": ""
},
{
"docid": "7eef742b353fc65011532b8b783ffaac",
"score": "0.6182243",
"text": "def url\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "7eef742b353fc65011532b8b783ffaac",
"score": "0.6182243",
"text": "def url\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "746b2eb73826dc1ba3017ad412d7f1b0",
"score": "0.6181026",
"text": "def inspect\n return sprintf(\n \"#<%s:%#0x URI:%s>\",\n self.class.to_s, self.object_id, self.uri.to_s\n )\n end",
"title": ""
},
{
"docid": "cd23802bd96cc7bd6f6234d0326b701e",
"score": "0.6162599",
"text": "def location_s\n self.location.to_s\n end",
"title": ""
},
{
"docid": "9f5560bc91c803e05a5424255841e2fe",
"score": "0.6137548",
"text": "def gmap_location\n # URI.escape([self.address,self.address2,self.city_name,self.region_code,self.postalcode,self.country.name].compact.join(' '))\n [self.address,self.region_name,self.postalcode].compact.join(' ')\n end",
"title": ""
},
{
"docid": "0e399de021211bb4f9a3b16267cf8b1c",
"score": "0.61205304",
"text": "def to_s\n uri.to_s\n end",
"title": ""
},
{
"docid": "45f971a8f0633bf50fa7b983852537c5",
"score": "0.61150604",
"text": "def to_s\n self.uri.to_s\n end",
"title": ""
},
{
"docid": "a46ab7c0128257ada36971a557ff834e",
"score": "0.6110088",
"text": "def gmaps4rails_infowindow\n \"<div class='location-infobox'> <a href=/locations/#{location.id}>#{name}</a> <p>Date visited: #{first_date.to_s}</p> <p>Located: #{states}</p> </div>\"\n end",
"title": ""
},
{
"docid": "4c6136258d8609ce46721c40357df536",
"score": "0.6093737",
"text": "def slurl\n position = JSON.parse(self.position)\n href = \"https://maps.secondlife.com/secondlife/#{region}/#{position['x'].round}/\" \\\n \"#{position['y'].round}/#{position['z'].round}/\"\n text = \"#{region} (#{position['x'].round}, \" \\\n \"#{position['y'].round}, #{position['z'].round})\"\n h.link_to(text, href)\n end",
"title": ""
},
{
"docid": "c8cb17c291b447223818a659d712b2bd",
"score": "0.6086737",
"text": "def to_s\n @uri\n end",
"title": ""
},
{
"docid": "2acc5bb44d6e01b02d6848fa0b30f398",
"score": "0.6083997",
"text": "def google_map(center)\n \"https://www.google.com/maps/embed/v1/place?key=AIzaSyDNN7OiP-psXLqajIUmJsRXhHd983eDC50&q=place_id:#{center}\"\n end",
"title": ""
},
{
"docid": "748ebaa395162951ff92aa443c886fe1",
"score": "0.60726887",
"text": "def get_print_url()\n points = self.arrOfPoints \n #coordinates of the retailer hardcoded at [30.199,31.002]\n url = \"http://maps.google.com/maps?f=d&source=s_d&saddr=30.199,31.002\" \n len = points.size\n len.times do |i|\n if i == 0\n url << \"&daddr=\"\n end\n url << arrOfPoints[i]*\",\".sub( \" \", \"+\" )\n if i != (len - 1) \n url << \"+to:\" \n end\n end\n url << \"+to:30.199,31.002&ie=UTF8&z=10&pw=2&hl=en\" \n return url\n end",
"title": ""
},
{
"docid": "8fb8b0735a40f77541a3ec403ba00d38",
"score": "0.60609627",
"text": "def site_map\n if site_location\n loc = URI.escape(site_location)\n <<-EOD\n <a href=\"http://maps.google.com/?q=#{loc}\" target=\"x-map\">#{site_location}</a>\n EOD\n end\n end",
"title": ""
},
{
"docid": "00887ad5169962069fd7c8ea509f4ad4",
"score": "0.60598314",
"text": "def to_s\n @uri.to_s\n end",
"title": ""
},
{
"docid": "00887ad5169962069fd7c8ea509f4ad4",
"score": "0.60598314",
"text": "def to_s\n @uri.to_s\n end",
"title": ""
},
{
"docid": "f52b88a1af78b339722df9fde65cfc14",
"score": "0.60292697",
"text": "def to_url\n\t\t\tto_uri.to_s\n\t\tend",
"title": ""
},
{
"docid": "1b40a0d7c20c301844e3a81999ac2207",
"score": "0.6028879",
"text": "def url\n connection.build_url(url_chunk, params).to_s\n end",
"title": ""
},
{
"docid": "26e60e90716bfd014ff48922ee80d415",
"score": "0.60268027",
"text": "def to_s\n @uri\n end",
"title": ""
},
{
"docid": "5c0851384e661742146ecfc151f02753",
"score": "0.6015397",
"text": "def to_s\n \"<Locode::Location: '#{locode}'>\"\n end",
"title": ""
},
{
"docid": "09e8bdafb5df51a86eccc533794e2289",
"score": "0.59707934",
"text": "def _info_uri\n InfoURI + _uri_path\n end",
"title": ""
},
{
"docid": "96bdc81b622bf097ed98948528fb4e0c",
"score": "0.59704256",
"text": "def to_s\n url_value = value.to_s.tr('#;\\'\"\"', '').gsub(' ', '%20')\n id? ? \"/#{value}\" : \"#{name}=#{url_value}\"\n end",
"title": ""
},
{
"docid": "4f74ccfcc240746307e8963a314cb335",
"score": "0.59679145",
"text": "def get_googlemap_url\n url = \"http://maps.google.com/maps?q=#{self.gmap_location}&\"\n end",
"title": ""
},
{
"docid": "22868017df4bebb2371312cc4c788d61",
"score": "0.5960928",
"text": "def to_s\r\n if self.prefix\r\n \"#{self.prefix}:#{self.href}\"\r\n else\r\n self.href\r\n end\r\n end",
"title": ""
},
{
"docid": "db0efa8dcba2a74efcb5ccfa25b955f0",
"score": "0.59595865",
"text": "def to_s\n uri\n end",
"title": ""
},
{
"docid": "3b4f69334658844e3f40d88df86585cd",
"score": "0.59569716",
"text": "def html_marker_text company, name_html: nil\n text = \"<div class='map-marker'>\"\n text << \"<p class='name'>\"\n text << (name_html.nil? ? link_to(company.name, company, target: '_blank') : name_html)\n text << \"</p>\"\n text << \"<p class='categories'>#{list_categories company, ', '}</p>\"\n text << \"<br>\"\n company.addresses.each do |addr|\n text << \"<p class='entire-address'>#{addr.entire_address}</p>\"\n end\n\n text << \"</div>\"\n\n text\n end",
"title": ""
},
{
"docid": "430960ade1c8f2c3f0e7f8ae74b0b613",
"score": "0.59565526",
"text": "def uri\n OPEN_WEATHER_MAP_URI + @id\n end",
"title": ""
},
{
"docid": "f68f59e93864264be42cb8008b6ff3bc",
"score": "0.59472984",
"text": "def to_s\n reconstruct_uri\n end",
"title": ""
},
{
"docid": "0587258bd84d7f8a3818b1bcae3a96a2",
"score": "0.59383947",
"text": "def gmaps4rails_infowindow\n \"<h1>#{name}</h1><br>Latitude: #{latitude} Longitude: #{longitude}\"\n end",
"title": ""
},
{
"docid": "e3e6738ae5c35fb4ba6c980d4bc90656",
"score": "0.5929852",
"text": "def gmaps4rails_address\n\t\t\"#{self.street}, #{self.city}, #{self.country}\" \n\tend",
"title": ""
},
{
"docid": "19608dbd44399a30ce254db5274fddc1",
"score": "0.592861",
"text": "def to_s\n \"#{lat},#{lng}\"\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.59260297",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.59260297",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.59260297",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "a22cded5cd279a5004a6002d83f95caf",
"score": "0.5902119",
"text": "def to_s\n\t\t\"Road: #{@loc1} <--> #{@loc2}, distance = #{@distance}\"\n\tend",
"title": ""
},
{
"docid": "69782feec51ed125004efd3e385da2d9",
"score": "0.5899462",
"text": "def location_string(type, id, version=nil)\n link = Conf.base_uri\n case type.downcase\n when \"workflow\"; link += \"/workflows/\"\n when \"blob\"; link += \"/files/\"\n when \"pack\"; link += \"/packs/\"\n else; return( link += \"/home\" )\n end\n \n link += id.to_s\n link += \"?version=#{version}\" if version\n \n return link\n end",
"title": ""
},
{
"docid": "d4920bb19de67c2e1e5a751500ed9747",
"score": "0.58964497",
"text": "def html_marker_text(company, address, name_html: nil)\n text = \"<div class='map-marker'>\"\n text << \"<p class='name'>\"\n text << (name_html.nil? ? link_to(company.name, company, target: '_blank') : name_html)\n text << \"</p>\"\n text << \"<p class='categories'>#{list_categories(company, ', ')}</p>\"\n text << \"<p class='entire-address'>#{address.entire_address}</p>\"\n text << \"</div>\"\n\n text\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.58916545",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.58916545",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.58916545",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "2d2e018f333e3aa4a78ea8eb2bcfc36c",
"score": "0.5887878",
"text": "def location_string\n if location\n str = location.name\n str += \", \" + location_text unless location_text.blank?\n else\n str = location_text\n end\n str\n end",
"title": ""
},
{
"docid": "ebfe7e854b1818ef24f73cfaab15276b",
"score": "0.58843666",
"text": "def to_s; \"#@keyword:#@key; #@sourceRef\" end",
"title": ""
},
{
"docid": "cce455b70911be904d6125b35950589d",
"score": "0.5882561",
"text": "def map_link(display, object)\n\t if object.class == String\n\t address = object\n\t else\n\t event = object\n \t\taddress = event.address\n end\n\n # replace whitepace with +\n\t tmp_addy = address.gsub(/[ \\t\\r\\n\\v\\f]/, '+')\n\t google_maps_href = \"http://maps.google.com/maps?q=\"+tmp_addy\n\t return \"<a href=\\\"\" + google_maps_href + \"\\\" target=\\\"_blank\\\">\" + display + \"</a>\"\n end",
"title": ""
},
{
"docid": "78269940e6a1a35c4dea3c8b4aaaf3f6",
"score": "0.5875221",
"text": "def url\n @url ||= URL.new(\n :template => url_template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end",
"title": ""
},
{
"docid": "c342fe8a289b3524b5cf94bcf59baac8",
"score": "0.5873982",
"text": "def gmaps4rails_address\n \"#{latitude}, #{longitude}\"\n end",
"title": ""
},
{
"docid": "60b7ad5fd5859dfefb0ebe1c3d3dc76c",
"score": "0.58737075",
"text": "def to_s\n \"#{base_url}?#{to_query(convert)}\"\n end",
"title": ""
},
{
"docid": "beca7a76762f69dcb4c7165b46daacaf",
"score": "0.58710593",
"text": "def to_s\n uri_string\n end",
"title": ""
},
{
"docid": "1a813daa56f260f0aa3544668fa252cd",
"score": "0.58708125",
"text": "def information_url\n return @information_url\n end",
"title": ""
},
{
"docid": "1a813daa56f260f0aa3544668fa252cd",
"score": "0.58708125",
"text": "def information_url\n return @information_url\n end",
"title": ""
},
{
"docid": "8836e3b834efec1393d8934f5268961d",
"score": "0.58610797",
"text": "def build_url(wonder)\n google_api_key = \"AIzaSyBP30mYnbwKpZ0lCHtp6FuvcNSjNG0GsGM\"\n geocode_url = \"https://maps.googleapis.com/maps/api/geocode/json?address=#{wonder}&key=#{google_api_key}\"\n encoded_url = URI.encode(geocode_url)\n return encoded_url\nend",
"title": ""
},
{
"docid": "ec365231a4ea296b61d93c4d79ee3b0e",
"score": "0.58487225",
"text": "def url\n uri.to_s\n end",
"title": ""
},
{
"docid": "f584596c20c4a42a14bdbcb16ddd12a8",
"score": "0.5842444",
"text": "def map_description\n return \"Map of flight routes, created by Paul Bogard’s Flight Historian\"\n end",
"title": ""
},
{
"docid": "f584596c20c4a42a14bdbcb16ddd12a8",
"score": "0.5842444",
"text": "def map_description\n return \"Map of flight routes, created by Paul Bogard’s Flight Historian\"\n end",
"title": ""
},
{
"docid": "83b224656ab20df562048a40227e913d",
"score": "0.5838206",
"text": "def to_url\n to_uri.to_s\n end",
"title": ""
},
{
"docid": "67e89f162701d29b4ce3ecfa333eaa72",
"score": "0.58378375",
"text": "def url\n @hash[\"Url\"]\n end",
"title": ""
},
{
"docid": "84f565731115e61677da69f5f431dbd2",
"score": "0.58217806",
"text": "def icon_location\n @link.IconLocation\n end",
"title": ""
},
{
"docid": "65aa5983b0581e044aa5495e93a59829",
"score": "0.58141565",
"text": "def name\n \"#{id}: #{url}\"\n end",
"title": ""
},
{
"docid": "0978c8828eae70733956ab9f5b059ff9",
"score": "0.5807579",
"text": "def url\n @url ||= URL.new(\n :template => template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end",
"title": ""
},
{
"docid": "541020224129d26853d1437c6973c78f",
"score": "0.57868195",
"text": "def permalink\n return \"#{uri}\"\n end",
"title": ""
},
{
"docid": "1bc29fb7054bd0657bcdf8a62700ad1c",
"score": "0.5785145",
"text": "def gmaps4rails_address\n \"\"#self.address\n end",
"title": ""
},
{
"docid": "fe4d43b96397a81c2b8f9e8c47b3d014",
"score": "0.57730377",
"text": "def url\n uri.to_s\n end",
"title": ""
},
{
"docid": "1d4e83b8d8c46020457c01f7898382f1",
"score": "0.57657313",
"text": "def inspect\n return \"#<FeedTools::Feed:0x#{self.object_id.to_s(16)} URL:#{self.href}>\"\n end",
"title": ""
},
{
"docid": "a3a7ce12c571174ff4e1bc535776992f",
"score": "0.5752031",
"text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, uri.to_s)\n end",
"title": ""
},
{
"docid": "a3a7ce12c571174ff4e1bc535776992f",
"score": "0.5752031",
"text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, uri.to_s)\n end",
"title": ""
},
{
"docid": "9df1f0f414fd081f0dfc6bb1eae02289",
"score": "0.5746592",
"text": "def info\n\t\t\"#{name}, #{location}\"\n\tend",
"title": ""
},
{
"docid": "98e9f87589a13f2194add803cbde3c65",
"score": "0.5743704",
"text": "def map_description\n return \"Map of airport locations and number of visits, created by Paul Bogard’s Flight Historian\"\n end",
"title": ""
},
{
"docid": "c47bae55e3e1c2366099bf8a3c86d756",
"score": "0.57263035",
"text": "def to_url\n JavaFile.new(self.canonicalize.to_s).toURL().to_s\n end",
"title": ""
},
{
"docid": "18b1d78029e25c1d2750e928901cf14f",
"score": "0.5720184",
"text": "def to_s\n \"#{self.latitude},#{self.longitude}\"\n end",
"title": ""
},
{
"docid": "7bd246b11c91247f36e87b9a4f8e8c9e",
"score": "0.57188344",
"text": "def to_s\n color = ColorMap[@key.to_i]\n attributes = [color, @track_number, @bpm, @key, @artist, @title]\n Template % attributes\n end",
"title": ""
},
{
"docid": "92941ae17cc8403c587efcfe2fef78e6",
"score": "0.57186675",
"text": "def gmaps4rails_address\n \"#{self.street}, #{self.city}, #{self.country}\" \n end",
"title": ""
},
{
"docid": "0f6a4ec3ec5f1d75a09d7e18f7452748",
"score": "0.57183623",
"text": "def url\n @url ||= URL.new(\n template: template,\n placeholders: url_placeholders,\n permalink: permalink\n ).to_s\n end",
"title": ""
},
{
"docid": "84f36cb7d8bce1107deb144c4968b330",
"score": "0.5717946",
"text": "def to_s\n \"#{self.class.name} => { id: #{@id}, title: #{@title}, timezone => #{@timezone}, location => #{@location} }\"\n end",
"title": ""
},
{
"docid": "26a01a0c49ed058c9a726ca5cef24d28",
"score": "0.57151914",
"text": "def to_s\n \"#<\" + self.class.name + \": \" + (href || \"ANONYMOUS\") + \">\"\n end",
"title": ""
},
{
"docid": "f6ca6e0683dab2649904026708677fcf",
"score": "0.56965804",
"text": "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "97240ae347761d7531853762e1cd09f1",
"score": "0.5695876",
"text": "def to_s\n \"#{@base_url}?#{query}\"\n end",
"title": ""
}
] |
e9a2a0a1a63a0202b8475f8c5d68c54c
|
POST /offsets POST /offsets.json
|
[
{
"docid": "e96344f06a80544d59d61a9378de8d54",
"score": "0.6449599",
"text": "def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c0849fd23d6947c6a973cdd93609bb66",
"score": "0.6329939",
"text": "def commit_offsets!\n commit_offsets(async: false)\n end",
"title": ""
},
{
"docid": "284a9f1b7e90c81340b83cf903a1baa8",
"score": "0.6196934",
"text": "def list_offsets(**options)\n request = Protocol::ListOffsetRequest.new(**options)\n\n @connection.send_request(request)\n end",
"title": ""
},
{
"docid": "3147d35be2e7cfc18024e398b9c8429d",
"score": "0.5534183",
"text": "def around\n params[:offset] ||= 1\n events = @event.around_events(params[:offset])\n render :json => events.to_json, :status => :ok\n end",
"title": ""
},
{
"docid": "0aa2f72f64d382247f00931c5582c409",
"score": "0.54915696",
"text": "def new\n @offset = Offset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offset }\n end\n end",
"title": ""
},
{
"docid": "7ffc9aa5fcf366a6c14691c360bcbefb",
"score": "0.54248434",
"text": "def derive_offsets(transitions, offsets); end",
"title": ""
},
{
"docid": "7ffc9aa5fcf366a6c14691c360bcbefb",
"score": "0.54248434",
"text": "def derive_offsets(transitions, offsets); end",
"title": ""
},
{
"docid": "dfeb84ff402ba6a6127a00e08dd41a5e",
"score": "0.5379886",
"text": "def replace_with_existing_offsets(offsets, annual_rules); end",
"title": ""
},
{
"docid": "4b41776646a8acc667004c45417d4dd8",
"score": "0.5277402",
"text": "def create\n @offset_time = OffsetTime.new(params[:offset_time])\n\n respond_to do |format|\n if @offset_time.save\n format.html { redirect_to @offset_time, notice: 'Offset time was successfully created.' }\n format.json { render json: @offset_time, status: :created, location: @offset_time }\n else\n format.html { render action: \"new\" }\n format.json { render json: @offset_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64d4958c33c43b9e548caf1dc961c33e",
"score": "0.5226118",
"text": "def api_offset(params)\n dataset = self\n\n # Offset results\n if num = params['offset']\n i = num.to_i\n if num =~ /[^\\d]/\n raise ApiException.new(\"invalid offset (#{num}) is not an integer\")\n else\n dataset.opts[:offset] = i\n end\n elsif num = params['page']\n i = num.to_i\n if num =~ /[^\\d]/\n raise ApiException.new(\"invalid page (#{num}) is not an integer\")\n elsif i <= 0\n raise ApiException.new(\"invalid page (#{num}) is less than 1\")\n else\n dataset.opts[:offset] = (i - 1) * dataset.opts[:limit]\n end\n end\n\n dataset\n end",
"title": ""
},
{
"docid": "c45dc4862b42135d649dee5ffb8ad83a",
"score": "0.52215636",
"text": "def commit_offsets(async: true)\n @mutex.lock\n\n internal_commit_offsets(async: async)\n ensure\n @mutex.unlock\n end",
"title": ""
},
{
"docid": "3587453961debb5b7a910acfd759d574",
"score": "0.51501566",
"text": "def showOffsetDelta\n offset = Integer(params[:offset]) * Integer(params[:delta])\n @user = User.offset(offset).limit(params[:delta])\n @user = @user.order('name ASC')\n render json: @user\n end",
"title": ""
},
{
"docid": "6a5706b5e0e6fd167d6a41da5a8c1b3b",
"score": "0.50626713",
"text": "def new\n @offset_time = OffsetTime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offset_time }\n end\n end",
"title": ""
},
{
"docid": "4ae712506e05fe12f96143100372c266",
"score": "0.50538427",
"text": "def index\n params[:offset] = 0 unless params.has_key? :offset\n #TODO optimize with revert indexes at least\n @events = @host.events.offset(params[:offset]).limit(100).order('id DESC')\n end",
"title": ""
},
{
"docid": "0525a4ad21f3624e90e44402c6c1de4e",
"score": "0.5051114",
"text": "def find_offsets\n offsets = []\n\n 0.upto(weblogs.count / DEFAULT_OFFSET) do |i|\n offsets << i * 20\n end\n\n offsets\n end",
"title": ""
},
{
"docid": "32fdbb4c1f01efa660e9f762eac57dba",
"score": "0.502182",
"text": "def normalize_offset(offset); end",
"title": ""
},
{
"docid": "db7c961aed4b469730c3c79c5584844d",
"score": "0.5021637",
"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": "d90fcf66e6ada4539780c45eb22f2451",
"score": "0.49909836",
"text": "def find_by_toc(*offsets)\n offsets = offsets.join(\" \")\n search = AlbumTOCSearch.new(:toc => offsets)\n response = APIRequest.post(search.query, Configuration.instance.api_url(@format))\n parse_response(response)\n end",
"title": ""
},
{
"docid": "d022ee4477370615564ba7fe4dcfa0ea",
"score": "0.49698687",
"text": "def update \n @offset = Offset.find(params[:id])\n\n respond_to do |format|\n if @offset.update_attributes(params[:offset])\n format.html { redirect_to @offset, notice: 'Offset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @offset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cab770764719c07c8d618cfd565837b0",
"score": "0.49181437",
"text": "def set_hash_offset(opts)\n opts = check_params(opts,[:offsets])\n super(opts)\n end",
"title": ""
},
{
"docid": "3fd67c7c801e7f41fd46631328fdd2a9",
"score": "0.48810273",
"text": "def show\n @offset = Offset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offset }\n end\n end",
"title": ""
},
{
"docid": "be2076b4a10e24b63b5026646df506b1",
"score": "0.48734802",
"text": "def json_index_tutorials_by_limit_and_offset\n\n @themes = Theme.order(:id).\n limit(params[:limit]).\n offset(params[:offset])\n\n respond_to do |format|\n format.json { render json: @themes }\n end\n end",
"title": ""
},
{
"docid": "9c23695d3d510f2a4ee8bad471591689",
"score": "0.48009697",
"text": "def index\n @traces = Trace.all\n url_string = ''\n data = []\n pdist = 0\n plat = @traces.first.latitude\n plon = @traces.first.longitude\n traces = @traces.pluck(:latitude, :longitude).map { |lat, lon| { latitude: lat, longitude: lon } }\n response = HTTParty.post(\n url_string,\n :body => traces.to_json,\n :headers => { 'Content-Type' => 'application/json' }\n )\n @traces.each_with_index do |t,index|\n data << {\n \"latitude\": t.latitude,\n \"longitude\": t.longitude,\n \"distance\": distance([plat,plon],[t.latitude, t.longitude]) + pdist,\n \"elevation\": response[index]\n }\n pdist += distance([plat,plon],[t.latitude, t.longitude])\n plat = t.latitude\n plon = t.longitude\n end\n render json: data\n end",
"title": ""
},
{
"docid": "8279667ac85bf5dd431035d67fb23620",
"score": "0.4799834",
"text": "def shift_output_offsets(delta)\n return if delta == 0\n @data.each do |m|\n break if m.output.start_pos.line > 1\n m.output.start_pos.offset += delta\n m.output.end_pos.offset += delta if m.output.end_pos.line > 1\n end\n end",
"title": ""
},
{
"docid": "273c4cb34d0e10ec6f86f32feb868f23",
"score": "0.47972172",
"text": "def new_offset(offset=0)\n self.class.new!(:civil=>civil, :parts=>time_parts, :offset=>(offset*86400).to_i)\n end",
"title": ""
},
{
"docid": "6736b2e3425f239f40996ae57b7d0eea",
"score": "0.4788643",
"text": "def json_index_notification_by_limit_by_offset\n @notifications = Notification.order(\"updated_at desc\").limit(params[:limit]).offset(params[:offset])\n respond_to do |format|\n format.json { render json: @notifications }\n end\n end",
"title": ""
},
{
"docid": "9c6487db6add75c66270d39dd9168048",
"score": "0.47506478",
"text": "def destroy_offset\n if params[:offset].present?\n if params[:untranslated].present?\n @translations = CouchbaseI18n::Translation.untranslated_with_offset(params[:offset])\n else\n @translations = CouchbaseI18n::Translation.with_offset(params[:offset])\n end\n else\n if params[:untranslated].present?\n @translations = CouchbaseI18n::Translation.untranslated\n else\n @translations = CouchbaseI18n::Translation.all\n end\n end\n @translations.map(&:destroy)\n redirect_to({:action => :index}, :notice => I18n.t('couchbase_i18n.translation.offset_deleted', :count => @translations.size, :offset => params[:offset]))\n end",
"title": ""
},
{
"docid": "c82439fadba874be1de9d953973ec162",
"score": "0.47445804",
"text": "def offset\n sanitize search_params['offset']\n end",
"title": ""
},
{
"docid": "43ae70c855b44cdd85f957e8bba0e68d",
"score": "0.47308576",
"text": "def set_offset(offset)\n @offset = offset\n self\n end",
"title": ""
},
{
"docid": "a2168bb5d19b95c45571c48ff11d0ea2",
"score": "0.47264576",
"text": "def transition(offset_id, timestamp_value); end",
"title": ""
},
{
"docid": "bd0aef64f6577d1ea3dc2a58f16e7abd",
"score": "0.46700174",
"text": "def create\n @text = (params[:text] || \"\").strip\n @offset = (params[:offset] || \"-1\").to_i\n @concept = params[:concept] || \"\"\n @type = params[:type] || \"\"\n\n @ret = @document.add_annotation(@text, @offset, @type, @concept)\n @entity_types = EntityType.where(collection_id: @document.collection_id)\n\n respond_to do |format|\n format.html { redirect_to @annotation, notice: 'The annotation was successfully created.' }\n format.json { render :show, status: :ok, location: @annotation }\n end\n end",
"title": ""
},
{
"docid": "1563d52709d2c74091912dcb224f095b",
"score": "0.4666398",
"text": "def offset_vector=(offset_vector)\n end",
"title": ""
},
{
"docid": "6920dac4de123491c9b42566279418d1",
"score": "0.4650263",
"text": "def test_get_deparment_offset\n data = post_department('count' => 1, 'offset' => 1)\n assert_equal(2, data[0]['data']['id'])\n end",
"title": ""
},
{
"docid": "bde84647d6a59c0acd9402f5a0dbf952",
"score": "0.46337894",
"text": "def getPayloadOffsets(payload)\n @offsets\n end",
"title": ""
},
{
"docid": "8aec7d0057774625f46d2b6a7c78cff3",
"score": "0.46264744",
"text": "def index\n @marker = Marker.new\n end",
"title": ""
},
{
"docid": "24b73eb01931d2413c45d163bfaad362",
"score": "0.4620348",
"text": "def destroy\n @offset_time = OffsetTime.find(params[:id])\n @offset_time.destroy\n\n respond_to do |format|\n format.html { redirect_to offset_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1f7ed6fb1461d70b6576532863640e4a",
"score": "0.46159837",
"text": "def index\n @events = Event.where(start: params[:start]..params[:end])\n render json: @events\n end",
"title": ""
},
{
"docid": "93f5cd86276ac82fd4b856b212885a52",
"score": "0.46027085",
"text": "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"title": ""
},
{
"docid": "e877c09c9c3d1d0540f9cf95c03d18c7",
"score": "0.45929033",
"text": "def offset(offset)\n self.query.offset = offset\n self\n end",
"title": ""
},
{
"docid": "043e4ef9db27788ac269e5e3effba9a5",
"score": "0.4582747",
"text": "def index\n data = get_index_data\n @dayoffs = data.page(params[:current_page]).per(PER_PAGE)\n respond_to do |format|\n format.html {\n render \"dashboards/admin_dashboard\"\n }\n\n format.json {\n render json: {\n total_page: @data.total_page,\n data: ActiveModel::SerializableResource.new(@dayoffs, each_serializer: AdminDayoffSerializer)\n }, status: :ok\n }\n end\n end",
"title": ""
},
{
"docid": "3fcb67cc486283de1118977cf482c8c8",
"score": "0.45812148",
"text": "def set_Offset(value)\n set_input(\"Offset\", value)\n end",
"title": ""
},
{
"docid": "6859b761b8d2aa30a7f3796981d3fa5f",
"score": "0.45746917",
"text": "def set_Offset(value)\n set_input(\"Offset\", value)\n end",
"title": ""
},
{
"docid": "6859b761b8d2aa30a7f3796981d3fa5f",
"score": "0.45746917",
"text": "def set_Offset(value)\n set_input(\"Offset\", value)\n end",
"title": ""
},
{
"docid": "126d571ae69799642b80a6309d23da08",
"score": "0.45653346",
"text": "def offset\n @offset ||= raw_response['response']['start']\n end",
"title": ""
},
{
"docid": "2134736b480f4c45bccced2f10ac04fa",
"score": "0.45223355",
"text": "def destroy\n\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Delete.new('/offsets/doit.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(',')})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"title": ""
},
{
"docid": "923c2fcd7bf976deae5ee6c83b25c6f3",
"score": "0.45070377",
"text": "def offset(x, y)\n { :offset => { :x => x, :y => y } }\n end",
"title": ""
},
{
"docid": "35bb41ff8b3c69ef7a05ead4c99d8698",
"score": "0.4505054",
"text": "def offset_in_days=(value)\n @offset_in_days = value\n end",
"title": ""
},
{
"docid": "a755f13420ea47148fd8dd3879af55f9",
"score": "0.44902495",
"text": "def update!(**args)\n @offset = args[:offset] if args.key?(:offset)\n end",
"title": ""
},
{
"docid": "dbf3d73a72cc46de726a396edccad8ac",
"score": "0.44850132",
"text": "def input_start_offset\n _response_word.fetch(\"startingPos\", nil)\n end",
"title": ""
},
{
"docid": "87604a8e143a036437be9bdf8db03f59",
"score": "0.4464607",
"text": "def api_offset_and_limit(options=params)\n offset = 0\n\n if options[:offset].present?\n offset = options[:offset].to_i\n offset = 0 if offset < 0\n end\n\n limit = options[:limit].to_i\n if limit < 1\n limit = 25\n elsif limit > 100\n limit = 100\n end\n\n if offset.nil? && options[:page].present?\n offset = (options[:page].to_i - 1) * limit\n offset = 0 if offset < 0\n end\n\n [offset, limit]\n end",
"title": ""
},
{
"docid": "6170c681df570319463f9e47eee73a65",
"score": "0.44400218",
"text": "def offset(val)\n @params[:retstart] = val\n self\n end",
"title": ""
},
{
"docid": "b877e475ccfed32fa3c94b5f4131db2e",
"score": "0.443616",
"text": "def index\n @markers = Marker.all\n end",
"title": ""
},
{
"docid": "b877e475ccfed32fa3c94b5f4131db2e",
"score": "0.443616",
"text": "def index\n @markers = Marker.all\n end",
"title": ""
},
{
"docid": "4cb45eb58c0686641f9df88a71e29476",
"score": "0.443211",
"text": "def index\n @document = Document.new\n @documents = Document.order(sort_column, sort_direction)\n\n @documents = apply_tag if params.has_key? :tag\n @documents = apply_search if params.has_key? :search\n\n @documents = @documents.offset(@offset) if @offset = params[:offset]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @documents }\n end\n end",
"title": ""
},
{
"docid": "a4530591abfdd71b4e82abf0b402fcb3",
"score": "0.4417337",
"text": "def map_note_offsets_to_time_offsets note_offsets\n time_counter = 0.0\n sorted_offsets = note_offsets.sort\n note_time_map = { sorted_offsets.first => time_counter }\n \n for i in 1...sorted_offsets.count do\n time_counter += time_elapsed(sorted_offsets[i-1], sorted_offsets[i])\n note_time_map[sorted_offsets[i]] = time_counter\n end\n \n return note_time_map\n end",
"title": ""
},
{
"docid": "61c48646a9b11603557f30bd58664fd9",
"score": "0.44066808",
"text": "def _lex_index_offsets; end",
"title": ""
},
{
"docid": "61c48646a9b11603557f30bd58664fd9",
"score": "0.44066808",
"text": "def _lex_index_offsets; end",
"title": ""
},
{
"docid": "61c48646a9b11603557f30bd58664fd9",
"score": "0.44066808",
"text": "def _lex_index_offsets; end",
"title": ""
},
{
"docid": "61c48646a9b11603557f30bd58664fd9",
"score": "0.44066808",
"text": "def _lex_index_offsets; end",
"title": ""
},
{
"docid": "49ff80472c059f58bfd640d9f791fcaa",
"score": "0.44017372",
"text": "def index_entries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EntriesApi.index_entries ...'\n end\n # resource path\n local_var_path = '/api/v1/entries'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'dataset_id'] = opts[:'dataset_id'] if !opts[:'dataset_id'].nil?\n query_params[:'person_id'] = opts[:'person_id'] if !opts[:'person_id'].nil?\n query_params[:'from_date'] = opts[:'from_date'] if !opts[:'from_date'].nil?\n query_params[:'to_date'] = opts[:'to_date'] if !opts[:'to_date'].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(['*/*'])\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] || 'Array<Entry>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['authToken']\n\n new_options = opts.merge(\n :operation => :\"EntriesApi.index_entries\",\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: EntriesApi#index_entries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c7141922f2586a09dc1ab643ea4f0a07",
"score": "0.44009465",
"text": "def index\r\n markers = Marker.all\r\n render json: markers\r\n end",
"title": ""
},
{
"docid": "408a870f3a97df9296e75da484bbed0b",
"score": "0.43989038",
"text": "def notes(offsets, velocity=127, duration='quarter')\r\n offsets = [offsets] unless offsets.respond_to? :each\r\n offsets.each do |offset|\r\n event(NoteOnEvent.new(@channel, offset, velocity))\r\n end\r\n @time += @sequence.note_to_delta(duration)\r\n offsets.each do |offset|\r\n event(NoteOffEvent.new(@channel, offset, velocity))\r\n end\r\n recalc_delta_from_times\r\n end",
"title": ""
},
{
"docid": "f02248edad0262736174c695748db775",
"score": "0.43764827",
"text": "def offset_params\n if params[:offset].present?\n @offset = params[:offset].to_i\n end\n if params[:limit].present?\n @limit = params[:limit].to_i\n end\n @offset ||= OFFSET\n @limit ||= LIMIT\n end",
"title": ""
},
{
"docid": "f02248edad0262736174c695748db775",
"score": "0.43764827",
"text": "def offset_params\n if params[:offset].present?\n @offset = params[:offset].to_i\n end\n if params[:limit].present?\n @limit = params[:limit].to_i\n end\n @offset ||= OFFSET\n @limit ||= LIMIT\n end",
"title": ""
},
{
"docid": "f02248edad0262736174c695748db775",
"score": "0.43764827",
"text": "def offset_params\n if params[:offset].present?\n @offset = params[:offset].to_i\n end\n if params[:limit].present?\n @limit = params[:limit].to_i\n end\n @offset ||= OFFSET\n @limit ||= LIMIT\n end",
"title": ""
},
{
"docid": "aff75e851305505b09a0773d06d02cf9",
"score": "0.43747476",
"text": "def index\n render plain: \"/api/races, offset=[#{params[:offset]}], limit=[#{params[:limit]}]\"\n end",
"title": ""
},
{
"docid": "809091d47e99317451abcc1cc0e42483",
"score": "0.43741465",
"text": "def update!(**args)\n @x_offsets = args[:x_offsets] if args.key?(:x_offsets)\n @y_offsets = args[:y_offsets] if args.key?(:y_offsets)\n end",
"title": ""
},
{
"docid": "809091d47e99317451abcc1cc0e42483",
"score": "0.43741465",
"text": "def update!(**args)\n @x_offsets = args[:x_offsets] if args.key?(:x_offsets)\n @y_offsets = args[:y_offsets] if args.key?(:y_offsets)\n end",
"title": ""
},
{
"docid": "26f7db760af0d3bcdb287627e4f993a3",
"score": "0.43716988",
"text": "def showDelta\n @user = User.offset(0).limit(params[:delta])\n render json: @user\n end",
"title": ""
},
{
"docid": "fa71b7021b7d619d5435757197e2f311",
"score": "0.43708017",
"text": "def offset(*) end",
"title": ""
},
{
"docid": "4e52b588bd84bd6fca055e20997cd346",
"score": "0.43690264",
"text": "def default_offset_amount\n 50\n end",
"title": ""
},
{
"docid": "e017e0d3c6d1aa223836575cb2196022",
"score": "0.4363349",
"text": "def convert_epochs_to_dates\n if params['event']['start_date']\n params['event']['start_date'] = Time.zone.at(params['event']['start_date'].to_i / 1000)\n end\n if params['event']['end_date']\n params['event']['end_date'] = Time.zone.at(params['event']['end_date'].to_i / 1000)\n end\n end",
"title": ""
},
{
"docid": "ead66e4d33554435192109a15ca8bbbc",
"score": "0.43599442",
"text": "def offset_params\r\n if params[:offset]\r\n @offset = params[:offset].to_i\r\n end\r\n if params[:limit]\r\n @limit = params[:limit].to_i\r\n end\r\n @offset ||= OFFSET\r\n @limit ||= LIMIT\r\n end",
"title": ""
},
{
"docid": "17db171278f69bddc647dc27e0ef983b",
"score": "0.43537295",
"text": "def post_feed\n offset = params[:offset].to_i * 10;\n @follows = Follow.includes(:follower, :followee).where(:follows => {:follower_id => params[:userId]})\n @posts = User.find(params[:userId]).offset_feed_posts(offset)\n @hashtags = Hashtag.all\n render 'api/posts/index'\n end",
"title": ""
},
{
"docid": "d3b3a38ac9a8e5f349c660b8d29d57b5",
"score": "0.43454167",
"text": "def occurred_events offset_size\n Event.reader_by offset_size, pseudo_graph_pattern: pseudo_graph_pattern\n end",
"title": ""
},
{
"docid": "72e329ddc8abfc27ea16efe75a645059",
"score": "0.4329919",
"text": "def create_expirations(params = nil)\n\t\tself.class.expirations.each_with_index do |sym, index|\n\t\t\tklass = self.namespaced_class(sym)\n\t\t\texpiration = klass.new \n\t\t\texpiration.offset = params.nil? ? klass::DEFAULT_OFFSET : params[:offset]\n\t\t\texpiration.offset_units = params.nil? \\\n\t\t\t\t? klass::DEFAULT_OFFSET_UNITS : params[:offset_units]\n\t\t\texpiration.tranzaction = self\n\t\t\texpiration.save!\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b22ecc37062d3e76aac8e8e11e6cc9df",
"score": "0.43234354",
"text": "def index\n @projects = Project.order('LOWER(name)')\n respond_with(@projects) do |format|\n format.json do\n if params[:offset].to_i > 0\n @projects = @projects.offset(params[:offset].to_i)\n end\n render json: decorate(@projects).to_json\n end\n end\n end",
"title": ""
},
{
"docid": "824a2dc220da98bdb82f846c394cd61f",
"score": "0.43140444",
"text": "def add_notes(offsets, velocity=127, duration='quarter')\n offsets = [offsets] unless offsets.respond_to? :each\n offsets.each do |offset|\n event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n end\n @time += @sequence.note_to_delta(duration)\n offsets.each do |offset|\n event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n end\n recalc_delta_from_times\n end",
"title": ""
},
{
"docid": "1cf87bccbfb5cb490a36f99dc4b83661",
"score": "0.43133008",
"text": "def offset(arg0)\n end",
"title": ""
},
{
"docid": "16e001d70a9135fcd9dd22311ac1be94",
"score": "0.4310761",
"text": "def show\n @watcher = Watcher.includes(:tweets).friendly.find(params[:id])\n @statuses = Status.all\n respond_to do |format|\n format.html { render :show, offset: params[:offset]}\n format.json { render json: @watcher.tweets }\n end\n end",
"title": ""
},
{
"docid": "49b044efd51ffb11944cf7f3be8ab84d",
"score": "0.43062884",
"text": "def validate_offset!(options)\r\n return unless options[:offset]\r\n\r\n if options[:offset].to_s == \"0\"\r\n options.delete :offset\r\n elsif options[:offset].to_i < 0 || options[:offset].to_s[/\\D+/]\r\n raise InvalidOffset,\r\n \"offset must be a number zero or greater\"\r\n end\r\n\r\n options[:offset]\r\n end",
"title": ""
},
{
"docid": "0a268e9137cf994791de6aaf513d316d",
"score": "0.43057758",
"text": "def timeline(options={})\n options = {:n => 10, :offset => 0}.merge(options)\n offset = options[:offset]\n n = options[:n]\n\n shas = []\n return shas if n <= 0\n \n dates = index.values('date').sort.reverse\n index.each_sha('date', dates) do |sha|\n if block_given?\n next unless yield(sha)\n end\n \n if offset > 0\n offset -= 1\n else\n shas << sha\n break if n && shas.length == n\n end\n end\n \n shas\n end",
"title": ""
},
{
"docid": "0d9d17608e49342b331ab32583c3005a",
"score": "0.42983246",
"text": "def time_travel_offsets\n @time_travel_offsets ||= []\n end",
"title": ""
},
{
"docid": "3347c490f3680eb0903b55ded9a275ab",
"score": "0.42959586",
"text": "def standard_offset=(value)\n @standard_offset = value\n end",
"title": ""
},
{
"docid": "ccd4cb34c9c0360ae23408a742af55b7",
"score": "0.42879975",
"text": "def index(loc, offset=0) end",
"title": ""
},
{
"docid": "50ef2fa8b449503e23ebe2cee11a26c4",
"score": "0.42828333",
"text": "def lineoffsets\n result = {}\n offsetlines.each do |offset, lines|\n lines.each do |line|\n result[line] ||= []\n result[line] << offset\n end\n end\n result\n end",
"title": ""
},
{
"docid": "9bc390cfeb6b4fd7b9d10d49ee7eaaee",
"score": "0.42736635",
"text": "def set_cookie_hash_offset(opts)\n opts = check_params(opts,[:offsets])\n super(opts)\n end",
"title": ""
},
{
"docid": "985574b2fbc8b5468e7044483017cda6",
"score": "0.42653403",
"text": "def index\n @incoming_service_taxes = IncomingServiceTax.new.index(params[:start_date], params[:end_date])\n end",
"title": ""
},
{
"docid": "5803fb4bc742df5f797f9492cba97609",
"score": "0.42619413",
"text": "def create\n t_start = params[:item][:start_time].to_date.to_s + ' ' + params[:start_hour]\n t_end = params[:item][:end_time].to_date.to_s + ' ' + params[:end_hour]\n params[:item][:start_time] = DateTime.parse(t_start)\n params[:item][:end_time] = DateTime.parse(t_end)\n params[:item][:start_time] = params[:item][:start_time].change(:offset => \"-5\")\n params[:item][:end_time] = params[:item][:end_time].change(:offset => \"-5\")\n\n @item = Item.new(params[:item])\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d3a8b964215e919a0e70c8b6441657b",
"score": "0.42593133",
"text": "def sync_numbers(offset: 0)\n episodes = Episode.published.full.ascending\n .where.not(number: nil)\n .where.not(podbean_id: nil)\n .offset(offset)\n\n episodes.find_each.with_index do |episode, index|\n response = Podbean.update_episode(\n episode.podbean_id,\n {episode_number: episode.number}\n )\n puts \"#{index}, #{response[\"error_description\"]}, #{episode.id}\"\n end\n end",
"title": ""
},
{
"docid": "9e8a3f45f1c5bee0634c07398391ff01",
"score": "0.4240157",
"text": "def get_offset_and_limit\n if @request_params[:offset].present?\n offset = @request_params[:offset].to_i\n offset = 0 if offset < 0\n end\n\n limit = @request_params[:limit].to_i\n if limit < 1\n limit = 25\n elsif limit > 100\n limit = 100\n end\n\n if offset.nil? && @request_params[:page].present?\n offset = (@request_params[:page].to_i - 1) * limit\n offset = 0 if offset < 0\n end\n\n offset ||= 0\n\n @params = {offset: offset, limit: limit}\n end",
"title": ""
},
{
"docid": "e2b35363371233a83c1ebb47d17c3d0a",
"score": "0.42375773",
"text": "def create\n @marker = Marker.new(marker_params)\n\n respond_to do |format|\n if @marker.save\n format.html { redirect_to new_marker_path, notice: 'Marker was successfully created.' }\n format.json { render :show, status: :created, location: @marker }\n else\n format.html { render :new }\n format.json { render json: @marker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12e0af935893e4208e8c3d9e2cba65ba",
"score": "0.42350465",
"text": "def at(offset, year); end",
"title": ""
},
{
"docid": "12e0af935893e4208e8c3d9e2cba65ba",
"score": "0.42350465",
"text": "def at(offset, year); end",
"title": ""
},
{
"docid": "28e60474810905b4292fae87ebfd50db",
"score": "0.42331022",
"text": "def index\n @itineraries = Itinerary.all.order(:start_date)\n respond_to do |format|\n format.html do\n @itineraries = @itineraries.map{ |i| ::ItineraryPresenter.new(i) }\n @itineraries = build_pagination(@itineraries)\n end\n format.json do\n render json: {\n itineraries: @itineraries.map do |itinerary|\n {\n properties: {\n id: itinerary.id,\n start_date: itinerary.start_date,\n end_date: itinerary.end_date,\n available_seat: itinerary.available_seat,\n description: itinerary.description,\n user: itinerary.user,\n start_loc: itinerary.locations.where(is_origin: true).first.address,\n end_loc: itinerary.locations.where(is_origin: false).first.address,\n eta: helpers.distance_of_time_in_words(format(itinerary.start_date), format(itinerary.end_date)),\n }\n }\n end\n }\n end\n end\nend",
"title": ""
},
{
"docid": "a02b77114e275342221d92737729f11e",
"score": "0.42271057",
"text": "def index\n @cadsr_marker_statuses = CadsrMarkerStatus.all\n end",
"title": ""
},
{
"docid": "97cd504406cd3b38c2a332bf5ae27301",
"score": "0.4224015",
"text": "def check_offset(*)\n false\n end",
"title": ""
},
{
"docid": "d1976ddd73d03e6a05a09facfff1fd30",
"score": "0.42233008",
"text": "def offset\n @offset/86400.0\n end",
"title": ""
},
{
"docid": "ae8c0a3bd036590b2fef5121e874a4ed",
"score": "0.4223016",
"text": "def input_end_offset\n _response_word.fetch(\"endingPos\", nil)\n end",
"title": ""
},
{
"docid": "5806527bbd3cab282eac2f0e1257c072",
"score": "0.42222175",
"text": "def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"title": ""
},
{
"docid": "5806527bbd3cab282eac2f0e1257c072",
"score": "0.42222175",
"text": "def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"title": ""
}
] |
6cd65f4ed032cfea512930b1a7d6c11a
|
Loop to browse other users poem
|
[
{
"docid": "2e479496c6c4a944a172584287db6963",
"score": "0.0",
"text": "def loop_zap(pplog)\n loop do\n p pplog.zapping\n sleep 12\n end\nend",
"title": ""
}
] |
[
{
"docid": "f4d295a6d6da4671ad4b8b56dbc8927e",
"score": "0.5573189",
"text": "def main()\n\tgroups = []\n\tputs '<openbox_pipe_menu>'\n\tget_pids().each do |pid|\n\t\tprocess = ProcessInfo.new(pid)\n\t\tadd_to_group(groups, process)\n\tend\n\t\n\tusers = []\n\tgroups.each do |group|\n\t\tusers << [group.user, group.username]\n\tend\n\tusers.uniq!.sort!.reverse!\n\t\n\tusers.each do |user, username|\n\t\tputs '<separator label=\"%s\"/>' % username\n\t\tgroups.each do |group|\n\t\t\tif group.user == user\n\t\t\t\tgroup.get_entry()\n\t\t\tend\n\t\tend\n\tend\n\n\t\n\tputs '</openbox_pipe_menu>'\nend",
"title": ""
},
{
"docid": "f09d9b9f54ae3bffef03d250ed3cd9fb",
"score": "0.54326504",
"text": "def index\n @desired_pokemons = current_user.desired_pokemons\n end",
"title": ""
},
{
"docid": "b13705a7a49e3f4a5b64aede28a4fa68",
"score": "0.542016",
"text": "def view_all_users\n # !! get all user so can interact after viewing them? all_users\n # User.select(:username).each_with_index {|user, index| puts \"#{index+1}. #{user.username}\"}\n #??????\n User.select(:username).each {|user| puts user.username}\n end",
"title": ""
},
{
"docid": "7ff70967ba73a0c62db54996acb6d763",
"score": "0.5397875",
"text": "def print_my_jokes\n jokes = Joke.where(user: self)\n puts \"Your jokes are:\"\n jokes.each do |joke|\n Joke.print_a_joke(joke)\n end\n end",
"title": ""
},
{
"docid": "d6ccd491499762cdc1778d48e2f6672e",
"score": "0.53809524",
"text": "def print_tweet(users)\r\n # ADD CODE TO ITERATE THROUGH EACH TWEET AND PRINT ITS TEXT\r\n users.each do |user| \r\n puts user\r\n end\r\nend",
"title": ""
},
{
"docid": "c96102e7b1917b19d8aed912731f15b6",
"score": "0.5358182",
"text": "def poem\n fetch('tolkien.poems')\n end",
"title": ""
},
{
"docid": "9fd96c5a783c4b1cd8896818b8263f2a",
"score": "0.5339045",
"text": "def see_all_trails\n trail_array = []\n hiker.trails_by_hiker.map do |trail|\n trail_array << trail.name \n end.uniq\n puts \"You have hiked in: #{trail_array}\"\n all_trail_input = $prompt.select(\"Press enter to continue\",[\"Enter\"])\n system \"clear\"\n user_path\n end",
"title": ""
},
{
"docid": "36cdfbd8f9523ae7c463fa7dda886872",
"score": "0.5310216",
"text": "def profile\n\n # get only records from this username\n usermeetings = Usermeeting.where(user_id: User.find_by_username(params[:username]).id)\n # TODO: this is for sort/ordering meeting on profile page\n meetings = usermeetings.map { |usermeeting| usermeeting.meeting }\n @meetings = meetings.sort_by {|meeting| meeting.time}\n @user = (params[:username])\n @user = User.find_by_username(params[:username])\n\n #this gives a list of saved words for current user\n if user_signed_in?\n @keywords = current_user.searches\n else\n redirect_to \"/users/sign_in\"\n end\n ## create a list of meetings with those keywords\n end",
"title": ""
},
{
"docid": "585f1578cded461fec36b1036afbeca7",
"score": "0.5292248",
"text": "def lend_to_others\n @user_profile = UserProfile.find(current_user.id)\n @items = @user_profile.items\n end",
"title": ""
},
{
"docid": "3c7a0075ee577664bf9d9905a5d803ed",
"score": "0.5271764",
"text": "def index\n\n @pokemons = current_user.pokemons\n \n end",
"title": ""
},
{
"docid": "73e73ab2373a8a39659c8c70dead8e87",
"score": "0.52492857",
"text": "def list\n @theorem_pages, @theorems = paginate :theorems, :per_page => 10, :conditions => [\"user_id = ? \", session[:user_id]]\n end",
"title": ""
},
{
"docid": "45295102047450a2cd475d6b4fd281b6",
"score": "0.52352464",
"text": "def user\n\tt = []\n\tville = nom_ville\n\tville.each do |i|\n\t\tCLIENT.search(i).take(1).collect do |tweet|\n\t\t\tt.push(\"#{tweet.user.screen_name}\") \n\n\t\tend\n\t end\nreturn t\nend",
"title": ""
},
{
"docid": "f4c96df6a916bfd377952fd02a77961a",
"score": "0.5224271",
"text": "def index\n @owned_pokemons = current_user.owned_pokemons\n end",
"title": ""
},
{
"docid": "4cad08e01b70455d46840d58963f1192",
"score": "0.5212464",
"text": "def auto_complete_result_2(users)\n return unless users\n items = []\n i = 0\n for entry in users\n pic = image_tag entry.avatar_photo_url(:thumb), :size => \"25x25\"\n needs_birthday = (i > 0 && entry.name == users[i-1].name) ||\n\t (users[i+1] && entry.name == users[i+1].name)\n\n items << content_tag(\"li id=#{entry.id}\",\n render(:partial => \"member\",\n :locals => { :distinguish => needs_birthday, :member => entry }));\n i = i+1\n end\n content_tag(\"ul\", items)\n end",
"title": ""
},
{
"docid": "2ab3e08c0149117d8fd4eb7c1b2e2c1a",
"score": "0.51991844",
"text": "def show_all_bills(user)\n user.bills.each do |bill|\n puts bill.name\n end\n go_back_to_start(user)\nend",
"title": ""
},
{
"docid": "a65b8477c28d7b8c799a573817be57fa",
"score": "0.519841",
"text": "def index\n # Retrive conversations where the hirer is the current user\n hc = Conversation.where(hirer: current_user)\n # Get conversations where the owner is the current user\n oc = Conversation.where(owner: current_user)\n # Get conversations that involve current user \n @conversations = hc|oc\n end",
"title": ""
},
{
"docid": "d00ee5350ba8ac77b1de983ca8978ffa",
"score": "0.5185298",
"text": "def poke(another_user)\n # Write code to puts who is poking who and increase the pokees number of pokes by 1\n end",
"title": ""
},
{
"docid": "6476b35bd3ef53c1fcfda9fb115948d6",
"score": "0.5180004",
"text": "def participantes(feedParser) \n feed_parser = feedParser\n \n jogadores = feed_parser.get_users(\"\")\n criaListaJogadores = Jogadores.new DIR_XML_FILES + \"participantes.xml\"\n criaListaJogadores.add_jogadores jogadores\n p \"#{DIR_XML_FILES}participantes.xml [OK]\"\n \n duplas = feed_parser.get_users(\"duplas\")\n criaListaDuplas = Jogadores.new DIR_XML_FILES + \"duplas.xml\"\n criaListaDuplas.add_jogadores duplas\n p \"#{DIR_XML_FILES}duplas.xml [OK]\"\n end",
"title": ""
},
{
"docid": "cdba8a4639b5a3b4659a4b7972ac17e3",
"score": "0.5138322",
"text": "def process_list what, username, web\n puts \"Fetching #{what} page 1...\"\n\n url = \"http://www.foodspotting.com/#{username}/#{what}\"\n web.get url\n\n last_page = get_last_page web\n names = get_names web\n\n (2..last_page).each { |page|\n puts \"Fetching #{what} page #{page}...\"\n web.get \"#{url}?page=#{page}\"\n\n names += get_names web\n }\n\n names\nend",
"title": ""
},
{
"docid": "8c2754a97bf822538822b737540d4a99",
"score": "0.5126814",
"text": "def index\n #Esta línea ya no es necesaria porque el administrador se agrega como Scrum Master\n #@proyectos = current_user.proyectos\n @proyectos = []\n @miembros = current_user.miembros\n @miembros.each do |miembro|\n @proyectos = @proyectos + [miembro.proyecto]\n end\n @proyectos = @proyectos.paginate(:page => params[:page], :per_page => 10)\n \nend",
"title": ""
},
{
"docid": "3857a9f3690f567cf24aabf21a788e92",
"score": "0.51226646",
"text": "def index\n @userpokes = Userpoke.all\n end",
"title": ""
},
{
"docid": "38abadea567750b920932d3028d24840",
"score": "0.51202124",
"text": "def index\n @user = User.find(params[:user_id])\n @proposals = @user.proposals.all\n end",
"title": ""
},
{
"docid": "f5091ca316be5af9cff6825f78145e83",
"score": "0.5107969",
"text": "def auto_complete_result_2(users)\n return unless users\n items = []\n i = 0\n for entry in users\n pic = image_tag entry.avatar_photo_url(:thumb), :size => \"25x25\"\n if (i > 0 && entry.name == users[i-1].name) || (users[i+1] && entry.name == users[i+1].name)\n items << content_tag(\"li\", pic+\"#{h(entry[:login])}\n [#{entry.birthday.strftime(\"%m-%d-%Y\")}]#{entry.id}\")\n else\n items << content_tag(\"li\", pic+\"#{h(entry[:login])}\")\n end\n i = i+1\n end\n content_tag(\"ul\", items)\n end",
"title": ""
},
{
"docid": "9da6f29f25ff2602b0fca64ffc5579a4",
"score": "0.5107199",
"text": "def process_list what, web\n puts \"Fetching #{what} page 1...\"\n\n base_url = 'https://www.flickr.com/people/me/contacts/'\n base_url += 'rev/' if what == :follower\n web.get base_url\n username = get_user_name web\n\n last_page = get_last_page web\n names = get_names web\n\n # Only the first page can use people/me. Subsequent pages need the actual\n # user name.\n base_url = \"https://www.flickr.com/people/#{username}/contacts/\"\n base_url += 'rev/' if what == :follower\n\n (2..last_page).each { |page|\n puts \"Fetching #{what} page #{page}...\"\n web.get \"#{base_url}?page=#{page}\"\n\n names += get_names web\n }\n\n names\nend",
"title": ""
},
{
"docid": "bb06188f2210e657ba675c1952ba3533",
"score": "0.5085916",
"text": "def prompts(name)\n\tcurr_user = check_user(name)\n\n\twhile true do\n\t\t\tif main_prompt_options(curr_user) == false\n\t\t\t\t\tbreak\n\t\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "e221e389354b0369f763afdfb3f834cd",
"score": "0.5077085",
"text": "def each_user\n user_list = []\n if datastore['USERNAME'] && !datastore['USERNAME'].empty?\n user_list << datastore['USERNAME']\n else\n f = File.open(datastore['USER_FILE'], 'rb')\n buf = f.read\n f.close\n\n user_list = (user_list | buf.split).uniq\n end\n\n user_list.each do |user|\n yield user\n end\n end",
"title": ""
},
{
"docid": "86622d49a74dcc564dfc31097451b1ff",
"score": "0.5068485",
"text": "def index\n @user = current_user\n\t @mensagens = Mensagen.where(:destinatario => @user).paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "17a9af4d037a3af9ea2cd69cb38deb19",
"score": "0.5067908",
"text": "def index\n @t_scope = [:pois, :index]\n @my_pois = Poi.where(owner: current_user)\n if current_user.admin?\n @other_pois = Poi.where.not(owner: current_user)\n end\n end",
"title": ""
},
{
"docid": "09f3f8150fc83f8d5935d082ec1b289a",
"score": "0.5053022",
"text": "def names_by_editor # :nologin: :norobots:\n if user = params[:id] ? find_or_goto_index(User, params[:id]) : @user\n query = create_query(:Name, :by_editor, :user => user)\n show_selected_names(query)\n end\n end",
"title": ""
},
{
"docid": "71fe197f024cb33de4f1bb086c37c4c0",
"score": "0.5051098",
"text": "def list_users\n User.all.each do |user|\n puts\n puts user\n puts \"Listing favorite animals for #{user}: \"\n puts user.animals\n end\nend",
"title": ""
},
{
"docid": "48413e9f962f1e6e4f3fbe1f0e7ea160",
"score": "0.5039622",
"text": "def my_followers_mottos\n followers.each { |follower| puts follower.life_motto }\n end",
"title": ""
},
{
"docid": "cf7f4694082398066097d46b8466f8ea",
"score": "0.5038199",
"text": "def list\n puts \"List politicians and voters\"\n @voters.each do |x|\n print \"Voters:\" + \" \"\n print x.voter_name + \" \"\n puts x.voter_political_view\n end\n @politicians.each do |x|\n print \"Politician:\" + \" \"\n print x.politician_name + \" \"\n puts x.politician_party\n end\n puts \"...............................\"\n main_menu\nend",
"title": ""
},
{
"docid": "3406445ed973c9cca4d2609fbefedfe2",
"score": "0.5037322",
"text": "def get_user_items\n user_response = gets.strip.downcase\n puts \"\"\n if user_response == \"done\"\n self.sort_list(self.user_list)\n self.suggestion_of_stores\n elsif user_response == \"exit\"\n abort\n else\n current_item = Item.find_by(name: user_response)\n if current_item\n self.user_list << current_item\n self.get_user_items\n else\n puts \"<Invalid item, please try again.>\"\n puts \"\"\n self.get_user_items\n end\n end\n end",
"title": ""
},
{
"docid": "e28e8d3a83041a3ebd4cea018dcec2d4",
"score": "0.5034612",
"text": "def display_items\n\t\t\tputs \"What user's items would you like to view? Input user ID:\"\n\t\t\tuser_id = gets.chomp\n\n\t\t\tuser=User.find(user_id)\n\t\t\torders = Order.where(user_id: user.id)\n\t\t\torders.each do |order|\n\t\t\t\titem=Item.find(order.item_id)\n\t\t\t\tputs \"You ordered #{order.quantity} #{item.title.pluralize}\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3e1a5845201142fc4e1fdd773a14020d",
"score": "0.5027746",
"text": "def do_stuff\n @userids.each do |user_id|\n \tprint \"\\n\\n~* creating collection for #{user_id}...\"\n \t# check user exists\n unless userExists(user_id) then\n print \"\\n~**** User #{user_id} doesn't exist!!!\\n\"\n next;\n end\n # create the collection etc\n ref_id = generateWidgetId()\n\tprint \"\\n~* collection widget id = #{ref_id}\"\n collection_id = createCollection(ref_id, user_id)\n\tprint \"\\n~* collection content id = #{collection_id}\"\n setAccessOnCollection(collection_id)\n createCollectionGroups(collection_id)\n shareCollectionWithManagers(collection_id, user_id) \n shareCollectionWithMembers(collection_id, user_id)\n\tsetCollectionGroupAccess(collection_id)\n shareCollectionWithGroups(collection_id)\n removeCreatorAsManager(collection_id)\n addCollectionToLibrary(ref_id, collection_id)\n \n # add any default content to the collection\n\t@default_content.each_with_index do | content_data, i |\n\t\tcreateAndAddContent(content_data, i, user_id, collection_id)\n\tend\n\n print \"\\n\"\n end\nend",
"title": ""
},
{
"docid": "4900acf0844f9340f567cca9057245b5",
"score": "0.50258505",
"text": "def index\n @programmes = Programme.where(:user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "65cd6e1b0055683bcb64d908558d19db",
"score": "0.502345",
"text": "def each_user(&block) \n users = @store.transaction(true) do |s|\n s.roots.inject([]) do |r, key| \n (key =~ /^user-/) ? r << s[key] : r\n end\n end\n\n users.each(&block)\n end",
"title": ""
},
{
"docid": "12a7e647455789efe85d6d74665624ff",
"score": "0.5014407",
"text": "def index\n if current_user\n @lead = client.select_pessoas\n pessoas_aux = Pessoa.where(\"user_id = #{current_user.id}\")\n \n @lead.each do |item|\n # verifica se já existe no sistema rdstationdesafio2\n exist = false\n pessoas_aux.each do |pessoa|\n exist = exist || (item.Id == pessoa.salesforce_id)\n end\n \n # se nao existe adiciona ele\n if !exist\n Pessoa.new_from_lead(item, current_user)\n end\n end\n \n @pessoas = Pessoa.where(\"user_id = #{current_user.id}\")\n end\n end",
"title": ""
},
{
"docid": "f830f5442bb66f4f7a47193d921cbb3c",
"score": "0.5013459",
"text": "def pull_songs\n saved_songs = @user.songs\n saved_songs.each_with_index {|song, i|\n puts \"[#{i+1}] #{song.title.gsub(\"%20\", \" \").titleize} by #{song.artist.gsub(\"%20\", \" \").titleize}\"}\n end",
"title": ""
},
{
"docid": "fe3b5efb2124a9541fb04d4773d225c5",
"score": "0.50126636",
"text": "def get_another_user #---->Array\n\t\tputs \"Are there any more guests coming?\"\n\t\tmore_guests = gets.chomp\n\t\tuntil more_guests == \"no\"\n\t\t\tmerge_usr_icecream_choice(get_info)\n\t\t\tputs \"Are there any more guests coming?\"\n\t\t\tmore_guests = gets.chomp\n\t\tend\t\n\t\t@ice_cream_hash\t\n\n\t\t@ice_cream_hash.each do |key, value|\n\t\t\[email protected](value)\n\t\tend\n\t\[email protected]\n\tend",
"title": ""
},
{
"docid": "cbcc7e5dd01cd9162e81180f0c9d45ea",
"score": "0.500179",
"text": "def show\n @user = @profile.user\n @leafs = @profile.user.leafs.page(params[:all])\n @facebook = FacebookPage.where(:user_id => @user.id)\n # @public_photos = Photo.where(:user_id => @user.id, :public => true)\n @conversations = @user.mailbox.inbox\n @receipts = []\n\n @conversations.limit(6).each do |convo|\n @receipts << convo.receipts_for(@user)\n end\n\n @client = Twitter::REST::Client.new do |config|\n config.consumer_key = \"sUedRjJ0a8oHJJfHcnO1x5xBV\"\n config.consumer_secret = \"HikKRSrM2gNNDLRakwCGW1tYj3RkGrErISgE0HT8JqRr3pHVmR\"\n config.access_token = @profile.user.twitter_token\n config.access_token_secret = @profile.user.twitter_secret\n end\n\n if @profile.twitter_handle != \"\" && @profile.user.twitter_secret != nil\n @twitter = @client.user(@profile.twitter_handle)\n else\n @twitter = nil\n end\n \n\n end",
"title": ""
},
{
"docid": "28199f39bd600029a3132f8aa5a3337f",
"score": "0.49915493",
"text": "def explore\n @users = User.all\n end",
"title": ""
},
{
"docid": "11da8508042ed02335fd5cac2c6227ca",
"score": "0.49895966",
"text": "def show_all_swim_meets\n puts \"Names of all the Swim Meets\"\n SwimMeet.all.each{|swim_meet| puts swim_meet.name}\n puts \"\\nReturn the menu? Press any key to return the menu\"\n gets.chomp\n swim_meet_method\n end",
"title": ""
},
{
"docid": "bd17ca67f964a7aa0fe25096010df221",
"score": "0.49878332",
"text": "def personal\n @jobs = Tweet.where(:approved => true).where(:author_id => current_user.uid).order('created_at DESC')\n end",
"title": ""
},
{
"docid": "4b1453e46cf659f5974bbd52c358db93",
"score": "0.49831396",
"text": "def index\n path = @client.folder_from_path(@user_folder_name)\n @folder_items = @client.folder_items(path)\n @folder_items.each {|i| puts i.name}\n end",
"title": ""
},
{
"docid": "20b14ff659f4322a2d0351ffbdd47622",
"score": "0.49814555",
"text": "def give_user_choices\n @choices.each do |choice|\n @xml.Say(\"Press #{choice.digits} if you would like to \")\n choice.view_block.call\n end\n end",
"title": ""
},
{
"docid": "20b14ff659f4322a2d0351ffbdd47622",
"score": "0.49814555",
"text": "def give_user_choices\n @choices.each do |choice|\n @xml.Say(\"Press #{choice.digits} if you would like to \")\n choice.view_block.call\n end\n end",
"title": ""
},
{
"docid": "534d22fe19b9a54edbba26dc5ee461b9",
"score": "0.49806422",
"text": "def start_chatting_with_friends_of(user_handles=[])\n puts \"Finding who #{user_handles} follows...\"\n friends = @people_browser.find_all_friends_of_handles(user_handles)\n puts \"Total people #{user_handles} follows = #{friends.length}\"\n start_delayed_tweet_processor\n setup_friends_event_loop(friends)\n end",
"title": ""
},
{
"docid": "fe30d514b641044f4f8d1e5d71e61f8b",
"score": "0.4979058",
"text": "def my_followers_mottos\n self.followers.each do |follower|\n puts follower.life_motto\n end\n end",
"title": ""
},
{
"docid": "fe30d514b641044f4f8d1e5d71e61f8b",
"score": "0.4979058",
"text": "def my_followers_mottos\n self.followers.each do |follower|\n puts follower.life_motto\n end\n end",
"title": ""
},
{
"docid": "20d2413f3ea4cba42cd8de45bb65e21c",
"score": "0.49747986",
"text": "def index\n messages = @conversation.messages.order('created_at DESC')\n\n messages.each do |m|\n if m.user_id != @current_user.id\n m.read = true;\n m.save\n end\n end\n \n paginate json: messages\n end",
"title": ""
},
{
"docid": "54f970ee5768d76a8818f20a25600939",
"score": "0.49747983",
"text": "def looping",
"title": ""
},
{
"docid": "045cae151f6aa0521806ece9eda9f073",
"score": "0.49726266",
"text": "def index\n @pillboxes = Pillbox.where(user_id: current_user.id)\n @users = User.where(id: current_user.id)\n end",
"title": ""
},
{
"docid": "92dc449c488edf44005a5c9467245e42",
"score": "0.49710634",
"text": "def show\n \t@user = User.find(params[:id])\n if @user.ninja?\n @new_comment_items = @user.new_comment.paginate(page: params[:page])\n @responded_items = @user.responded.paginate(page: params[:page])\n else\n @answered_items = @user.answered.paginate(page: params[:page])\n @pending_items = @user.pending.paginate(page: params[:page])\n end\n end",
"title": ""
},
{
"docid": "f46965e5b8a04fd2d18bd572186b4451",
"score": "0.49617025",
"text": "def explore\n @posts = Post.all\n @activity = Activity.all\n @user = User.all\n end",
"title": ""
},
{
"docid": "6a555ba2967f62e36a05dd54cf84dc95",
"score": "0.49616662",
"text": "def list_all_users\n all_users = User.all\n all_users.each_with_index do |user|\n print_resuslts(user)\n end\nend",
"title": ""
},
{
"docid": "0996ab4c453ba8b6d394f371dad0116f",
"score": "0.49558997",
"text": "def all(user_name, authentication)\n try_or_check_login authentication\n\n session_visit user_name\n @session.save_and_open_page\n\n parse_boards get_with_ajax_scroll(BOARD_ITEM_CSS)\n end",
"title": ""
},
{
"docid": "06b59e731a9a8e552a6614827b8df30e",
"score": "0.49522382",
"text": "def index\n @pots = current_user.pots\n end",
"title": ""
},
{
"docid": "6d6eedf86e8fe69b9a46c14f3b50bff4",
"score": "0.49502784",
"text": "def name_descriptions_by_editor # :nologin: :norobots:\n if user = params[:id] ? find_or_goto_index(User, params[:id]) : @user\n query = create_query(:NameDescription, :by_editor, :user => user)\n show_selected_name_descriptions(query)\n end\n end",
"title": ""
},
{
"docid": "dd64d33a9c38b48a491986a6e156a7fe",
"score": "0.49489897",
"text": "def my_user \n\n # checks if there's information to show\n if @user.owned_movies.empty? && @user.rented_movies.empty?\n self.clear()\n puts \"No existe ninguna transacción aún.\".bold()\n return\n end\n\n # prints the lists of rented and purchased movies\n puts \"\\nPelículas Compradas: \".bold()\n puts @user.owned_movies\n\n puts \"\\nPelículas Alquiladas: \".bold()\n puts @user.rented_movies\n\n # asks if user wants to consult the information of a movies\n puts \"\\n\"\n response = prompt \"¿Desea consultar la información de alguna de estas películas? [N/y] \"\n \n while response == \"y\"\n puts \"\\n\"\n # asks for movie name\n movie_name = prompt \"Ingrese el nombre de la película que desea consultar: \"\n\n # check if the movie is on the list\n while (! @user.owned_movies.include? movie_name) && \n (! @user.rented_movies.include? movie_name) &&\n (movie_name != \"Salir\")\n puts \"\\nPelicula no encontrada. \".bold() + \n \"Debe ingresar alguna alquilada o comprada por usted.\"\n puts \"Puede escribir 'Salir' para regresar al menu principal.\\n\"\n movie_name = prompt \"Ingrese el nombre de la película que desea consultar: \"\n end\n\n if movie_name != \"Salir\"\n # prints the movie information\n movie = (@movies.scan(:name) { |name| name == movie_name }).first\n puts \"\\n#{movie}\\n\"\n\n # asks if user wants information about a Person in the movie\n response2 = prompt \"¿Desea consultar la información de algun actor o director \" + \n \"de esta pelicula? [N/y] \"\n \n while response2 == \"y\"\n # asks for the name of the person\n person_name = prompt \"\\nIngrese el nombre de la persona que desea consultar: \"\n\n # checks that the person is valid\n while (! movie.actors.include? person_name) && \n (! movie.directors.include? person_name) &&\n (person_name != \"Salir\")\n puts \"Persona no encontrada. Debe ser un actor o director de #{movie.name}.\"\n puts \"Puede escribir 'Salir' para seleccionar otra pelicula.\"\n person_name = prompt \"Ingrese el nombre de la persona que desea consultar: \"\n end\n\n # prints the information of the Person if required\n if person_name != \"Salir\"\n puts \"\\n#{@persons[person_name]}\\n\"\n response2 = prompt \"¿Desea consultar la información de algun otro actor o \" + \n \"director de esta pelicula? [N/y]\"\n else\n response2 = \"N\"\n end\n end\n \n # checks if wants to keep consulting movies\n response = prompt \"¿Desea consultar la información de alguna otra película? [N/y]\"\n else\n response = \"N\"\n end\n end\n\n self.clear()\n end",
"title": ""
},
{
"docid": "e227d96f8b594ee7013d7816df6253c1",
"score": "0.49476466",
"text": "def user_journal_page\n prompt = TTY::Prompt.new\n selected_promt = prompt.select(\"Main Menu | User: #{@selected_user.username}\", \"[logout]\", \"All journals\" , \"Create new journal\", \"View By Title\", \"Exit\")\n if selected_promt == \"[logout]\"\n user_startapp\n elsif selected_promt == \"All journals\"\n display_user_journals\n elsif selected_promt == \"View By Title\"\n if JournalEntry.all_user_journal(@selected_user.id) == []\n puts \"You have no Journals :(\"\n user_journal_page\n else \n select_by_title\n end\n elsif selected_promt == \"Create new journal\"\n create_new_entry\n end\n end",
"title": ""
},
{
"docid": "341073b314254febed9822b3f3995953",
"score": "0.49445534",
"text": "def likeEveryone(pyro, bot)\n liked = 0\n rng = Random.new\n \n begin\n begin\n puts \"Fetching reccomendations...\"\n # Get some users\n recs = pyro.get_nearby_users\n profiles = recs[\"results\"]\n\n if rng.rand(100) > 0 then\n puts \"Checking for updates\"\n update(pyro, bot)\n end\n \n while (recs[\"message\"] == \"recs timeout\" or !profiles)\n # Update and wait until users are available\n puts \"Checking for updates\"\n update(pyro, bot)\n sleep(30)\n recs = pyro.get_nearby_users\n profiles = recs[\"results\"]\n end\n\n\n # Iterate each profile\n for p in profiles\n puts \"Liking \"+p[\"name\"]\n\n # User id\n id = p[\"_id\"]\n FileUtils::mkdir_p 'profiles/'+id\n\n puts \"id: \"+id\n\n File.open(\"log.txt\", 'a') do |f|\n f.write(\"Liking #{p[\"name\"]}\\n\")\n f.write(\"#{p[\"_id\"]}\\n\")\n end\n\n # Save picture\n begin\n File.open(\"profiles/\"+id+\"/\"+p[\"photos\"][0][\"fileName\"], \"wb\") do |f| \n f.write HTTParty.get(p[\"photos\"][0][\"processedFiles\"][0][\"url\"]).parsed_response\n end\n rescue Exception => msg\n puts \"Couldn't retrieve picture\"\n end\n\n File.open(\"profiles/\"+id+\"/profile.json\", 'w') do |f|\n f.write(p)\n end\n\n # Like her!\n pyro.like(id)\n liked += 1\n\n end\n\n puts \"Like #{liked} profiles so far!!!\"\n #puts \"UPDATES\"\n #puts pyro.fetch_updates\n \n rescue Exception => msg\n puts \"Error!!!!\"\n puts msg\n sleep(300)\n end\n\n end while (recs[\"status\"] == 200)\nend",
"title": ""
},
{
"docid": "6b7fe55ef296205efb5e8cbaa9a2877c",
"score": "0.4939309",
"text": "def pp_user_foreign_up_edits(filter=@filter)\n puts pages(f).collect { |p| \n pt = p.title.split(\"/\").first\n [p.title, p.users(f).collect { |u| u.name }.select { |un| pt != un}] \n }.select { |t,ua| !ua.empty? }.collect { |t,ua| \n \"%-45s: %s\" % [t, ua.join(', ')] }.join(\"\\n\") \n end",
"title": ""
},
{
"docid": "6909e382c270483dd7e4d62b15fe2fb0",
"score": "0.49388745",
"text": "def index\n @user = current_user\n @messages_from_user = Message.where(from: @user.id)\n @messages_to_user = Message.where(to: @user.id)\n\n @all_messages = []\n\n @messages_from_user.each do |message|\n @all_messages << message\n end\n\n @messages_to_user.each do |message|\n @all_messages << message\n end\n\n @conversations = []\n @all_messages.each do |message|\n @conversations << message.from if message.from != @user.id\n @conversations << message.to if message.to != @user.id\n end\n\n @conversations.uniq!.map!(){ |id| User.find(id) }\n end",
"title": ""
},
{
"docid": "431e9cdf471f7919e278e11812f93cf9",
"score": "0.49363858",
"text": "def show\n\t\t@officers = @guild.officers.order(\"nickname ASC\") - [@guild.owner]\n\t\t@members = @guild.members.order(\"nickname ASC\") - @guild.officers\n\t\t@invits = @guild.invites.where(state: \"waiting\").map(&:user)\n\tend",
"title": ""
},
{
"docid": "5db838a9733e59d4a4d32efb79e51a69",
"score": "0.49333698",
"text": "def user_joblist\n if @active_user.list.length == 0\n system \"clear\n \"\n puts \"You have not saved any jobs to your profile yet!\n \n \".light_blue\n self.help\n else\n input = @prompt.select(\"Select job using arrow keys and press enter!\", @active_user.list.flatten.map {|i| i.title})\n job = nil\n @active_user.list.flatten.each {|i| job = i if i.title == input }\n puts \"Title: \".light_blue + job.job_profile[0]\n puts \"Company: \".light_blue + job.job_profile[1]\n puts \"Location: \".light_blue + job.job_profile[2]\n puts \"Schedule: \".light_blue + job.job_profile[3]\n puts \"Description: \".light_blue + job.job_profile[4]\n puts \"\"\n self.help\n end\n end",
"title": ""
},
{
"docid": "35cf3cae751ec3203a1615b08b3107b3",
"score": "0.49300185",
"text": "def index_by_user\n # find the user by username\n user = User.find_by(username: params[:user_id])\n # find the prompts by user.id\n @prompts = Prompt.where(user_id: user.id)\n render json: @prompts, include: ['fills', 'user', 'comments']\n end",
"title": ""
},
{
"docid": "39e5f83c3ecd8a6e2d3b76ee8775ba4b",
"score": "0.49297103",
"text": "def show\n\n\n @users = @project.like_by_users\n \n \n end",
"title": ""
},
{
"docid": "e3d73124d9bd8eadeae4fb28838377cc",
"score": "0.4927923",
"text": "def print_volunteer_events\n agent = Mechanize.new\n page = agent.get 'https://activities.osu.edu/involvement/service_outreach/'\n temp = page.at('//*[@id=\"ctl00_ContentBody_pageFormControl_OppOrgSearch\"]/h4').text.split.join(' ')\n entries = temp.match(/\\d+/)[0].to_i # extracts index\n m = 0\n puts 'Optional Volunteer Events: More details on https://activities.osu.edu/involvement/service_outreach/'\n puts\n begin\n page = agent.get \"https://activities.osu.edu/involvement/service_outreach/?page=#{m / 5}&d=u\"\n puts page.at(\"//ul/li[#{ (m % 5) + 1 }]/div[1]/div[1]/a/text()\").text.strip\n m += 1\n end until entries == m\nend",
"title": ""
},
{
"docid": "d7305e28ad5efdd94200ff9faec11206",
"score": "0.49273643",
"text": "def show\n\t\t@recipient_usered_orders = @user.recipient_usered_orders.all\n\t\t@recipient_count = @user.recipient_usered_orders.where(read:false).count\n\t\t@sender_usered_orders = @user.sender_usered_orders.all\n\t\t@services = @user.services.paginate(:page => params[:page], :per_page => 5)\n\t\t@favorites = @user.favorites.paginate(:page => params[:page], :per_page => 5)\n\t\t@locations = @user.locations\n\t\t@conversations = Conversation.involving(current_user).order(\"created_at DESC\")\n\tend",
"title": ""
},
{
"docid": "6f9f15c43ba8a2770cb2edcefa7f18c7",
"score": "0.49265456",
"text": "def extract_mentions_from_page(document, name)\n mentions = []\n html = Nokogiri::HTML(document.output)\n html.css('#text p').each do |para|\n # Get the id of the para\n para_id = para.attr('id').split('-')[1]\n anchors = extract_anchors_from_para(para, name)\n # Find all links to this entity in the current para\n anchors.each do |anchor|\n mentions += extract_mentions_from_para(document, para_id, para, anchor)\n end\n end\n mentions\n end",
"title": ""
},
{
"docid": "92f500e2ae6d295aee951001614c5aef",
"score": "0.4926127",
"text": "def index\n if !@current_user.admin?\n redirect_to '/home'\n end\n\n @prompts = Prompt.paginate(:page => params[:page], :per_page => 15)\n end",
"title": ""
},
{
"docid": "4396fade12f6e6ae5df75765fcf3eaa3",
"score": "0.49234834",
"text": "def search_user(user)\n puts \"-- Enter User Name, or 'all' for a current list of ticketholders.\".colorize(:blue)\n name_input = gets.chomp\n if name_input.downcase == \"all\"\n self.user_by_number\n elsif\n name_input = User.all.find_by(name: name_input)\n self.user_by_name(name_input)\n else\n self.user_menu(user)\n end\n end",
"title": ""
},
{
"docid": "7ec244888ece026fdf43d2ce446919dd",
"score": "0.4922401",
"text": "def index\n @sentences = current_user.view_model.sentences_with_pagenate(params[:page], PER)\n end",
"title": ""
},
{
"docid": "a12f12ac006e9a760f23583a192d3821",
"score": "0.49148825",
"text": "def retrieve_participations\n\tDir.glob(\"#{url}/security/user-roles.xml\").each do |filename|\n\t content = IO.readlines(filename).join\n doc = Nokogiri::XML(content)\n\t doc.xpath('//user-roles/user').each do |udata|\n\t u = User.find_by_name(udata['name'])\n\t\tunless u.nil?\n\t\t p = Participation.create(:project => self, :user => u)\n\t\t udata.xpath('role').map{|i| i['name']}.each{|r| p.roles << r}\n\t\t p.save\n\t\t Place.logger.info(\"saved participation: #{u.name}, #{self.name}\")\n\t\tend\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "97635b68af9d7cc702b8266a094dd880",
"score": "0.49144143",
"text": "def contributors\n users = []\n self.paragraphs.each do |para|\n unless para.user_id.nil?\n user = User.find(para.user_id)\n if !users.include? user\n users.push(user)\n end\n end\n end\n users\n end",
"title": ""
},
{
"docid": "69a04d195b57c615df93537cf6ca18f5",
"score": "0.49143335",
"text": "def avatar_iterator\n# select the fb_people table and get the all table\nresult = @@client.query(\"SELECT * FROM crawler.avatar\", :async => true)\n# loop the results\nresult.each do |row|\n# vanity interpretation of te fb_user\nusername = row[\"usuario\"]\npassword = row[\"contrasenia\"]\n# Exception Handling\nbegin\n# Waituntil the process is finished\nWaitUtil.wait_for_condition(\"my_event to happen\", :timeout_sec => 100, :delay_sec => 2.5, :verbose => true) do\n# go to the vanity page\nstart username , password\nend\n# Catch for the Exception Handling\nrescue Exception => e\n# puts the message\nputs e.message\n# backtrace and ispect\n#puts e.backtrace.inspect\nend\nend\n# scrapper for the look up on the json property\nFbScrapper.lookup_in_json 'uid'\nend",
"title": ""
},
{
"docid": "9d9877b47d9db3054d18699016d9a7f7",
"score": "0.49097082",
"text": "def view_lunch_favorites\n favorite_lunches = @person.lunches.where(is_favorite: 1)\n places = favorite_lunches.map do |lunch|\n lunch.food_suggestion.suggestion\n end.uniq\n\n if places.size > 0\n puts \"\n Here are your favorite places:\n \"\n places.each do |place|\n puts place\n end\n\n remove_favorite?\n else\n puts \"\n You have no favorite places!\n \"\n menu\n end\n\n end",
"title": ""
},
{
"docid": "f58e2e7c6732858a3536a52b80ad4919",
"score": "0.4908734",
"text": "def scrape_from_user(user_body)\n @user = user_body\n # @found = Array.new\n # @database.log(match)\n if meets_preferences?\n user_ = user_body\n @body = user_[:body]\n messenger.section \"Scraping: leftbar\" if $verbose\n array = @body.scan(/\\/([\\w\\d_-]+)\\?cf\\=leftbar_match/)\n array.each { |user| @database.add_user(username: user.shift, gender: $gender, added_from: \"leftbar\") }\n messenger.section \"Scraping: similar users\" if $verbose\n similars = @body.scan(/\\/([\\w\\d _-]+)....profile_similar/)\n similars = similars.to_set\n similars.each do |similar_user|\n similar_user = similar_user.shift\n if user_[:gender] == $gender || user_[:gender] == $alt_gender\n @database.add_user(username: similar_user, gender: user_[:gender], added_from: \"similar_users\", city: user_[:city], state: user_[:state])\n end\n end\n else\n messenger.error \"Similar users not scraped: #{@user[:handle]}\" if $verbose\n end\n\n\n end",
"title": ""
},
{
"docid": "98357f5c0141ccbb58dcb533719f3d10",
"score": "0.4903821",
"text": "def show\n # user private home page\n @user = User.find(params[:id])\n @current_group=Group.find(@user.current_group)\n \n @inbox_microposts=@current_group.microposts.paginate(:include => [:user, :replies], page: params[:page]).per_page(20)\n @outbox_microposts=current_user.my_group_posts.paginate(:include => :user, page: params[:page]).per_page(20)\n \n @micropost = current_user.microposts.build if signed_in?#used for compose new pose\n @reply=current_user.replies.build\n end",
"title": ""
},
{
"docid": "05cf42aa3d6d25a2e73ffba37c49157d",
"score": "0.4901263",
"text": "def list\n\t\tputs \"\"\n\t\tputs \" *~*~*~*~*~*~*~*~*~*~*~*~*~*\"\n\t\tputs \"Voters:\"\n\t\tprint_confirmation(@voters)\n\t\t\n\t\tputs \"Politicians:\"\n\t\tprint_confirmation(@politicians)\n\t\t\n\t\tputs \"Please (C)reate a person to view the (L)ist.\" if @voters.none? && @politicians.none?\n\t\tmain_menu\n\tend",
"title": ""
},
{
"docid": "2aff6b125e056463c353c9f01886ecda",
"score": "0.4899521",
"text": "def index\n @poems = Poem.reorder(\"title ASC\").paginate(page: params[:page], :per_page => 25)\n end",
"title": ""
},
{
"docid": "46f9f125c425cc7aae664fc9ff9d2c20",
"score": "0.4897949",
"text": "def index\n @heros = current_user.heros\n end",
"title": ""
},
{
"docid": "b06afa1608ffec0081b41efab3330f9f",
"score": "0.4896656",
"text": "def read_items(count=20)\n create_entries get_user_items('read',:n => count)\n end",
"title": ""
},
{
"docid": "46fc50d76184e25d386316ce1ef9af4d",
"score": "0.48946178",
"text": "def users_run text\n x = 0\n i = 0\n info = []\n while x < text.length\n curr_text = split_line(text, x)\n info = users curr_text[2]\n i = 0\n\n\n for i in 0...info.length\n giv = i\n rec = i + 1\n amount = i + 2\n\n if (search_users @users, info[i])\n billcoin_handler_giver info[giv], info[amount].to_i\n else\n add_user info[giv], 0, info[amount].to_i\n end\n\n if (search_users @users, info[rec])\n billcoin_handler_receiver info[rec], info[amount].to_i\n else\n add_user info[rec], 1, info[amount].to_i\n end\n i += 3\n end\n x += 1\n end\n end",
"title": ""
},
{
"docid": "2c7823036206b29437e89f49042e0220",
"score": "0.48942986",
"text": "def show_users\n begin\n users = @dbClient.query(\"select username,id from users where id != '#{current_user_id}'\")\n if users.count > 0\n user_choices = {}\n for user in users do\n user_choices[user[\"username\"]] = user[\"id\"]\n end\n transfer_money user_choices\n else\n @prompt.say(\"No accounts found.\")\n end\n rescue => exception\n puts exception\n end\n \n end",
"title": ""
},
{
"docid": "c3456193edb9dd0b2c4d796b1c347510",
"score": "0.48937985",
"text": "def index\n if @user.profilable_type == \"InvestorProfile\"\n @proposals = Proposal.get_proposals(@user).paginate(page: params[:page], per_page: 2)\n else\n @proposals = Proposal.where(\"enterprise_id IN(?)\", @user.enterprises.ids).paginate(page: params[:page], per_page: 2)\n end\n end",
"title": ""
},
{
"docid": "b221d737dadc2b5e8173bb41746e9de6",
"score": "0.48935625",
"text": "def playlist_iteration_by_name\n puts Rainbow(\"Please, select the name of the Taylist you want to view: \").color(\"ed15a5\")\n i = 0\n Playlist.all.map do |p|\n puts \"#{i + 1}. #{p.name}\\n\"\n i = i + 1\n end\nend",
"title": ""
},
{
"docid": "da0268b0ef0b7ae9ce2b9f9fcd17625e",
"score": "0.48862544",
"text": "def send_new_proposal_notifier_email(user)\n \tuser.each do |u|\n \t\t@user = u\n\t mail( :to => u.email,\n\t :subject => \"My friend recommended you.\" )\n\tend\n end",
"title": ""
},
{
"docid": "d50c4b76b140b97982b6d6532a968fbb",
"score": "0.4881253",
"text": "def for_all_cpanel_users(&block)\n Dir.foreach(user_data_dir) do |filename|\n next if filename == '.' or filename == '..'\n block.call(filename)\n end\n end",
"title": ""
},
{
"docid": "745fdf220d58d2f130164144d49d3f08",
"score": "0.4878047",
"text": "def index\n @resumes = current_user.resumes\n @primary = current_user.primary_resume\n end",
"title": ""
},
{
"docid": "255445ce476549d2652b725d68b3546d",
"score": "0.48754698",
"text": "def index\n if @user\n @pseuds = @user.pseuds.find(:all)\n @rec_counts = Pseud.rec_counts_for_pseuds(@pseuds)\n @work_counts = Pseud.work_counts_for_pseuds(@pseuds)\n @page_subtitle = @user.login\n else\n redirect_to people_path\n end\n end",
"title": ""
},
{
"docid": "80251ab43fe4f16f6e8682e360dbb4ed",
"score": "0.48751637",
"text": "def index\n @owner_prefix = \"#{@user.name}'s\"\n @computers = @user.computers.order(:created_at).page(params[:page])\n end",
"title": ""
},
{
"docid": "37416607d5329e8e623593800c88b5ac",
"score": "0.4875142",
"text": "def display_user_journals\n system \"clear\"\n prompt = TTY::Prompt.new\n user_entrys = JournalEntry.all_user_journal(@selected_user.id)\n if user_entrys == []\n puts \"Sorry you have no journals yet\"\n puts \"********************************\"\n puts \"********************************\"\n user_journal_page\n else \n user_entrys.each do |entry|\n found_location = Location.find_by(id: entry.location_id)\n puts \"Title: #{entry.title}\"\n puts \"Date: #{entry.date} \" + \"location: #{found_location.place}\"\n puts \"\"\n puts \"\"\n puts \"Notes:\"\n puts entry.notes\n puts \"--------------------------------\"\n puts \"--------------------------------\"\n end\n prompt.keypress(\"Press space or enter to continue\", keys: [:space, :return])\n user_journal_page\n end\nend",
"title": ""
},
{
"docid": "61db8e531e1b7cc6250d874f0fa5fa85",
"score": "0.48717275",
"text": "def view_profile\n completed = Action.where(user_id: @@user.id, completion: true)\n if completed != nil \n completed_count = completed.length\n else \n completed_count = 0\n end \n total = Action.where(user_id: @@user.id)\n if total != nil \n total_count = total.length\n else \n total_count = 0 \n end \n PROMPT.say(\"Hello #{@@user.name}, you have completed #{completed_count} out of #{total_count} total actions.\")\n end",
"title": ""
},
{
"docid": "2f5772ca1d482958c9af94e1ec55055a",
"score": "0.487075",
"text": "def scrapp_data\n print \"> \"\n\tputs \"Voici la liste des noms de villes suivies de leurs adresses emails :\"\n\tputs \" \"\n\turl_array = get_townhall_urls\n# Pour chaque URL d'une ville du Val d'Oise, on associe l'adresse email de la mairie :\n\tfor townhall_url in url_array do\n\t\tget_townhall_email(townhall_url)\n\tend\nend",
"title": ""
},
{
"docid": "b15a172602d1f5bf65ab6555ae7c85d5",
"score": "0.48697928",
"text": "def index\n @inboxes = current_user.visible_inboxes.order(created_at: :desc)\n @enviados = current_user.visible_sent.order(created_at: :desc)\n @inboxes = @inboxes.paginate(:page => params[:page], :per_page => 5)\n @enviados = @enviados.paginate(:page => params[:page], :per_page => 5)\n end",
"title": ""
},
{
"docid": "5b200ac34fc163448c1a936b9d35b2f6",
"score": "0.4868464",
"text": "def my_followers_mottos\n # self = cult instante / this cult\n # find this cult's (self) followers\n # iterate through all Blood Oaths\n # select matching self == blood_oath_instance.cult\n # iterate again to select mottos via blood_oath_instance.follower.life_motto\n # puts results\n cult_followers = BloodOath.all.select do |blood_oath_instance|\n blood_oath_instance.cult == self\n end\n cult_followers.select do |blood_oath_instance|\n puts blood_oath_instance.follower.life_motto\n end\n end",
"title": ""
},
{
"docid": "baf41eac2c35d0f36277feafcfc064ec",
"score": "0.48675516",
"text": "def index\n @nests = current_user.nests\n end",
"title": ""
},
{
"docid": "ca53a5855ddfaff81bc74d926c04ec1d",
"score": "0.48674196",
"text": "def user_by_number\n all_names = User.all.find_each.with_index do |person, index|\n puts \"#{index + 1}. #{person.name}\"\n all_names\n end\n puts \"\\n #{\"*\" * 23}\"\n puts \"-- Enter a User's number for more info:\".colorize(:blue)\n num_select = gets.chomp.to_i\n if num_select == User.all.find_by(id: num_select).id\n ticket_info = User.all.find_by(id: num_select).tickets.first.band_name\n user_name = User.all.find_by(id: num_select).name\n puts \"#{user_name} has the following tickets: #{ticket_info}\"\n puts \"-- Would you like to message #{user_name}? Y/N\".colorize(:blue)\n response = gets.chomp\n if\n response.downcase == \"y\"\n puts \"-- We're working to let you message them soon!\".colorize(:blue)\n puts \" \"\n self.user_menu(user)\n else\n self.user_menu(user)\n end\n else\n puts \"It looks like that user doesn't have any current tickets.\".colorize(:blue)\n end\n self.user_menu(self.user)\n end",
"title": ""
},
{
"docid": "225f0214871e98c46c8229c6bda3f34b",
"score": "0.48656446",
"text": "def show\n @open_group = OpenGroup.find(params[:id])\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @open_group }\n # end\n @users = UserOpenGroup.where(\"open_group_id = ?\", params[:id]) \n @usersname = Array.new \n \t\[email protected] do |user| \n \t\[email protected](User.find(user.user_id).name) \n \t\tif current_user.present?\n \t\t\tif user.user_id == current_user.id \n \t\t\t@pesho = true\n \t\t\tbreak\n \t\telse\n \t\t\t@pesho = false \n \t\tend\n \t\tend\n \tend \n\n\t@neshto = OpenGroupPost.where(\"open_group_id = ?\", params[:id]) \n \n @likes = LikesOpenGroup.where(\"open_group_id = ?\", params[:id]) \n @likes.each do |user| \n if current_user.present?\n if user.user_id == current_user.id \n @ivan = true\n break\n else\n @ivan = false \n end\n end\n end\n\n end",
"title": ""
}
] |
86abed7bc9cb3f069c7253fc00a955c4
|
Saves the footnote indicator of a payer Output : result : result of validation or updation error_message : cause for the error
|
[
{
"docid": "9bfc05e95f75f86b6f99fd3e81290c89",
"score": "0.66196567",
"text": "def process_footnote_indicator\r\n footnote_indicator_successfully_updated = true\r\n footnote_indicator_to_be_assigned, tried_to_change_footnote_indicator = footnote_indicator_after_reasoncode_cleanup(params[:payer_footnote_indicator])\r\n if tried_to_change_footnote_indicator\r\n if !footnote_indicator_to_be_assigned.nil?\r\n @payer.footnote_indicator = footnote_indicator_to_be_assigned\r\n footnote_indicator_successfully_updated = true\r\n else\r\n footnote_indicator_successfully_updated = false\r\n error_message = \"Footnote indicator was not successfully updated.\"\r\n end\r\n else\r\n footnote_indicator_successfully_updated = true\r\n end\r\n return footnote_indicator_successfully_updated, error_message\r\n end",
"title": ""
}
] |
[
{
"docid": "2d927d327af67c4ebfe76b28025d90f3",
"score": "0.62404627",
"text": "def save_payer\r\n result = true\r\n error_message = nil\r\n old_payid = @payer.supply_payid\r\n old_footnote_indicator = @payer.footnote_indicator\r\n old_setname = @payer.reason_code_set_name.name unless @payer.reason_code_set_name.blank?\r\n set_name = @payer.get_set_name(params[:payer][:payer_type], params[:payer][:payid])\r\n\r\n result, error_message = process_footnote_indicator\r\n logger.debug \"process_footnote_indicator : #{result}\"\r\n return result, error_message if not result\r\n\r\n normalize_values\r\n @payer.gateway = @payer.get_gateway\r\n logger.debug \"set_name : #{set_name}\"\r\n new_set_name = ReasonCodeSetName.find_or_create_by_name(set_name)\r\n\r\n success = @payer.clean_up_the_rcs_if_set_name_has_changed(new_set_name)\r\n set_name_changed_and_cleaned_up = success\r\n if success && !new_set_name.blank?\r\n @payer.reason_code_set_name_id = new_set_name.id\r\n end\r\n\r\n old_status = @payer.status\r\n if [email protected]?\r\n @payer.status = \"#{Payer::MAPPED}\"\r\n end\r\n if old_status != @payer.status\r\n JobActivityLog.create_activity({:allocated_user_id => @current_user.id,\r\n :activity => 'Payer Approved', :start_time => Time.now,\r\n :object_name => 'payers', :object_id => @payer.id,\r\n :field_name => 'status', :old_value => old_status, :new_value => @payer.status})\r\n end\r\n if !set_name_changed_and_cleaned_up\r\n @payer.clean_up_rcs_if_status_has_changed(old_status, old_footnote_indicator)\r\n end\r\n\r\n #Creating user activity log\r\n if (!old_payid.blank? && @payer.supply_payid != old_payid) || (!old_footnote_indicator.blank? && @payer.footnote_indicator != old_footnote_indicator)\r\n new_rc_set_name = ((success)? new_set_name.name : @payer.reason_code_set_name.name)\r\n activity = \"PAYER EDIT\"\r\n description = \"PayID: old = #{old_payid}, new = #{@payer.supply_payid}, Set Name: old = #{old_setname}, new = #{new_rc_set_name}, FN Indicator: old = #{old_footnote_indicator}, new = #{@payer.footnote_indicator}\"\r\n UserActivityLog.create_activity_log(current_user, activity, @payer, description)\r\n end\r\n \r\n if [email protected]\r\n error_message = 'Payer was not saved'\r\n logger.error \"#{error_message}\"\r\n logger.error \"#{@payer.errors.full_messages.join(\", \")}\"\r\n return false, error_message\r\n \r\n else\r\n if !params[:payer][:payer_type].blank?\r\n if params[:payer][:payer_type].strip == \"#{Payer::PATPAY}\"\r\n @payer.payer_type = params[:payer][:payer_type].strip\r\n else\r\n @payer.payer_type = @payer.id\r\n end\r\n logger.debug \"@payer.payer_type : #{@payer.payer_type}\"\r\n @payer.save\r\n end\r\n end\r\n @payer_id = @payer.id\r\n return result, error_message\r\n end",
"title": ""
},
{
"docid": "fc9ddaaf1ea3b2ddff7896ef0622951f",
"score": "0.61494917",
"text": "def create\n # save any footnotes associated with the data.\n # see application controller for this method\n\tfootnotes = get_footnotes_from_params(params)\n\tFootnote.remove_entries(params[:study_id],\"results\")\n\tFootnoteField.remove_entries(params[:study_id],\"results\")\n\tunless footnotes.empty?\n\t \tfootnotes.each do |fnote|\n\t \t\tmynote = Footnote.new(fnote)\n\t \t\tmynote.save\n\t\tend\n\tend \n \tOutcomeResult.save_data_points(params, params[:study_id])\n\t@message_div = \"saved_item_indicator\"\n\trender 'shared/saved.js.erb'\n end",
"title": ""
},
{
"docid": "10dce3bdb54edfc682fe4ead6d41acc0",
"score": "0.60435605",
"text": "def save_output\n\n end",
"title": ""
},
{
"docid": "844293cba1659b19ef109d68de25b41d",
"score": "0.56548494",
"text": "def validate_footnote_indicator_for_assigning_set_name\r\n result = true\r\n error_message = nil\r\n set_name = params[:rc_set][:name] if params[:rc_set]\r\n if !set_name.blank? && !params[:payer_footnote_indicator].blank?\r\n footnote_indicator = params[:payer_footnote_indicator]\r\n if footnote_indicator.to_s == 'true' || footnote_indicator.to_s == '1'\r\n footnote_indicator = true\r\n else\r\n footnote_indicator = false\r\n end\r\n set_name_obj = ReasonCodeSetName.find_by_name(set_name)\r\n if !set_name_obj.blank?\r\n payers = Payer.select(\"id, footnote_indicator\").where(:reason_code_set_name_id => set_name_obj.id, :status => \"#{Payer::MAPPED}\")\r\n if payers.length > 0\r\n if !(payers.length == 1 && payers[0] && payers[0].id.to_s == params[:id])\r\n footnote_indicators = payers.map(&:footnote_indicator)\r\n footnote_indicators << footnote_indicator\r\n if footnote_indicators.length > 1 && footnote_indicators.uniq.length != 1\r\n result = false\r\n error_message = \"The setname given is given to another payer with different footnote indicator. Please correct the footnote indicator of the payer.\"\r\n end\r\n end\r\n end\r\n end\r\n end\r\n return result, error_message\r\n end",
"title": ""
},
{
"docid": "4dea89214442e2c3a5d74db6ec2c6102",
"score": "0.5643463",
"text": "def saveOutputRecord(address, output, params)\r\n newOutput = Output.new\r\n newOutput.place_id = output[:placeId]\r\n newOutput.street = address.street\r\n newOutput.citystatezip = address.citystatezip\r\n newOutput.date = Date.today \r\n newOutput.product = params[:product].to_s.upcase\r\n newOutput.time = output[:runTime].round(2)\r\n newOutput.runid = output[:runID]\r\n newOutput.urls = output[:urlsToHit]\r\n newOutput.reason = output[:reason]\r\n newOutput.numbers = output[:allMetrics]\r\n newOutput.names = output[:allNames]\r\n newOutput.passes = output[:allPasses]\r\n newOutput.comments = output[:allComments]\r\n newOutput.usage = output[:allUsages]\r\n newOutput.data_source = output[:allDataSources] \r\n newOutput.zpid = output[:zpid]\r\n newOutput.save\r\n end",
"title": ""
},
{
"docid": "7da815a6427d798d8ac61d062a18086e",
"score": "0.56275517",
"text": "def saveOutputRecord(address, data)\r\n newOutput = Output.new\r\n newOutput.street = address.street\r\n newOutput.citystatezip = address.citystatezip\r\n newOutput.names = data[:metricsNames]\r\n newOutput.numbers = data[:metrics]\r\n newOutput.passes = data[:metricsPass]\r\n newOutput.urls = data[:urlsToHit]\r\n newOutput.reason = data[:reason]\r\n newOutput.comments = data[:metricsComments]\r\n newOutput.usage = data[:metricsUsage]\r\n newOutput.zpid = data[:zpid]\r\n newOutput.runid = data[:runID]\r\n #newOutput.time = (Time.now-@[email protected](:+)).round\r\n newOutput.date = Date.today \r\n newOutput.product = params[:product].to_s.upcase\r\n newOutput.save\r\n end",
"title": ""
},
{
"docid": "440e920b300166342e285871a3ecd7d6",
"score": "0.5610027",
"text": "def update\n respond_to do |format|\n if @footnote.update(footnote_params)\n format.html { redirect_to @footnote, notice: 'Footnote was successfully updated.' }\n format.json { render :show, status: :ok, location: @footnote }\n else\n format.html { render :edit }\n format.json { render json: @footnote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e1705747cd47a3769b13665c3d8c5cc",
"score": "0.5526109",
"text": "def save_status_note\n study_id = params[:study_id]\n extraction_form_id = params[:extraction_form_id]\n user_id = params[:user_id]\n note = params[:note]\n # look for an existing note that we can update\n existing = StudyStatusNote.find(:first, :conditions=>[\"study_id=? AND extraction_form_id=?\",params[:study_id],params[:extraction_form_id]])\n # if an existing entry does not exist, create a new one and save the note\n if existing.nil?\n StudyStatusNote.create(:study_id=>study_id, :extraction_form_id=>extraction_form_id, :user_id=>user_id, :note=>note)\n else\n # if the incoming message is empty, destroy the existing note\n if note.empty?\n existing.destroy()\n else\n existing.note = note\n existing.user_id = user_id\n existing.save\n end\n end\n # render a message to indicate that the operation was successful\n @msg_type = 'success'\n @msg_title = 'Update Received'\n @msg_description = 'Your note was saved successfully.'\n render 'shared/show_message.js.erb'\n end",
"title": ""
},
{
"docid": "b66ed328f29a52a809dacd3ca59aee5d",
"score": "0.5518381",
"text": "def version_saved_success_message\n save_success_txt.text\n end",
"title": ""
},
{
"docid": "0a7633bd67a5bbe7ed3864db87df0bfd",
"score": "0.5487416",
"text": "def update_footnote_order\n @original_value = params[:original_value].to_i\n @new_value = params[:new_value].to_i\n @outcome_id = params[:outcome_id]\n @outcome = Outcome.find(@outcome_id)\n @selected_timepoints = params[:selected_timepoints]\n subgroup_id = params[:subgroup_id]\n unless subgroup_id == 0 || subgroup_id.nil?\n \t@subgroup = OutcomeSubgroup.find(subgroup_id)\n else\n \t@subgroup = nil\n end\n OutcomeDataEntry.update_footnote_numbers(@original_value,@new_value,@outcome,subgroup_id)\n @outcome = Outcome.find(@outcome_id)\n \t@footnotes = @outcome.get_foot_notes(subgroup_id)\n \t\n \tunless ExtractionForm.is_diagnostic?(@outcome.extraction_form_id)\n\t \t# update the existing results session\n\t \texisting_results = session[:existing_results]\n\t \tkey = \"#{@outcome.title}_#{@outcome.id}_#{@subgroup.title}_#{@subgroup.id}\"\n\t \texisting_results[key] = @outcome.get_existing_results(@subgroup.id)\n\t \tsession[:existing_results] = existing_results\n\n\t \t#-----------------------------------------\n\t\t# update the existing comparisons table\n\t\t#-----------------------------------------\n\t\texisting_comparisons = session[:existing_comparisons]\n\t\tocdes = OutcomeDataEntry.where(:subgroup_id=>@subgroup.id, :outcome_id=>@outcome.id)\n\t\tthis_comparison = OutcomeDataEntry.get_existing_comparisons_for_session(ocdes)\n\t\tkey = \"#{@outcome.id}_#{@subgroup.id}\"\n\t\texisting_comparisons[:between][key] = this_comparison[:between][key]\t\n\t\texisting_comparisons[:within][key] = this_comparison[:within][key]\t\n\t\tsession[:existing_comparisons] = existing_comparisons\n\tend\n end",
"title": ""
},
{
"docid": "abee303300a42190900bf011da010add",
"score": "0.5450837",
"text": "def save_cashout_log\n log_request = \"#{Parameter.first.front_office_url}/api/856332ed59e5207c68e864564/cashout/log/orange_money_ci?transaction_id=#{@basket.transaction_id}&order_id=#{@basket.number}&status_id=#{@status_id}&transaction_amount=#{@basket.original_transaction_amount}¤cy=#{@basket.currency.code}&paid_transaction_amount=#{@basket.paid_transaction_amount}&paid_currency=#{Currency.find_by_id(@basket.paid_currency_id).code}&change_rate=#{@basket.rate}&id=#{@basket.login_id}&cashout_account_number=#{@cashout_account_number}&fee=#{@basket.fees}\"\n log_response = (RestClient.get(log_request) rescue \"\")\n\n @basket.update_attributes(\n cashout_notified_to_front_office: (log_response == '1' ? true : false), \n cashout_notification_request: log_request, \n cashout_notification_response: log_response\n )\n end",
"title": ""
},
{
"docid": "2ac45ba8e97c18b45d14d984d9e223ca",
"score": "0.5433879",
"text": "def footnote_indicator_after_reasoncode_cleanup(payer_footnote_indicator)\r\n footnote_indicator_to_be_updated = nil\r\n if payer_footnote_indicator.to_s == 'true' || payer_footnote_indicator.to_s == '1'\r\n new_footnote_indicator = true\r\n else\r\n new_footnote_indicator = false\r\n end\r\n if [email protected]_reason_codes_before_reclassification(new_footnote_indicator).blank?\r\n footnote_indicator_to_be_updated = new_footnote_indicator\r\n end\r\n tried_to_change_footnote_indicator = @payer.footnote_indicator != new_footnote_indicator\r\n return footnote_indicator_to_be_updated, tried_to_change_footnote_indicator\r\n end",
"title": ""
},
{
"docid": "b9ea4750882f3144ea12b9b48febe307",
"score": "0.53890014",
"text": "def save_fx_error_message\n error_save_fx_div.text\n end",
"title": ""
},
{
"docid": "1359760962774fc4d38f8fb9aa928bad",
"score": "0.53714347",
"text": "def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end",
"title": ""
},
{
"docid": "263345ec75a14045881cfbe5ffdcad7b",
"score": "0.5366004",
"text": "def update\n @report.done = true\n @report.save\n flash.now[:alert] = \"Thank you for accomplishing the mission so diligently!\n Secretspots society is eternally grateful to you.\"\n redirect_to dashboard_path(anchor: :done)\n end",
"title": ""
},
{
"docid": "3e31f9357d4c55ba1e02c68e60f77636",
"score": "0.5342281",
"text": "def save\n File.open(SaveLocation, 'w') do |file|\n file.puts @value.join(\"\")\n file.puts @progress.join(\"\")\n file.puts @bad_guesses.join(\"\")\n end\n end",
"title": ""
},
{
"docid": "e9fc7d26c8fcd1f8e2e970c6e9e3b25d",
"score": "0.533096",
"text": "def save_release_note()\n puts \"Saving the release note of \" + @version + \" ...\"\n r_note = Nokogiri::HTML(open(@release_note_url))\n File.open(@r_note_filepath, \"w\") do |f|\n f.puts(r_note)\n end\n end",
"title": ""
},
{
"docid": "573cc6da4ac45203b3dcec92813e7b84",
"score": "0.53091073",
"text": "def create\n @notesheet = Notesheet.new(notesheet_params)\n \n respond_to do |format|\n if @notesheet.save\n if [email protected]\n path = \"#{@notesheet.title}-#{@notesheet.id}.txt\"\n File.open(path, \"w+\") do |f|\n f.write(@notesheet.content)\n @notesheet.notepic = f\n end\n @notesheet.save!\n end\n \n \n format.html { redirect_to @notesheet, notice: 'Notesheet was successfully created.' }\n format.json { render :show, status: :created, location: @notesheet }\n else\n format.html { render :new }\n format.json { render json: @notesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82fc34ee2ac4e5f0a2b07b8e918cbf7d",
"score": "0.52277297",
"text": "def save\n normalize_phone\n return false unless valid?\n\n create_order\n update_user_phone\n inform_intercom\n true\n end",
"title": ""
},
{
"docid": "0164b75c7c996f6ba5998479782b36b6",
"score": "0.52265567",
"text": "def save\n receipt = File.new(@save_path, 'w')\n receipt.write(render)\n receipt.close\n end",
"title": ""
},
{
"docid": "c6b5fbb51d47044bfb3955127971578d",
"score": "0.52196586",
"text": "def create\n @footnote = Footnote.new(footnote_params)\n\n respond_to do |format|\n if @footnote.save\n if !params.has_key?(:compare)\n format.html { redirect_to analyze_path(Post.find(Draft.find(@footnote.draft_id).post_id)), notice: 'Footnote was successfully created.' }\n else\n format.html { redirect_to compare_path(@footnote.draft.post.assignment.id, params[:group],params[:member1],params[:member2]), notice: 'Footnote was successfully created.' }\n end\n else\n format.html { render :new }\n format.json { render json: @footnote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb7426b55f5ecd36a3b2fc3acdfc9fb7",
"score": "0.51985335",
"text": "def save_lines\n detail_lines.save_line \n end",
"title": ""
},
{
"docid": "255da20fcd9e7ba9f79ce9cdf6530e50",
"score": "0.5191909",
"text": "def update\n @note = ::Note.find(params[:id])\n authorize @note\n @note.text = note_params[:text]\n\n @answer = @note.answer\n @question = @answer.question\n @plan = @answer.plan\n @research_output = @answer.research_output\n\n question_id = @note.answer.question_id.to_s\n section_id = @question.section_id\n\n if @note.update(note_params)\n @notice = success_message(@note, _('saved'))\n render(json: {\n 'notes' => {\n 'id' => question_id,\n 'html' => render_to_string(partial: 'layout', locals: {\n plan: @plan,\n question: @question,\n answer: @answer,\n research_output: @research_output\n }, formats: [:html])\n },\n 'title' => {\n 'id' => question_id,\n 'html' => render_to_string(partial: 'title', locals: {\n answer: @answer\n }, formats: [:html])\n },\n 'research_output' => {\n 'id' => @research_output.id\n },\n 'section' => {\n 'id' => section_id\n }\n }.to_json, status: :ok)\n else\n @notice = failure_message(@note, _('save'))\n render json: {\n 'msg' => @notice\n }.to_json, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "9dc8f36ff9570b924f861dc93a9ef516",
"score": "0.5190727",
"text": "def save_additional_data\n end",
"title": ""
},
{
"docid": "181bba3d4c27902b77b58e62feb06ab5",
"score": "0.51906097",
"text": "def save!\n end",
"title": ""
},
{
"docid": "ee1cadb4a66f2aa45592ff1f19145dce",
"score": "0.5187253",
"text": "def save_payer_and_its_related_attributes\r\n result = true\r\n error_message = nil\r\n if !params[:id].blank?\r\n @payer = Payer.find(params[:id])\r\n else\r\n @payer = Payer.new\r\n end\r\n params[:payer][:payer_type] = params[:payer_type]\r\n params[:payer][:footnote_indicator] = params[:payer_footnote_indicator]\r\n params[:payer][:set_name] = params[:rc_set][:name]\r\n\r\n result, error_message = validate_payer_and_its_related_attributes\r\n message = error_message if result\r\n logger.debug \"validate_payer_and_its_related_attributes : #{result}\"\r\n return result, error_message if not result\r\n\r\n result, error_message = save_payer\r\n return result, error_message if not result\r\n\r\n if @is_partner_bac\r\n logger.debug \"Invoking BAC payer mapping webservice call.\"\r\n if make_edc_calls\r\n flash.now[:notice] = \"Payer #{@payer.payer} updated sucessfully and marked for approval\"\r\n end\r\n end\r\n if !@do_not_save_micr\r\n result, error_message = save_micr\r\n return result, error_message if not result\r\n save_micr_specific_payer_name\r\n save_facility_specific_plan_type\r\n end\r\n save_payment_and_allowance_and_capitation_codes\r\n save_output_payid\r\n\r\n error_message = message.to_s + error_message.to_s\r\n error_message = nil if error_message.blank?\r\n return result, error_message\r\n end",
"title": ""
},
{
"docid": "90e4fe58718600f2e30b77152a872b30",
"score": "0.5181419",
"text": "def save_detail() \n check_purchase_date(self.date_purchase,self.value, self.scrap_value,self.valuable_age) \n AccountingFixedAssetDetail.create(\n :transaction_date => self.date_purchase,\n :asset_values => self.value, \n :depreciation_values => $value,\n :aje_values => self.value - $value,\n :fixed_asset_id => self.id,\n :account_id => get_account_id(self.adjustment_account_id)\n )\n end",
"title": ""
},
{
"docid": "860e984fe9c61b1e624d2dedf7b89a78",
"score": "0.51738054",
"text": "def add_note(note)\n self.notes = notes.present? ? \"\\n\\n#{note}\" : note\n save\n end",
"title": ""
},
{
"docid": "6a382abe65d0c6e66b3b6e75f511c6dd",
"score": "0.51634413",
"text": "def update \n data=params\n employee = Employee.find(params[:id])\n if update_lawyer_preferences(employee)\n flash[:notice] = \"Lawyer preferences updated successfully\"\n redirect_to :back\n return true\n else\n flash[:error] = \"<ul>\" + employee.errors.full_messages.collect {|e| \"<li>\" + e + \"</li>\"}.join(\" \") + \"</ul>\"\n redirect_to :back\n return false\n end\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @note_priority = (data[:com_notes_entries][:note_priority] == 0 ||data[:com_notes_entries][:note_priority].eql?('0'))? 1 : 2 \n notes = data[:com_notes_entries][:description] if data[:com_notes_entries][:description]\n # Below code is common in \"Complete Task\" and \"Assign To\" logic.\n if data[:commit].eql?(\"Complete Task\") || data[:commit].eql?(\"Assign To\")\n notes_type = data[:task][:tasktype] unless data[:task][:tasktype].blank?\n task_details = {}\n task_details.merge!(data[:task])\n task_details.merge!(:name=>notes,:tasktype =>notes_type,:priority=>@note_priority)\n end\n if data[:commit].eql?(\"Save & Exit\")\n respond_to do |format| \n if @com_notes_entries.update_attributes(:description=>notes,:more_action =>data[:com_notes_entries][:more_action], :matter_id =>data[:com_notes_entries][:matter_id], :contact_id=>data[:com_notes_entries][:contact_id],:note_priority=>@note_priority.to_i)\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_saved)}\"\n format.html {redirect_to physical_liviaservices_livia_secretaries_url}\n else\n format.html { render :action => \"show\" }\n end\n end\n elsif data[:commit].eql?(\"Complete Task\") \n task_details.merge!(data[:task])\n task_details.merge!(:assigned_to_user_id =>@current_user.id,:status=>'complete',:completed_at=>Time.now,:completed_by_user_id=>@current_user.id)\n @task= UserTask.new(task_details)\n respond_to do |format|\n # Below mention transaction block basically revert Task entry and even revert the Communication to update.\n # Added by Ajay Arsud Date:09 Sept 2010\n UserTask.transaction do\n if @task.save\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @task.update_attributes(:company_id=>@com_notes_entries.company_id)\n @com_notes_entries.update_attributes(:status => 'complete')\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_completed)}\"\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n else\n flash[:error] = t(:flash_task_type)\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n end\n end\n end\n elsif data[:commit].eql?(\"Assign To\")\n task_details.merge!(:assigned_to_user_id =>data[:task][:assigned_to_user_id])\n @task = UserTask.new(task_details)\n respond_to do |format|\n # Below mention transaction block basically revert Task entry and even revert the Communication to update.\n # Added by Ajay Arsud Date:09 Sept 2010\n Communication.transaction do\n if @task.save\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @task.update_attributes(:company_id=>@com_notes_entries.company_id) \n @com_notes_entries.update_attributes(:status => 'complete')\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_assigned)}\"\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n else\n flash[:error] = t(:flash_task_type)\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n end\n end\n end\n end \n end",
"title": ""
},
{
"docid": "69cfc70f187a7dec292eeb70bd4a2a91",
"score": "0.51601195",
"text": "def save_file\n\tcounter = 1;\n\ttime = Time.now.strftime(\"%d/%m/%Y\")\n\treport_file_puts \"\"\n\treport_file_puts \"Title of saved TodoList: #{@title}\"\n\treport_file_puts \"Save time: #{time}\"\n\treport_file_puts \"----------------------------\"\n\t\[email protected] do |item|\n\n\t\treport_file_puts \"#{counter.to_s} #{item.description} Completion status: #{item.completed_status.to_s}\"\n\t\tcounter +=1;\t\n\tend\t\nend",
"title": ""
},
{
"docid": "03bf9993d675eab8e864b8c7e8d7f42d",
"score": "0.51357174",
"text": "def save_and_continue\n\n logger.info 'Navigating past payment details confirmation screen '\n \"for ID: #{@funding_application.payment_details.id}\"\n\n @funding_application.payment_details.validate_evidence_file = true\n\n if @funding_application.payment_details.valid?\n\n logger.info 'Successfully validated payment details evidence file when '\n 'navigating past payment details confirmation screen for '\n \"ID: #{@funding_application.payment_details.id}\"\n\n redirect_to :funding_application_gp_project_payment_how_is_your_project_progressing\n\n else\n\n logger.info 'Validation failed when attempting to navigate past '\n \"payment details confirmation screen for ID: #{@funding_application.payment_details.id}\"\n\n log_errors(@funding_application.payment_details)\n\n render :show\n\n end\n\n end",
"title": ""
},
{
"docid": "db28d9013dc9055a8eeda714e2e5f063",
"score": "0.5134608",
"text": "def save\n @is_ok = true\n\n is_deposited = EmployeeBenefit.where(\"id = ? and deposited_at IS NOT NULL\", self.id)\n if is_deposited.count > 0\n errors.add(:deposited_at, \"Error - cannot update benefit that has been already deposited.\")\n @is_ok = false\n end\n\n @is_there = 0\n if self.employee_id != nil\n @is_there = Employee.where(id: self.employee_id, deactivated: 0).count\n end\n if @is_there < 1\n errors.add(:employee_id, \"Error - cannot find employee (or is deactivated).\")\n @is_ok = false\n end\n\n Rails.logger.debug(\"**** self.employee_package_id: #{self.employee_package_id}\")\n\n @this_pkg = nil\n if self.employee_package_id != nil\n matches = EmployeePackage.where(id: self.employee_package_id)\n @this_pkg = matches.count > 0 ? matches.first : nil\n end\n if @this_pkg == nil\n errors.add(:employee_package_id, \"Error - cannot save without package .\")\n @is_ok = false\n elsif @this_pkg.deactivated != 0\n errors.add(:employee_package_id, \"Error - current package #{@this_pkg.id} is deactivated.\")\n @is_ok = false\n elsif @this_pkg.eff_year > self.eff_year ||\n ( @this_pkg.eff_year == self.eff_year && @this_pkg.eff_month > self.eff_month )\n errors.add(:eff_month, \"Error - current package effective month does not match current record.\")\n @is_ok = false\n end\n\n if @is_ok\n @is_ok = super\n end\n @is_ok\n end",
"title": ""
},
{
"docid": "68b56ab7eca4f19712bfc84837744375",
"score": "0.5117838",
"text": "def save(output_path=nil)\n to_output_path(output_path)\n run_command(@command,*@args << @input)\n @info = FlashTool.flash_info(@output_path)\n end",
"title": ""
},
{
"docid": "ea14920c403f0441adc86cf3b75b23bb",
"score": "0.51106155",
"text": "def save_result\n @running = Facade::SportSession::Running.find_by id: params[:id]\n\n if not @running.is_confirmed_participant(current_user)\n redirect_to runnings_url, alert: 'Permission denied'\n end\n\n @result = @running.result(current_user)\n\n # read gpx file if present\n track = nil\n if results_params[:file].present?\n @result = Track.create_track_and_update_result(@result, results_params[:file])\n track = @result.track\n else\n @result.time = results_params[:time]\n @result.length = results_params[:length]\n end\n\n if @result.save\n track.save if track.present?\n # Check for new Achievements!\n achievement_checker = AchievementsChecker.new @result\n achievements = achievement_checker.check true\n if achievements.count > 0\n titles = '\"' + achievements.map { |a| a.achievement.title}.join('\", \"') + '\"'\n flash[:notice] = [\"Congratulations, you obtained new achievements: #{titles}\"]\n flash[:notice] << 'Successfully saved results'\n else\n flash[:notice] = 'Successfully saved results'\n end\n\n redirect_to runnings_url\n else\n render :edit_result\n end\n\n end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.5108381",
"text": "def save; end",
"title": ""
},
{
"docid": "d815b7436dad241ff7cffe26c878d21e",
"score": "0.51006836",
"text": "def create\n params[:note].merge!(:created_by_user_id=>current_user.id, :assigned_to_user_id => params[:note][:assigned_to_user_id].blank? ? current_user.id : params[:note][:assigned_to_user_id])\n unless params[:note][:assigned_by_employee_user_id] == \"\"\n employee_user = User.find(params[:note][:assigned_by_employee_user_id])\n params[:note].merge!(:company_id=>employee_user.company_id)\n end\n note = Communication.new(params[:note])\n @document_home = DocumentHome.new()\n errors = note.validate_note_docs(params)\n errors += UserTask.check_validations(params,current_user).join(\"<br>\") unless params[:generate_task].blank?\n responds_to_parent do\n if errors.blank?\n Communication.transaction do\n note.save\n upload_multiple_documents(note,params)\n create_task(note,params)\n end\n render :update do |page|\n page.redirect_to wfm_notes_path\n flash[:notice] = \"Note #{note.status == 'complete'? 'completed' : 'created'} successfully\"\n end\n else\n render :update do |page|\n page << \"show_error_full_msg('altnotice','#{errors}','message_error_div');\"\n page << \"enableAllSubmitButtons('buttons_to_disable','Save');\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6d98088dfd420080c0ee1fb7fa3e1de4",
"score": "0.5094364",
"text": "def save\n @questionnaire.save!\n redirect_to controller: 'questions', action: 'save_questions', questionnaire_id: @questionnaire.id, questionnaire_type: @questionnaire.type and return unless @questionnaire.id.nil? || @questionnaire.id <= 0\n undo_link(\"Questionnaire \\\"#{@questionnaire.name}\\\" has been updated successfully. \")\n end",
"title": ""
},
{
"docid": "321553f442ab74c772261ee4cb499335",
"score": "0.5086072",
"text": "def save! target=\"./Notes\"\n filename = File.join(target, \"#{@title}.txt\")\n\n Faceoff.safe_save(filename) do |file|\n file.write self.to_s\n end\n end",
"title": ""
},
{
"docid": "7495a5546e165468a2a14a6473fe3260",
"score": "0.50859994",
"text": "def saveReceipt\n\t\tcurrent_time = DateTime.now\n\t\tReceipt.create!(:concept => params[:tipofactura],\n\t\t\t\t\t\t\t:subtotal => params[:subtotal],\n\t\t\t\t\t\t\t:total => params[:pagototal],\n\t\t\t\t\t\t\t:iva => params[:iva],\n\t\t\t\t\t\t\t:xml => params[:rawxml],\n\t\t\t\t\t\t\t:users_id => current_user.id,\n\t\t\t\t\t\t\t:created_at => current_time,\n\t\t\t\t\t\t\t:updated_at => current_time,\n\t\t\t\t\t\t\t:user_email => current_user.email,\n\t\t\t\t\t\t\t:emisor => params[:emisor],\n\t\t\t\t\t\t\t:rfcEmisor => params[:rfcemisor],\n\t\t\t\t\t\t\t:receptor => params[:receptor],\n\t\t\t\t\t\t\t:rfcReceptor => params[:rfcreceptor])\n\t\tredirect_to action: 'viewInvoices' , email: current_user.email\n\tend",
"title": ""
},
{
"docid": "b92d2f8935e5fbe9c15f09466b594535",
"score": "0.5071382",
"text": "def save_result\n @cycling = Facade::SportSession::Cycling.find_by id: params[:id]\n\n if not @cycling.is_confirmed_participant(current_user)\n redirect_to cyclings_url, alert: 'Permission denied'\n end\n\n @result = @cycling.result(current_user)\n\n # read gpx file if present\n track = nil\n if results_params[:file].present?\n @result = Track.create_track_and_update_result(@result, results_params[:file])\n track = @result.track\n else\n @result.time = results_params[:time]\n @result.length = results_params[:length]\n end\n\n if @result.save\n track.save if track.present?\n # Check for new Achievements!\n achievement_checker = AchievementsChecker.new @result\n achievements = achievement_checker.check true\n if achievements.count > 0\n titles = '\"' + achievements.map { |a| a.achievement.title}.join('\", \"') + '\"'\n flash[:notice] = [\"Congratulations, you obtained new achievements: #{titles}\"]\n flash[:notice] << 'Successfully saved results'\n else\n flash[:notice] = 'Successfully saved results'\n end\n\n redirect_to cyclings_url\n else\n flash[:notice] = 'Unable to save results'\n render :edit_result\n end\n\n end",
"title": ""
},
{
"docid": "c8802c64fe0febbae82957fd2682dccf",
"score": "0.50574076",
"text": "def cleanup_successful\n\t\tself.order_status_code_id = 5\n self.new_notes=\"Order completed.\"\n self.product_cost = self.line_items_total\n self.account.clear_personal_information\n self.save\n\tend",
"title": ""
},
{
"docid": "46be12c89f762d0baa2f5b955a3568ea",
"score": "0.50549495",
"text": "def update\n respond_to do |format|\n if @output.update(output_params)\n format.html { redirect_to @output, notice: \"Output was successfully updated.\" }\n format.json { render :show, status: :ok, location: @output }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98e93d20becf1d801c3cc3997ff70175",
"score": "0.5031886",
"text": "def postmark\n @program_acceptance = ProgramAcceptance.where(message_id: params[:MessageID]).first\n if @program_acceptance\n note = case params[:RecordType]\n when \"Delivery\" then \"Acceptance email delivered to #{params[:Recipient]}.\"\n when \"Bounce\" then \"Acceptance email not delivered to #{params[:Recipient]}.\\n\\n> #{params[:Description]}\"\n when \"SpamComplaint\" then \"Acceptance email to #{params[:Recipient]} flagged as spam.\"\n when \"Open\" then \"Acceptance email opened.\"\n when \"Click\" then \"Link clicked in acceptance email.\"\n end\n @program_acceptance.person.notes.create note_type: \"email-event\", message: note, data: request.request_parameters\n end\n head :ok\n end",
"title": ""
},
{
"docid": "fc44047626a2456147ddd8d622068003",
"score": "0.5015893",
"text": "def alipay_notify\n if valid_alipay_notification?(@notification,@order.payments.first.payment_method.preferred_partner)\n if @notification.success?\n @order.payment.first.complete!\n else\n @order.payment.first.failure!\n end\n render text: \"success\" \n else\n render text: \"fail\" \n end\n rescue\n render text: \"fail\"\n end",
"title": ""
},
{
"docid": "b2f93dd98524659475891df090355067",
"score": "0.5015418",
"text": "def check_out\n @policy.check?\n note = operation_params[:note]\n operation = current_user.register_out(@employee, note)\n operation ? success(operation) : unprocessable_entity(operation)\n end",
"title": ""
},
{
"docid": "fcf1a2aec5e7b67934ee702478c8ab93",
"score": "0.5015091",
"text": "def create\n @ip_due = IpDue.new\n\t@session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n @ip_due = IpDue.new(params[:ip_due])\n\t@final_bill=FinalBill.find_by_admn_no_and_org_code(@ip_due.admn_no,@ip_due.org_code)\n\t@final_bill.paid_amount=@ip_due.remaining_amount+@final_bill.paid_amount\n\t@final_bill.balance_amount=0\n\t@n=Number.new\n\[email protected]_value(\"receipt\",@ip_due.org_code)\n\t@ip_due.receipt_no=update_reciept_value\n\tuser_id=params[:user_id]\n respond_to do |format|\n if @ip_due.save\n\t @n=Number.find_by_name_and_org_code(\"receipt\",@ip_due.org_code)\n\t\[email protected]=@ip_due.receipt_no\n\t\[email protected]_attributes(params[:n])\n @final_bill.update_attributes(params[:final_bill])\n\t\tformat.html { redirect_to(\"/ip_dues/report/#{@ip_due.id}?print_type=original&format=pdf\", :notice => 'FinalBill was successfully created.') } \n\t format.xml { render :xml => @ip_due, :status => :created, :location => @ip_due }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ip_due.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd0baedd9ac8ae1a5fb4595d22b62010",
"score": "0.5012948",
"text": "def save_and_exit(appointments)\n File.open('details.txt', 'w') do |f|\n appointments.each do |element|\n f.puts(\"#{element.doctor_name},#{element.date},#{element.time},#{element.full_name},#{element.dob},#{element.mobile_num}\")\n end\n end\nrescue StandardError => e\n puts \"failed to save #{e}\"\nend",
"title": ""
},
{
"docid": "c0b155b7ef2acdd2c5835ef09befa170",
"score": "0.50113136",
"text": "def save\n timeout_retry(3, 3){\n write \"SAVE\\r\\n\"\n status_code_reply\n }\n end",
"title": ""
},
{
"docid": "1bf29325bc904610563c5d26159f3267",
"score": "0.50067776",
"text": "def create\n @output = Output.new(output_params)\n\n respond_to do |format|\n if @output.save\n format.html { redirect_to @output, notice: \"Output was successfully created.\" }\n format.json { render :show, status: :created, location: @output }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1334de44c7ddda6911739fee3e15693",
"score": "0.5003979",
"text": "def create_eob\n @insurance_payment_eob = InsurancePaymentEob.new(:details=>{:patient_first_name_ocr_output=>\"\"})\n @check_information.insurance_payment_eobs << @insurance_payment_eob\n @insurance_payment_eob.save(:validate => false)\n return @insurance_payment_eob\n end",
"title": ""
},
{
"docid": "d700d2980fe2f81ad14fedb633ba50f9",
"score": "0.49910316",
"text": "def update\n @checkout = Checkout.find(params[:id])\n @checkout.checkin_date = Date.today\n @checkout.notes = @checkout.notes + \"\\n-----\\n\" + params[:additional_notes]\n\n # FIXME we don't do any input validation here\n respond_to do |format|\n if @checkout.save\n format.html { redirect_to(@checkout.item, :notice => 'Checkout was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @checkout.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5de5e4356f56ff7da30154578c25d29f",
"score": "0.49905413",
"text": "def pay_installment\n set_loan_installment\n\n @loan = @loan_installment.loan_installment_container.loan\n\n \n\n respond_to do | format |\n \n if @loan.status == Loan.statuses[:disbursed]\n\n ae_exist = AccountingEntry.where(from_installment: @loan_installment.id).first\n\n unless ae_exist\n\n @loan_installment.update(loan_installment_params)\n\n \n\n # Record this in the Activity Log\n record(pundit_user, 'Accepted Payment')\n\n\n ab = @loan.accounting_book\n\n\n remaining_principal = ab.overall_principal_balance - @loan_installment.principal_amount\n remaining_interest = ab.overall_interest_balance - @loan_installment.interest_amount\n\n\n ae = ab.create_entry title: \"Installment no #{@loan_installment.installment_no}\", description: \" Payment of #{@loan.client.full_name}\", principal_balance: remaining_principal, interest_income_balance: remaining_interest, from_installment: @loan_installment.id\n ae.create_dr_entry description: \"Cash\", value: @loan_installment.principal_amount + @loan_installment.interest_amount\n ae.create_cr_entry description: \"Account receivable\", value: @loan_installment.principal_amount\n ae.create_cr_entry description: \"Interest income\", value: @loan_installment.interest_amount\n\n\n amount = (@loan_installment.principal_amount + @loan_installment.interest_amount)\n new_payment_email = LoanMailer.new_payment_notification(@loan, amount)\n new_payment_email.deliver_now\n \n \n ab.overall_principal_balance = remaining_principal\n ab.overall_interest_balance = remaining_interest\n\n ab.save\n end\n\n format.js { render 'loan_installments/pay_installment.js.erb' }\n else\n format.js { render 'loan_installments/pay_installment_failed.js.erb' }\n end\n end\n end",
"title": ""
},
{
"docid": "ca683b9008f73926b1dca636f052a179",
"score": "0.49855998",
"text": "def audit_save *args\n @is_good = false\n @ok_to_save = true\n if is_package_duplicate\n errors.add(:eff_month, \"Error - package exists for \" + self.eff_month.to_s + \"/\" + self.eff_year.to_s)\n else\n @is_good = self.save\n end\n @ok_to_save = false\n @is_good\n end",
"title": ""
},
{
"docid": "cb815009c3486686423ad8a5c7aa2464",
"score": "0.49855536",
"text": "def output_params\n params.require(:output).permit(:output_date, :invoice, :quantity, :price, :receiving_area, :receiving_person, :product_id, :user_id)\n end",
"title": ""
},
{
"docid": "c6763d3e5ab08e9269dbe1dadd717636",
"score": "0.49831295",
"text": "def save_vat_error_message\n error_save_vat_div.text\n end",
"title": ""
},
{
"docid": "bbcee80e2fe7228aee0be8173fedc597",
"score": "0.49825662",
"text": "def create\n @bodily_output = BodilyOutput.new(bodily_output_params)\n\n respond_to do |format|\n if @bodily_output.save\n format.html { redirect_to @bodily_output, notice: 'Bodily output was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bodily_output }\n else\n format.html { render action: 'new' }\n format.json { render json: @bodily_output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "798dcd527479e0173f635e1c1da0ca30",
"score": "0.4978545",
"text": "def save_to_text(final_location)\n #open the pre-determined file to write on\n location_save = open('last_saved.txt','w')\n\n #Generate the lines for the file\n\t location_save.puts(\"Lunch Location:\"+final_location.name)\n\t location_save.puts(\"Lunch Address:\"+final_location.address)\n\t location_save.puts(\"Cuisine Type:\"+final_location.cuisine)\n\t location_save.puts(\"Healthy?:\"+final_location.healthy)\n\t location_save.puts(\"Halal or Non-halal:\"+final_location.halal)\n\t location_save.puts(\"Price range:\"+final_location.price)\n\n\n #close the file\n location_save.close\nend",
"title": ""
},
{
"docid": "b2c02303ec27efbe63d11b1c4e4f41d9",
"score": "0.49719432",
"text": "def si_generate_invoice\n supplier = params[:supplier]\n notes = params[:request]\n invoice_no = params[:offer_no]\n invoice_date = params[:offer_date] # YYYYMMDD\n internal_no = params[:internal_no]\n posted_at = params[:posted_at] # YYYYMMDD\n company = params[:company]\n invoice = nil\n invoice_item = nil\n code = ''\n first = true\n\n # notes.split(\",\").map(&:to_i) # Convert to array, map each element to int\n notes = notes.split(\",\")\n\n # Format offer_date\n invoice_date = (invoice_date[0..3] + '-' + invoice_date[4..5] + '-' + invoice_date[6..7]).to_date\n posted_at = (posted_at[0..3] + '-' + posted_at[4..5] + '-' + posted_at[6..7]).to_date\n\n if notes.count == 1\n # Only one note\n if notes[0] != '0'\n receipt_note = ReceiptNote.find(notes[0]) rescue nil\n receipt_note_items = receipt_note.receipt_note_items rescue nil\n if !receipt_note.nil? && !receipt_note_items.nil?\n # Try to save new invoice\n invoice = new_invoice(receipt_note, invoice_no, invoice_date, internal_no, posted_at, company)\n # One note only: Must save receipt_note_id, work_order_id & charge_account_id\n invoice.receipt_note_id = receipt_note.id\n invoice.work_order_id = receipt_note.work_order_id\n invoice.charge_account_id = receipt_note.charge_account_id\n # One note only: Discount must be saved as well\n invoice.discount_pct = receipt_note.discount_pct\n invoice.discount = receipt_note.discount\n if invoice.save\n # Try to save new invoice items\n receipt_note_items.each do |i|\n if i.balance != 0 # Only items not billed yet\n invoice_item = new_invoice_item(invoice, i)\n if !invoice_item.save\n # Can't save invoice item (exit)\n code = '$write'\n break\n end # !invoice_item.save?\n end # i.balance != 0\n end # receipt_note_items.each do |i|\n # Update totals\n invoice.update_column(:totals, SupplierInvoice.find(invoice.id).total)\n else\n # Can't save invoice\n code = '$write'\n end # invoice.save?\n else\n # Receipt note or items not found\n code = '$err'\n end # !receipt_note.nil? && !receipt_note_items.nil?\n else\n # Receipt note 0\n code = '$err'\n end # note != '0'\n else\n # Loop thru notes and create invoice\n notes.each do |note|\n if note != '0'\n receipt_note = ReceiptNote.find(note) rescue nil\n receipt_note_items = receipt_note.receipt_note_items rescue nil\n if !receipt_note.nil? && !receipt_note_items.nil?\n # If it's first note, must initialize new invoice; if not, update already initialized one\n if first\n invoice = new_invoice(receipt_note, invoice_no, invoice_date, internal_no, posted_at, company)\n invoice.remarks = I18n.t(\"activerecord.attributes.supplier_invoice.receipt_notes\") + ': ' + receipt_note.receipt_no\n first = false\n else\n invoice.discount = invoice.discount + receipt_note.discount\n invoice.remarks = invoice.remarks + ', ' + receipt_note.receipt_no\n end\n if invoice.save\n # Try to save new invoice items\n receipt_note_items.each do |i|\n if i.balance != 0 # Only items not billed yet\n invoice_item = new_invoice_item(invoice, i)\n if !invoice_item.save\n # Can't save invoice item (exit)\n code = '$write'\n break\n end # !invoice_item.save?\n end # i.balance != 0\n end # receipt_note_items.each do |i|\n # Update totals\n invoice.update_column(:totals, SupplierInvoice.find(invoice.id).total)\n else\n # Can't save invoice\n code = '$write'\n break\n end # invoice.save?\n else\n # Receipt note or items not found\n code = '$err'\n end # !receipt_note.nil? && !receipt_note_items.nil?\n else\n # Receipt note 0\n code = '$err'\n end # note != '0'\n end # notes.each do |note|\n end # notes.count == 1\n\n if code == ''\n code = I18n.t(\"ag2_purchase.supplier_invoices.generate_invoice_ok\", var: invoice.id.to_s)\n end\n\n @json_data = { \"code\" => code }\n render json: @json_data\n end",
"title": ""
},
{
"docid": "c09570c35d41275603f075087818c24f",
"score": "0.4970084",
"text": "def saveAutograde(submission,feedbackFile)\n lines = File.open(feedbackFile).readlines()\n begin\n \n if @assessment.has_partners then\n # Create a submission for partner\n pSubmission = createPartnerSubmission(submission)\n end\n \n if (lines == nil) then\n raise \"The Autograder returned no output. \\n\"\n end\n\n # The last line of the output is assumed to be the\n # autoresult string from the autograding driver\n autoresult = lines[lines.length-1].chomp\n\n if @assessment.config_module.instance_methods.include?(:parseAutoresult) then\n scores = @assessment.config_module.parseAutoresult(autoresult, true);\n else\n scores = parseAutoresult(autoresult, true)\n end\n\n if scores.keys.length == 0 then \n raise \"Empty autoresult string.\"\n end\n\n # Grab the autograde config info\n @autograde_prop = AutogradingSetup.where(:assessment_id => @assessment.id).first\n\n # Record each of the scores extracted from the autoresult\n for key in scores.keys do\n problem = @assessment.problems.where(:name => key).first\n if !problem then\n raise \"Problem \\\"\" + key + \"\\\" not found.\"\n end\n score = submission.scores.where(:problem_id => problem.id).first\n if !score then \n score = submission.scores.new(:problem_id=>problem.id)\n else\n score = submission.scores.where(:problem_id => problem.id).first\n end\n score.score = scores[key]\n score.feedback = lines.join()\n score.released = @autograde_prop.release_score\n score.grader_id = 0\n puts \"save score\"\n puts score.save!\n \n \tif @assessment.has_partners then \n # call method in ModuleBase to update this score for partner\n \t saveAutogradeForPartner(score, pSubmission)\n \tend\n\n end\n rescue Exception => e\n\n print \"\\n\\nError:#{e}\\n\\n\"\n\n problem = @assessment.problems.first\n score = submission.scores.where(:problem_id => problem.id).first\n if !score then\n score = submission.scores.new(:problem_id=>problem.id)\n end\n score.score = 0\n score.feedback = \"An error occurred while parsing the autoresult returned by the Autograder.\\n\\n\" \n # score.feedback += \"Autoresult: \" + \"\\\"\" + autoresult + \"\\\"\" + \"\\n\"\n score.feedback += \"Error message: \" + e.to_s + \"\\n\"\n score.feedback += \"\\nBacktrace:\\n\" + e.backtrace.join(\"\\n\")\n score.feedback += \"\\n\\n\"\n\n if lines && (lines.length < 10000) then\n score.feedback += lines.join()\n end\n score.released = true\n score.grader_id=0\n score.save\n \n if @assessment.has_partners then\n \t# call method in ModuleBase to update this score for parter\n \tsaveAutogradeForPartner(score, pSubmission)\n end\n end\n\n submission.autoresult = autoresult\n submission.save\n # save autoresult for partner\n if pSubmission then\n pSubmission.autoresult = autoresult\n pSubmission.save\n end\n logger = Logger.new(Rails.root.join(\"courses\", @course.name, @assessment.name, \"log.txt\"))\n logger.add(Logger::INFO) {\"#{submission.course_user_datum.email}, #{submission.version}, #{autoresult}\"}\n end",
"title": ""
},
{
"docid": "dc013778dea2bd27a3e196dcadf7367f",
"score": "0.49669924",
"text": "def receipt\n end",
"title": ""
},
{
"docid": "dc013778dea2bd27a3e196dcadf7367f",
"score": "0.49669924",
"text": "def receipt\n end",
"title": ""
},
{
"docid": "ffb1cf02d51b6aa5e3e683c6acb50cd4",
"score": "0.4962519",
"text": "def payment_instruction\n end",
"title": ""
},
{
"docid": "f4ca7c331218635f65035f93a3c9e5a1",
"score": "0.496153",
"text": "def save\n end",
"title": ""
},
{
"docid": "cec7a906178289dfc109577ced71dfe8",
"score": "0.496049",
"text": "def save_edited_payment_entry\n @raw_date = params[:payment_date]\n \n @day = @raw_date[3..4]\n @month = @raw_date[0..1]\n @year = @raw_date[6..9]\n \n @payment_date = \"#{@year}-#{@month}-#{@day}\"\n \n @payment = PaymentFromDestination.find(params[:id])\n @payment.job_id = params[:job_id]\n @payment.destination_id = params[:destination_id]\n @payment.payment_date = @payment_date\n @payment.payment_num = params[:payment_num]\n @payment.wood_type = params[:wood_type_id]\n @payment.tickets = params[:tickets]\n @payment.tonnage = params[:tonnage]\n @payment.net_mbf = params[:net_mbf]\n \n #Because the total payment comes in as string in currency format\n # some parts have to be stripped off to be able to turn it into float correctly\n @total_payment = params[:amount].to_s\n 3.times do\n @total_payment.sub!(\",\", \"\")\n end\n @total_payment = @total_payment.to_f\n \n @payment.total_payment = @total_payment\n \n unless @payment.save\n render :status => 306, :nothing => true\n return\n else\n render :status => 200, :nothing => true\n return\n end\n end",
"title": ""
},
{
"docid": "efac542cdf6a16c3cc5bba9332aa694e",
"score": "0.49568453",
"text": "def save\n frm.button(:value=>\"Save\").click\n Announcements.new(@browser)\n end",
"title": ""
},
{
"docid": "735747c1e2d855a2f57153c05929ba8f",
"score": "0.4956593",
"text": "def create\n @output = Output.new(output_params)\n\n respond_to do |format|\n if @output.save\n format.html { redirect_to @output, notice: 'Output was successfully created.' }\n format.json { render :show, status: :created, location: @output }\n else\n format.html { render :new }\n format.json { render json: @output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80ef21c1ac0944eb96293f43d8304619",
"score": "0.4954884",
"text": "def save_checkpoint\n @api.send(\"world.checkpoint.save()\")\n end",
"title": ""
},
{
"docid": "61b120a009a9c0a033e0370e2c881305",
"score": "0.49472886",
"text": "def save\n end",
"title": ""
},
{
"docid": "61b120a009a9c0a033e0370e2c881305",
"score": "0.49472886",
"text": "def save\n end",
"title": ""
},
{
"docid": "ef77f2fa36920698d237fab76aaa45d5",
"score": "0.49443477",
"text": "def add_invoice_return_note(invoice_return, remote_ip, gst_credit_note_amount)\n voucher_setting = VoucherSetting.where(:company_id=>invoice_return.company.id, :voucher_type=> 27).first\n if voucher_setting.voucher_number_strategy ==2\n gst_credit_note=return_invoice_new_note(invoice_return)\n else\n gst_credit_note=new_note(invoice_return.company)\n end\n gst_credit_note.company_id=invoice_return.company.id\n gst_credit_note.created_by=invoice_return.created_by\n gst_credit_note.gst_credit_note_date=invoice_return.record_date\n gst_credit_note.to_account_id=invoice_return.account_id\n gst_credit_note.from_account_id=invoice_return.account_id\n gst_credit_note.branch_id=invoice_return.invoice.branch_id\n gst_credit_note.read_only=true\n gst_credit_note.amount=gst_credit_note_amount\n gst_credit_note.invoice_return_id=invoice_return.id\n gst_credit_note.save(:validate=>false)\n gst_credit_note.register_user_action(remote_ip, 'created')\n gst_credit_note\n end",
"title": ""
},
{
"docid": "fa7fbe330a4306cfb2ef6431dcc7f05e",
"score": "0.4942472",
"text": "def confirm\n @order.confirm_notes = params[:order][:confirm_notes]\n @order.approx_cost = (@order.approx_cost.to_f * 100.0).floor\n @order.confirm\n \n if @order.confirm_notes.present? \n OrderNote.create(:message => @order.confirm_notes, :order_id => @order.id, :author_id => @order.assigned_to.id) rescue nil \n end\n\n @order.approx_cost = (@order.approx_cost.to_f / 100.0).floor\n \n render 'status'\n end",
"title": ""
},
{
"docid": "eec26146c2c7e7f5ebe98e6bbf3ee868",
"score": "0.49399212",
"text": "def output_file_path\n raise LogicError, { message: \"Save agreement failed!\" }.to_json\n end",
"title": ""
},
{
"docid": "5a0d65eb30b9bb4c145994dcc3c167ba",
"score": "0.49398223",
"text": "def create\n @supplier_debit_note = SupplierDebitNote.new(params[:supplier_debit_note])\n #if check_validation\n if @supplier_debit_note.save\n redirect_to(edit_supplier_debit_note_path(@supplier_debit_note), :notice => 'Receive From Supplier was successfully created.')\n else\n render :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "265b527130315f20e9ddccea7fdbd8de",
"score": "0.49353877",
"text": "def test_save\n @pmi.medical_record_number = Jinx::UID.generate.to_s\n @pmi.site = defaults.tissue_bank\n @pmi.participant = CaTissue::Participant.new(:name => Jinx::StringUniquifier.uniquify('Test Participant'))\n verify_save(@pmi)\n # update the PMI\n @pmi.medical_record_number = Jinx::UID.generate.to_s\n verify_save(@pmi)\n end",
"title": ""
},
{
"docid": "7160ce4bae4da1b007511997e21cd448",
"score": "0.49343276",
"text": "def update\n respond_to do |format|\n if @output.update(output_params)\n format.html { redirect_to @output, notice: 'Output was successfully updated.' }\n format.json { render :show, status: :ok, location: @output }\n else\n format.html { render :edit }\n format.json { render json: @output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7160ce4bae4da1b007511997e21cd448",
"score": "0.49343276",
"text": "def update\n respond_to do |format|\n if @output.update(output_params)\n format.html { redirect_to @output, notice: 'Output was successfully updated.' }\n format.json { render :show, status: :ok, location: @output }\n else\n format.html { render :edit }\n format.json { render json: @output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42db4e000279fb8e8cc506a7371a820d",
"score": "0.4933383",
"text": "def savePerfLine\n\t\tline= @startTime.to_i.to_s+','[email protected]_s+','+@urlLabel+','+@httpCode+','+@httpRes+',Test_'[email protected]_s+',text,'+@applRes+',1,1'\n\t\[email protected] line\n\t\t@dataSaved = true\n\tend",
"title": ""
},
{
"docid": "abbe3022dd0aaa423ac2bfc1247e3a0f",
"score": "0.4932982",
"text": "def report(output)\n end",
"title": ""
},
{
"docid": "6be80050195c4f8a4be177a883bdf113",
"score": "0.49318543",
"text": "def save\n perform_save\n end",
"title": ""
},
{
"docid": "5ff7fdfc48cd1acddb947413fcbd2da7",
"score": "0.4931694",
"text": "def update\n respond_to do |format|\n if @bodily_output.update(bodily_output_params)\n format.html { redirect_to @bodily_output, notice: 'Bodily output was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bodily_output.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9052c6711ad58a0ea125d85e846e023b",
"score": "0.49312967",
"text": "def create\n @note = Note.new(note_params)\n\n respond_to do |format|\n if @note.save\n # format.html { redirect_to :back, notice: 'Note was successfully created.' }\n # format.json { render json: @note, status: :created, location: @note }\n # copies from alternate_values:\n format.html { redirect_to @note.note_object.metamorphosize, notice: 'Note was successfully created.' }\n format.json { render json: @note, status: :created, location: @note }\n else\n format.html { redirect_to :back, notice: 'Note was NOT successfully created.' }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f499a77ab53c599405e76f8b8a3acf7",
"score": "0.49279106",
"text": "def create\n @check_in_out = CheckInOut.new(check_in_out_params)\n\n qrcode = RQRCode::QRCode.new(@check_in_out.check_in_no.to_s)\n # With default options specified explicitly\n png = qrcode.as_png(\n resize_gte_to: false,\n resize_exactly_to: false,\n fill: 'white',\n color: 'black',\n size: 120,\n border_modules: 4,\n module_px_size: 6,\n file: './app/assets/images/Check_in_out_QrCode/'+@check_in_out.check_in_no.to_s+'.png' # path to write\n )\n\n respond_to do |format|\n if @check_in_out.save\n\n NewCheckInMailer.notify_check_in(@check_in_out).deliver\n\n format.html { redirect_to check_in_outs_path, notice: 'Check in out was successfully created.' }\n format.json { render :show, status: :created, location: @check_in_out }\n else\n format.html { render :new }\n format.json { render json: @check_in_out.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af40d1a7b594d9161d0c406d469adec2",
"score": "0.4926123",
"text": "def save_file(input_obj)\n\t$report_file.write(input_obj)\nend",
"title": ""
},
{
"docid": "7e58ef1ade1447efcb9a4638903660f0",
"score": "0.492437",
"text": "def footnote_content; end",
"title": ""
},
{
"docid": "150fbc7a6eca0eaf65fc6189fbbab397",
"score": "0.49206603",
"text": "def update\n respond_to do |format|\n if @note.update(note_params)\n format.html { redirect_to @note.note_object.metamorphosize, notice: 'Note was successfully created.' }\n format.json { render json: @note, status: :created, location: @note }\n else\n format.html { redirect_to :back, notice: 'Note was NOT successfully updated.' }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "188c8469bb58f6ca3223510c6cf345dd",
"score": "0.49196675",
"text": "def write_file (title, author, creator, producer, currentfile, outputfile = currentfile)\n\tif outputfile == nil\n\t\treturn false\n\tend\n\tf = Tempfile.new('pdfmetaedit')\n\tf.puts \"InfoKey: Title\"\n\tf.puts \"InfoValue: #{title}\"\n\tf.puts \"InfoKey: Author\"\n\tf.puts \"InfoValue: #{author}\"\n\tf.puts \"InfoKey: Creator\"\n\tf.puts \"InfoValue: #{creator}\"\n\tf.puts \"InfoKey: Producer\"\n\tf.puts \"InfoValue: #{producer}\"\n\tf.close\n\twillend = false\n\tupdateinfo\t= \"pdftk '#{currentfile}' update_info '#{f.path}' output '#{f.path}.pdf'\"\n\tcreateidir\t= \"pdftk '#{currentfile}' cat output '#{f.path}.pdf'\"\n\tmv\t\t\t= \"mv '#{f.path}.pdf' '#{outputfile}'\"\n\tsystem(updateinfo+\" || (\"+createidir+\" && \"+mv+\" && \"+updateinfo+\") && \"+mv)\n\tif $?.exitstatus == 0\n\t\tdialog = Gtk::MessageDialog.new(@window, \n\t\t\t\t\t\t\t\t\t\tGtk::Dialog::MODAL,\n\t\t\t\t\t\t\t\t\t\tGtk::MessageDialog::INFO,\n\t\t\t\t\t\t\t\t\t\tGtk::MessageDialog::BUTTONS_YES_NO,\n\t\t\t\t\t\t\t\t_(\"Metadata written successfully\") )\n\t\tdialog.title = _(\"Success\")\n\t\tdialog.secondary_text = _(\"Continue editing the source file?\")\n\t\tdialog.run do |response|\n\t\t\tif response == Gtk::Dialog::RESPONSE_NO\n\t\t\t\twillend = true\n\t\t\tend\n\t\t\tdialog.destroy\n\t\tend\n\telse\n\t\terror_window(_(\"Well, it seems something went wrong.\"))\n\tend\n\treturn willend\nend",
"title": ""
},
{
"docid": "1e1319bea7d9134bda424fc2a8995900",
"score": "0.49194884",
"text": "def save\n #code\n end",
"title": ""
},
{
"docid": "019ca5ce715fef363d54c88eed4a4c39",
"score": "0.49163765",
"text": "def save\n !update_case.has_key?(\"error\")\n end",
"title": ""
},
{
"docid": "993a4053931dda8f27bc59d3d08fd826",
"score": "0.49156243",
"text": "def create\n #Persist AT API Params\n @ussd = Ussd.new(sessionId: params[:sessionId], serviceCode: params[:serviceCode], phoneNumber: params[:phoneNumber], text: params[:text])\n @response = Response.new\n if @ussd.save\n # redirect_to ussd_path, :notice => \"Your post was saved\"\n # Reads the variables sent via POST from our gateway\n sessionId = @ussd.sessionId\n serviceCode = @ussd.serviceCode\n phoneNumber = @ussd.phoneNumber\n text = @ussd.text\n\n if ( text == \"\" )\n\n # This is the first request. Note how we start the response with CON\n response = \"CON What would you like to do? \\n\"\n response += \"1. is the value of happiness \\n\"\n response += \"2. is the formula of laughing\"\n @response.now = response\n\n elsif ( text == \"1\" )\n\n # Your business logic to determine the account number goes here\n accountNumber = \"ACC1001\"\n # This is a terminal request. Note how we start the response with END\n response = \"END Your account number is $accountNumber\"\n @response.now = response\n\n elsif ( text == \"2\" )\n\n # Your business logic to determine the balance goes here\n balance = \"KES 1,000\"\n # This is a terminal request. Note how we start the response with END\n response = \"END Your balance is $balance\"\n @response.now = response\n end\n\n # Print the response onto the page so that our gateway can read it\n #header('Content-type: text/plain');\n render plain: @response.now\n puts \"Content-Type: text/plain\"\n puts @response.now\n\n # DONE!!!\n else\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "f48a3062d6beea4410d36f506ee5bb4e",
"score": "0.4915111",
"text": "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end",
"title": ""
},
{
"docid": "f48a3062d6beea4410d36f506ee5bb4e",
"score": "0.4915111",
"text": "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end",
"title": ""
},
{
"docid": "2cdfb3d05a41e5382f1fd2ddd0ad37f5",
"score": "0.49144882",
"text": "def send_reply\n if self.response_changed?\n @notifiable = self\n @tutor = User.find(self.user_id)\n @student = User.find(self.pupil_id)\n\n if self.response == \"Declined\"\n @description = self.pupil.title + \" has sadly declined your offer\"\n @notifiable.notifications.create(:user => @tutor ,:receiver_id => @student.id, :message => 'You hve declined the offer by ' + @tutor.title)\n else\n @description = self.pupil.title + \" is now a student at your school\"\n @notifiable.notifications.create(:user => @tutor ,:receiver_id => @student.id, :message => 'You are now a student of ' + @tutor.title)\n end\n @notifiable.notifications.create(:user => @student, :receiver_id => @tutor.id, :message => @description)\n end\n end",
"title": ""
},
{
"docid": "6fa8d651d0757333194777785485c5ec",
"score": "0.49109232",
"text": "def create\n \t@session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n\t@appointment_payment = AppointmentPayment.new(params[:appointment_payment])\n\t@appointment_payment.patient_name=Number.new.change_patient_name(@appointment_payment.patient_name)\n \t\n\t# Get updated receipt/bill no\n\treceipt_no=Number.new # Create object to number table\n\t@appointment_payment.bill_no11=receipt_no.get_number('receipt',@appointment_payment.org_code) \t# Method calling \n\t# end\n respond_to do |format|\n if @appointment_payment.save\n \t@n=Number.find_by_name_and_org_code(\"receipt\",@appointment_payment.org_code)\n\t\[email protected]=@appointment_payment.bill_no11\n\t\[email protected]_attributes(params[:n])\n format.html { redirect_to(\"/appointment_payments/report/#{@appointment_payment.id}?print_type=original&format=pdf\") }\n format.xml { render :xml => @appointment_payment, :status => :created, :location => @appointment_payment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @appointment_payment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
723fc37d33aecdb1fe1366588a01f1c1
|
Imprime encabezado de pagina web SIN cookie.
|
[
{
"docid": "d1db88ac35017b7430946872b2861eda",
"score": "0.0",
"text": "def inicio\n cadena = 'Content-Type: text/html; charset=utf-8\\n\\n'\n cadena << '<!DOCTYPE html>'\n cadena << \"<html lang='es'>\"\n end",
"title": ""
}
] |
[
{
"docid": "f5ff28e95484fc8803f81eef5bbee76f",
"score": "0.5907952",
"text": "def sign_in_static_cookie\n cookies[:fulcrum_signed_in_static] = true\n end",
"title": ""
},
{
"docid": "080c349b5d481393222beb3c681cd497",
"score": "0.57700276",
"text": "def sign_in identity\n cookies.permanent[:auth_token] = identity.token\n end",
"title": ""
},
{
"docid": "724a6f7633e03ba206e7a8453c4e303c",
"score": "0.574377",
"text": "def cookie\n { :value => Crypt.encrypt(cookie_value), :expires => 1.year.from_now }\n end",
"title": ""
},
{
"docid": "ea07b4d3dc0c1874ac8b03f1e5dc7b5e",
"score": "0.57041746",
"text": "def encrypt_cookie(data)\n Base64.strict_encode64(Firebug.encrypt(Firebug.serialize(data)))\n end",
"title": ""
},
{
"docid": "63ae5b86b1a35d1eabaa823450c0003e",
"score": "0.57000345",
"text": "def set_sso_cookie!\n Rails.logger.info('SSO: ApplicationController#set_sso_cookie!', sso_logging_info)\n\n return unless Settings.sso.cookie_enabled && @session_object.present?\n\n encryptor = SSOEncryptor\n encrypted_value = encryptor.encrypt(ActiveSupport::JSON.encode(sso_cookie_content))\n cookies[Settings.sso.cookie_name] = {\n value: encrypted_value,\n expires: nil, # NOTE: we track expiration as an attribute in \"value.\" nil here means kill cookie on browser close.\n secure: Settings.sso.cookie_secure,\n httponly: true,\n domain: Settings.sso.cookie_domain\n }\n end",
"title": ""
},
{
"docid": "689e73e97c209c0982e5da36fa87a5e1",
"score": "0.5685943",
"text": "def new\n\t\tcookies[:sign_up] = { value: \"XJ-122\", expires: 1.hour.from_now }\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "459ea09363d9f33d33ffbc86337989da",
"score": "0.5562579",
"text": "def emulate_javascript_set_cookie\n @browser.get(HOST + \"Login.asp\")\n @browser.get(HOST + \"Search.asp\")\n end",
"title": ""
},
{
"docid": "395b85501cf6b3f2a8250b304688f7d3",
"score": "0.554304",
"text": "def cookie_jar; end",
"title": ""
},
{
"docid": "395b85501cf6b3f2a8250b304688f7d3",
"score": "0.554304",
"text": "def cookie_jar; end",
"title": ""
},
{
"docid": "395b85501cf6b3f2a8250b304688f7d3",
"score": "0.554304",
"text": "def cookie_jar; end",
"title": ""
},
{
"docid": "395b85501cf6b3f2a8250b304688f7d3",
"score": "0.554304",
"text": "def cookie_jar; end",
"title": ""
},
{
"docid": "bb7dc26282e3f503a993ceca61b2d648",
"score": "0.549994",
"text": "def cookie_expiration\n super\n end",
"title": ""
},
{
"docid": "89aab1b30460d5aff54e35affd32f28c",
"score": "0.54610264",
"text": "def encode_set_cookie h, secure\n secure = @secure unless @secure.nil?\n expire = (Time.now + @expire).gmtime.rfc2822 if @expire\n # NOTE +encode h+ may return empty value, but it's still fine\n \"Set-Cookie: #{@name}=#{encode h}; Path=/; HttpOnly#{'; Secure' if secure}#{\"; Expires=#{expire}\" if expire}\\r\\n\"\n end",
"title": ""
},
{
"docid": "cd8976241c0b0099058a62cf24e70eb8",
"score": "0.54610145",
"text": "def stash_cookie\n cookies[self.class.els_options['cookie']] = {\n :value => @els_identity.token_id,\n :domain => request.env[\"SERVER_NAME\"],\n :path => '/',\n :expires => Time.now + 24.hours\n }\n end",
"title": ""
},
{
"docid": "2ba380208d9985442424f0833c6c5460",
"score": "0.5429748",
"text": "def signed_in_user\n \n unless signed_in?\n\t\tstore_location\n\t\tredirect_to signin_url, notice: \"Por favor iniciar sesion.\"\n else\n\t\txuser = current_user\n\t\tvidioma = xuser.idioma_isocod2\t\t\n\t\t$idioma = ''\n\t\tunless vidioma.empty?\n\t\t\tI18n.locale = vidioma\n\t\t\t$idioma = vidioma\n\t\tend\n\t\tif $controller_keyd != controller_name\n\t\t $controller_keyd = ''\n\t\t cookies.delete(:f01cd23aa)\n\t\tend \n\tend\n\n end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "f693eedba2f45e33c44208eb23588781",
"score": "0.54240865",
"text": "def cookies; end",
"title": ""
},
{
"docid": "0c26052b1745fd9b46dc38e048d68eaa",
"score": "0.54069746",
"text": "def cookie_jar=(_arg0); end",
"title": ""
},
{
"docid": "0c26052b1745fd9b46dc38e048d68eaa",
"score": "0.54069746",
"text": "def cookie_jar=(_arg0); end",
"title": ""
},
{
"docid": "8ddc42d80f5824ba132a1d1c34b67e25",
"score": "0.5394387",
"text": "def serialize_into_cookie(record); end",
"title": ""
},
{
"docid": "3ddad30d2f507a2213ca4ee119a59117",
"score": "0.539347",
"text": "def to_cookie\n unless self.empty?\n data = self.serialize\n value = Merb::Parse.escape \"#{data}--#{generate_digest(data)}\"\n if value.size > MAX\n msg = \"Cookies have limit of 4K. Session contents: #{data.inspect}\"\n Merb.logger.error!(msg)\n raise CookieOverflow, msg\n end\n value\n end\n end",
"title": ""
},
{
"docid": "49dcf163fa1d7ac954821654a8bb5694",
"score": "0.5387703",
"text": "def encode_to_cookie h, cookie\n cookie[@name] = encode h\n end",
"title": ""
},
{
"docid": "0bf46a4d2806db8f8cbe192942b17a4c",
"score": "0.538039",
"text": "def alter_payment_cookie\n new_cookie = payment_in_process_cookie.dup\n new_cookie[:pending] = true if new_cookie[:session_id] == params[:req_merchant_defined_data2]\n cookies[:payment_in_process] = {\n value: new_cookie.to_json,\n httponly: true,\n expires: 10.minutes\n }\n end",
"title": ""
},
{
"docid": "5d1c85d20b257f451386302c03b69126",
"score": "0.53412217",
"text": "def fortune_cookie; end",
"title": ""
},
{
"docid": "550e092f51da4b3221119f0c94f38c00",
"score": "0.53051686",
"text": "def cookie\n # 'frontend=aaa'\n nil\n end",
"title": ""
},
{
"docid": "fb68ba48d6ea60575ae8bdaee6a65186",
"score": "0.5302819",
"text": "def cookie_value; end",
"title": ""
},
{
"docid": "1f9fd3ff77df8e9abfc440930802a2a2",
"score": "0.52918863",
"text": "def cookie_name\n super\n end",
"title": ""
},
{
"docid": "b73ce926ef01dc62566ec1972167f6dc",
"score": "0.52845794",
"text": "def index\n for i in 1..200\n #cookies[\"cookie \"+i.to_s] = { value: \"Guru \"+i.to_s, secure: true}\n end\n end",
"title": ""
},
{
"docid": "cb15cbc4e3ffff59fb8dd9cdb977c3ba",
"score": "0.52674717",
"text": "def cookie_persistence_method\n super\n end",
"title": ""
},
{
"docid": "edbfbedeb490723944ddeab99d443416",
"score": "0.5255763",
"text": "def hubssolib_set_secure_cookie_data(name, value)\n if (@hubssolib_have_written_cookie)\n raise \"HubSsoLib: Attmept to set cookie '#{name}' more than once\"\n end\n\n @hubssolib_have_written_cookie = true\n\n # Using cookies.delete *should* work but doesn't. Set the\n # cookie with nil data instead.\n\n data = value.nil? ? nil : HubSsoLib::Crypto.encode_object(value, request.remote_ip)\n\n # No expiry time; to aid security, use session cookies only.\n\n cookies[name] = {\n :value => data,\n :path => HUBSSOLIB_COOKIE_PATH,\n :secure => true\n }\n end",
"title": ""
},
{
"docid": "b42273affe00388b5cbe929ed9b208dd",
"score": "0.52432126",
"text": "def cookie_jar=(cookie_jar); end",
"title": ""
},
{
"docid": "9441d786e6a096c0c25080b7d834c149",
"score": "0.522134",
"text": "def encript_ep \n\t\tsign_in_data = {\n\t\t\temail: email\n\t\t}\n\t\t\n\t sign_in_data.each do |key,attr_val|\n encrypted_data = AseEncriptDecriptJob::encryption(attr_val)\n self.send(\"#{key}=\",encrypted_data) \n\t end\n\tend",
"title": ""
},
{
"docid": "3fc931d36c749f005d59a4fef4b737fe",
"score": "0.52206826",
"text": "def serialize_from_cookie(*args); end",
"title": ""
},
{
"docid": "b4a22cb945093ed458961ffff2ceda12",
"score": "0.52091014",
"text": "def get_id_from_cookie\n Sinatra::Authentication::Cookies::Hashing.decrypt(cookies[:ottoman_connection], settings.private_key)\n end",
"title": ""
},
{
"docid": "c6f291bfddddf351ab91c3c7a89a5566",
"score": "0.5142777",
"text": "def manually_set_cookie(value, expire_in)\n expire_date = expire_in.from_now.gmtime.strftime('%a, %d %b %Y %H:%M:%S GMT')\n response['Set-Cookie'] =\n \"cookiePermissions=#{value}; Expires=#{expire_date}; Path=/; SameSite=Lax\"\n end",
"title": ""
},
{
"docid": "3aeefc6264130fefb800fc3cf43cc42d",
"score": "0.51232064",
"text": "def store_session_id(id, expires_at)\n cookies.encrypted[QuoVadis.cookie_name] = {\n value: id,\n httponly: true,\n secure: Rails.env.production?,\n same_site: :lax,\n expires: expires_at # setting expires_at to nil has the same effect as not setting it\n }\n end",
"title": ""
},
{
"docid": "a04e4f532a4e05d0408072bafa38aed3",
"score": "0.5120736",
"text": "def cookies(cookies); end",
"title": ""
},
{
"docid": "165aa9887464fbd2602fa3c44afd131e",
"score": "0.50817454",
"text": "def set_cookie\n puts \"hello\"\n # puts @order.as_json\n puts \"-==-=-=-\"\n puts \"-==-=-=-\"\n puts cookies[:name] = current_admin.name\n puts \"-==-=-=-\"\n puts \"-==-=-=-\"\n end",
"title": ""
},
{
"docid": "8ba371ae805886f0e7a0043e23cbfded",
"score": "0.50807047",
"text": "def cookie\n shiftnote = RestClient.get('https://ww1.shiftnote.com/BulletinBoard/', Cookie: @cookie)\n\n doc = Nokogiri::HTML.parse(shiftnote.body)\n\n begin\n doc.search('div#MyScheduleDiv').at('script').text\n rescue NoMethodError\n generate_cookie(@credentials[:username], @credentials[:password])\n end\n @cookie\n end",
"title": ""
},
{
"docid": "013cc63be25b33fab4fe86a352667d6d",
"score": "0.5076925",
"text": "def tmp_sign_up\n unless cookies.encrypted[:oiam_cadre].nil?\n @cadre = CadreInfo.find_by_id(cookies.encrypted[:oiam_cadre])\n flash[:notice] = \"Vous pouvez continuer votre test.\"\n redirect_to my_tests_path\n end\n @cadreInfo = CadreInfo.new\n end",
"title": ""
},
{
"docid": "f3c38681cec595ed4416b57db255b886",
"score": "0.5074749",
"text": "def save_cookie(cookie)\n dputs __method__.to_s\n File.open($CONF['cookie'], \"w\") do |fc|\n fc.write(cookie)\n end\nend",
"title": ""
},
{
"docid": "bf77a64a80769f5db2b28904cbbf18c5",
"score": "0.50620013",
"text": "def show\n cookies[:arch_nombre] = { value: @archive.nombre, expires: 10.minutes.from_now }\n cookies[:arch_email] = { value: @archive.email, expires: 10.minutes.from_now }\n cookies[:arch_tel] = { value: @archive.telefono, expires: 10.minutes.from_now }\n end",
"title": ""
},
{
"docid": "4caa6af129f7d24f90a7e4960124a7dc",
"score": "0.5049081",
"text": "def set_cookie(email=nil, nav=false)\n if nav\n cookies[\"bunch__nav\"] = {\n value: \"open\", \n expires: 365.days.from_now\n }\n end\n end",
"title": ""
},
{
"docid": "726fdb2b4c06495ee404aee9aaee69eb",
"score": "0.50479275",
"text": "def set_cookie(cookie_name, value, expires, encrypt=false)\n cookie_obj = (encrypt == true) ? cookies.encrypted : cookies\n cookie_obj[cookie_name.to_sym] = {\n value: value,\n expires: expires,\n domain: request.host,\n http_only: true,\n secure: !(Rails.env.development? || Rails.env.staging?),\n same_site: :strict\n }\n end",
"title": ""
},
{
"docid": "577e5090852d8069c335c208e879ec84",
"score": "0.5036638",
"text": "def cookie_named(name); end",
"title": ""
},
{
"docid": "222ddc74c7207aeee56b2acdfabe3bc8",
"score": "0.5024898",
"text": "def cookieMe\n if user_signed_in?\n cookies[:user_id] = current_user.id\n cookies[:user_token] = current_user.salt\n cookies[:user_username] = current_user.username\n cookies[:language] = current_user.language\n elsif !user_signed_in?()\n cookies.delete :user_id\n cookies.delete :user_token\n cookies.delete :user_username\n end\n end",
"title": ""
},
{
"docid": "87a353c40908fd1489fab326648852c8",
"score": "0.501408",
"text": "def handle_unverified_request\n super\n cookies.delete(:autologin)\n end",
"title": ""
},
{
"docid": "5c1a75c26f78028ae8f0445993dc6695",
"score": "0.500099",
"text": "def cookie_hash_offset\n super\n end",
"title": ""
},
{
"docid": "6108194964f43b4e3bb198ed2676956b",
"score": "0.49966833",
"text": "def encrypt_token *args\n raw = [\"Ra\", ThreeScale::SSO::VERSION, \"%10.5f\" % Time.now.utc, @expires_at, \"zZ\"]\n raw.insert 3, *args\n @me.encrypt_and_sign raw.join(ThreeScale::SSO::SEPARATOR)\n end",
"title": ""
},
{
"docid": "83865ed79e52caed6023be2b3fe9489a",
"score": "0.4992658",
"text": "def initialize\n @loggedin = false\n @cookie = nil\n end",
"title": ""
},
{
"docid": "9e857e0fba38dcc32e88dba1c83048b1",
"score": "0.49882507",
"text": "def sign_in(user)\n session[:session_token] = SecureRandom.urlsafe_base64\n user.update!(session_token: session[:session_token])\n end",
"title": ""
},
{
"docid": "fbdbeddcf259f7a113a5a64c3ff82502",
"score": "0.49803728",
"text": "def set_encoded_key(enc)\n set_session_key(EzCrypto::Key.decode(enc))\n end",
"title": ""
},
{
"docid": "1afda0f3785b1e16c40420257c5aa9b9",
"score": "0.49761426",
"text": "def cookieMe\n if user_signed_in?\n cookies[:user_id] = current_user.id\n cookies[:user_token] = current_user.salt\n cookies[:user_username] = current_user.username\n cookies[:language] = current_user.language\n elsif !user_signed_in?()\n cookies.delete :user_id\n cookies.delete :user_token\n cookies.delete :user_username\n end\n end",
"title": ""
},
{
"docid": "98324c588a4911690092befa6328c860",
"score": "0.4970696",
"text": "def sign_in\n request.session = { authorized: true }\n end",
"title": ""
},
{
"docid": "58577f5fe9713a1f611501a48a92a462",
"score": "0.49636376",
"text": "def set_session(account)\n if account.is_anonymous?\n @session[:account_id] = nil\n @cookies.delete(:secure_account_id)\n else\n @session[:account_id] = account.id\n @cookies.encrypted[:secure_account_id] = { secure: true,\n httponly: true, value: \"secure#{account.id}\" }\n end\n end",
"title": ""
},
{
"docid": "870bfd8e5ed9f6ba87c61cd3aac1adb6",
"score": "0.49195203",
"text": "def cookies\n # renders static page\n end",
"title": ""
},
{
"docid": "553a1378f4b751d669ddcf360259b5d8",
"score": "0.49109125",
"text": "def extend_session!\n Rails.logger.info('SSO: ApplicationController#extend_session!', sso_logging_info)\n\n @session_object.expire(Session.redis_namespace_ttl)\n @current_user&.identity&.expire(UserIdentity.redis_namespace_ttl)\n @current_user&.expire(User.redis_namespace_ttl)\n set_sso_cookie!\n end",
"title": ""
},
{
"docid": "51fb74a0f314bdf6cfa621f6625e1e8c",
"score": "0.4905313",
"text": "def save_user_info\n if current_user\n cookies[:provider] = current_user.provider\n cookies[:current_institution] = current_institution.code.downcase\n end\n end",
"title": ""
},
{
"docid": "07fa438e7dbc2975d7a474ae6f2a1a72",
"score": "0.49009284",
"text": "def add(cookie)\n # self\n end",
"title": ""
},
{
"docid": "43f09ac294482f9a793f1bba8d83304a",
"score": "0.4899207",
"text": "def index\n # Test ob sich client_key-Cookie entschlüsseln lässt\n begin\n database_helper_decrypt_value(cookies[:client_key])\n rescue Exception\n cookies.delete(:client_key) # Verwerfen des nicht entschlüsselbaren Cookies\n cookies.delete(:client_salt)\n end\n\n\n unless cookies[:client_key] # Erster Zugriff in neu gestartetem Browser oder Cookie nicht mehr verfügbar\n loop_count = 0\n while loop_count < MAX_NEW_KEY_TRIES\n loop_count = loop_count+1\n new_client_key = rand(10000000)\n unless get_client_info_store.exist?(new_client_key) # Dieser Key wurde noch nie genutzt\n # Salt immer mit belegen bei Vergabe des client_key, da es genutzt wird zur Verschlüsselung des Client_Key im cookie\n cookies[:client_salt] = { :value => rand(10000000000), :expires => 1.year.from_now } # Lokaler Schlüsselbestandteil im Browser-Cookie des Clients, der mit genutzt wird zur Verschlüsselung der auf Server gespeicherten Login-Daten\n cookies[:client_key] = { :value => database_helper_encrypt_value(new_client_key), :expires => 1.year.from_now }\n get_client_info_store.write(new_client_key, 1) # Marker fuer Verwendung des Client-Keys\n break\n end\n end\n raise \"Cannot create client key after #{MAX_NEW_KEY_TRIES} tries\" if loop_count >= MAX_NEW_KEY_TRIES\n else\n cookies[:client_salt] = { :value => cookies[:client_salt], :expires => 1.year.from_now } # Timeout neu setzen bei Benutzung\n cookies[:client_key] = { :value => cookies[:client_key], :expires => 1.year.from_now } # Timeout neu setzen bei Benutzung\n end\n\n # Entfernen evtl. bisheriger Bestandteile des Session-Cookies\n cookies.delete(:locale) if cookies[:locale]\n cookies.delete(:last_logins) if cookies[:last_logins]\n session.delete(:locale) if session[:locale]\n session.delete(:last_used_menu_controller) if session[:last_used_menu_controller]\n session.delete(:last_used_menu_action) if session[:last_used_menu_action]\n session.delete(:last_used_menu_caption) if session[:last_used_menu_caption]\n session.delete(:last_used_menu_hint) if session[:last_used_menu_hint]\n session.delete(:database) if session[:database]\n session.delete(:dbid) if session[:dbid]\n session.delete(:version) if session[:version]\n session.delete(:db_block_size) if session[:db_block_size]\n session.delete(:wordsize) if session[:wordsize]\n session.delete(:dba_hist_cache_objects_owner) if session[:dba_hist_cache_objects_owner]\n session.delete(:dba_hist_blocking_locks_owner) if session[:dba_hist_blocking_locks_owner]\n session.delete(:request_counter) if session[:request_counter]\n session.delete(:instance) if session[:instance]\n session.delete(:time_selection_start) if session[:time_selection_start]\n session.delete(:time_selection_end) if session[:time_selection_end]\n\n\n set_I18n_locale(get_locale) # ruft u.a. I18n.locale = get_locale auf\n\n write_to_client_info_store(:last_used_menu_controller, 'env')\n write_to_client_info_store(:last_used_menu_action, 'index')\n write_to_client_info_store(:last_used_menu_caption, 'Start')\n write_to_client_info_store(:last_used_menu_hint, t(:menu_env_index_hint, :default=>\"Start of application without connect to database\"))\n rescue Exception=>e\n set_current_database(nil) # Sicherstellen, dass bei naechstem Aufruf neuer Einstieg\n raise e # Werfen der Exception\n end",
"title": ""
},
{
"docid": "05942d0e22b8b0faeb22fb15e8a7ffcb",
"score": "0.48958573",
"text": "def add_to_cookie_2 (id)\n cookies[:scotids] ? cookies[:scotsids] = JSON.parse(cookies[:scotsids]) << \"#{id}\" : cookies[:scotsids] = JSON.generate([\"#{id}\"])\n end",
"title": ""
},
{
"docid": "7b63b4dfc0c8ee019d4fe5decfe4c3e2",
"score": "0.48927355",
"text": "def send_cookie(name, value = nil)\n @context.add_cookie(name, value)\n end",
"title": ""
},
{
"docid": "9f6962373b8bb129d6ee414510a51a48",
"score": "0.48911694",
"text": "def session_remember\n httpsession = Thread.current[:hayabusa][:httpsession]\n raise \"Could not figure out HTTP-session.\" if !httpsession\n session = httpsession.session\n raise \"Could not get session-variable from HTTP-session.\" if !session\n session[:remember] = 1\n \n self.cookie(\n \"name\" => \"HayabusaSession\",\n \"value\" => _httpsession.session_id,\n \"path\" => \"/\",\n \"expires\" => Time.now + 32140800 #add around 12 months\n )\n end",
"title": ""
},
{
"docid": "84affbe5a81c34bd38a811833f2e0eef",
"score": "0.4888613",
"text": "def iss_url\n session[:iss_url]\n end",
"title": ""
},
{
"docid": "276040c692e678f889eb79a45b7d2d81",
"score": "0.48880783",
"text": "def nonce; end",
"title": ""
},
{
"docid": "7a15e8cf9a6a6dd109d426a3c545ad6b",
"score": "0.48847064",
"text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end",
"title": ""
},
{
"docid": "7a15e8cf9a6a6dd109d426a3c545ad6b",
"score": "0.48847064",
"text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end",
"title": ""
},
{
"docid": "7a15e8cf9a6a6dd109d426a3c545ad6b",
"score": "0.48847064",
"text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end",
"title": ""
},
{
"docid": "0e479bfdf499d3a97780d166831cdc30",
"score": "0.48765078",
"text": "def sign_in_as(user)\n #post user_session_url, params: { sig: user.perishable_signature }\n post user_session_url, params: { session: { email: user.email, password: user.password } }\n end",
"title": ""
},
{
"docid": "3ea6ffadf022079f6ea8c2c5d9c8898c",
"score": "0.48761326",
"text": "def kms_encrypt_pii!(session)\n return unless session.dig('warden.user.user.session', 'decrypted_pii')\n decrypted_pii = session['warden.user.user.session'].delete('decrypted_pii')\n session['warden.user.user.session']['encrypted_pii'] =\n kms_encrypt(decrypted_pii)\n nil\n end",
"title": ""
},
{
"docid": "fe1bb44e7de474953245a7e34c84427e",
"score": "0.4868469",
"text": "def set_payment_cookie\n cookies[:payment_in_process] = {\n value: {\n billseq: create_payment_params[:billseq],\n session_id: create_payment_params[:session_id],\n group: create_payment_params[:group]\n }.to_json,\n httponly: true,\n expires: 10.minutes\n }\n end",
"title": ""
},
{
"docid": "551c7683cb23c9277be229c3f330ac69",
"score": "0.4865495",
"text": "def generate_cookie\n cookies[:credit_request] = SecureRandom.hex(32)\n end",
"title": ""
},
{
"docid": "6daf60a36309a56ab5edae7024ed9060",
"score": "0.48637125",
"text": "def store_session(res)\n res.set_cookie\n end",
"title": ""
},
{
"docid": "4aed2e881bb5c01d76aae635205c9e85",
"score": "0.48611137",
"text": "def sso_cookie_content\n return nil if @current_user.blank?\n\n {\n 'patientIcn' => (@current_user.mhv_icn || @current_user.icn),\n 'mhvCorrelationId' => @current_user.mhv_correlation_id,\n 'signIn' => @current_user.identity.sign_in.deep_transform_keys { |key| key.to_s.camelize(:lower) },\n 'credential_used' => sso_cookie_sign_credential_used,\n 'expirationTime' => @session_object.ttl_in_time.iso8601(0)\n }\n end",
"title": ""
},
{
"docid": "f2cd7552532de0aab5f5541f56ec1621",
"score": "0.48586255",
"text": "def delete_cookie(name); end",
"title": ""
},
{
"docid": "11537fc563ddccf87ec7b7e77cf1013b",
"score": "0.48577872",
"text": "def http_cookie\n http.cookie\n end",
"title": ""
},
{
"docid": "b011d3ba5103aa09897fbfe78e50ece7",
"score": "0.48528028",
"text": "def destroy\n\t\tcookies.delete 'Vanilla'\n\t\tcookies.delete 'Vanilla-Volatile'\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "c87093bc84e91740ce7d7d74a4d15793",
"score": "0.48471788",
"text": "def cookie_hash_length\n super\n end",
"title": ""
},
{
"docid": "cc9de6615721bd0e2ffcf8d03e427bcb",
"score": "0.4837379",
"text": "def sign(req, ts)\n md5_salt = \"ifxy8jvzf1q0f9uz\"\n body = \"#{CGI.escape(req)}#{ts}#{md5_salt}\"\n # md5.update body.upcase\n sign = Digest::MD5.hexdigest body\n sign.upcase\nend",
"title": ""
},
{
"docid": "a3a8f28893f72907bddda2b58f6c893d",
"score": "0.48344544",
"text": "def init_cookies\n cookies[:language] = @language.code unless cookies[:language]\n cookies[:logged_in] = (admin? ? 'admin' : logged_in?.to_s) unless cookies[:logged_in]\n cookies.delete( :dont_cache ) if cookies[:dont_cache] and flash.empty? and request.request_uri =~ /^#{cookies[:dont_cache]}/\n end",
"title": ""
},
{
"docid": "f3ba26bec335c9a118d9621075172687",
"score": "0.48305348",
"text": "def sign_in(user)\n # save current_user in remember_token cookie\n self.current_user = user \n cookies.permanent.signed[:remember_token] = [user.email, user.salt] \n end",
"title": ""
},
{
"docid": "0461b07af01493a84d0759295baafefc",
"score": "0.4827576",
"text": "def handler(req)\n cookie = req[:event]['headers'] and req[:event]['headers']['Cookie']\n if cookie\n raw = CGI::parse(req[:event]['headers']['Cookie'])\n idx = raw.key?('idx')\n if idx\n accountID = raw['idx'][0]\n authorized(accountID)\n else\n unauthorized()\n end\n else\n unauthorized()\n end\nrescue StandardError=> e\n puts e.message\n unauthorized()\nend",
"title": ""
},
{
"docid": "7e299ff5b7c4656c66bdcf121789dd02",
"score": "0.4826893",
"text": "def store_session(res)\n path = \"\\\\\"\n value = \n res.set_cookie(\"_rails_lite_app\", \"\") \n end",
"title": ""
},
{
"docid": "9e3d62c37aa8fdc15d1b6417b53f92bc",
"score": "0.48250234",
"text": "def set_api_cookie!\n return unless @session_object\n\n session.delete :value\n @session_object.to_hash.each { |k, v| session[k] = v }\n end",
"title": ""
},
{
"docid": "71614572bd877184b62cfa8e91aab46f",
"score": "0.48206753",
"text": "def skip_set_cookies_header\n reset_session\n end",
"title": ""
},
{
"docid": "eb6b88294eb7ab696d6ca69bb45e5132",
"score": "0.48180962",
"text": "def accept_cookies\n if has_button_accept_cookies?\n button_accept_cookies.click\n end\n end",
"title": ""
},
{
"docid": "67d667183ab1945fa895f0fcf0f9eca1",
"score": "0.48161447",
"text": "def authCookie\n \"auth_pubtkt=uid%3D...\"\n end",
"title": ""
},
{
"docid": "87f2c15cbd25cf746e1e2bea7105da02",
"score": "0.4799319",
"text": "def set_data_in_cookie(data)\n cookies[:merged_response] = {\n :value => data,\n :expires => 1.hour.from_now,\n \n }\n end",
"title": ""
},
{
"docid": "26b11a5dd7d244d276abc44800262fae",
"score": "0.47974637",
"text": "def hubssolib_get_secure_cookie_data(name)\n return HubSsoLib::Crypto.decode_object(cookies[name], request.remote_ip)\n end",
"title": ""
},
{
"docid": "daff617fa95cd5ee4a0b6fb67e7795fd",
"score": "0.47953245",
"text": "def clearcookies\n cookies.delete Prismic::PREVIEW_COOKIE\n redirect_to '/'\n end",
"title": ""
},
{
"docid": "64e17bbd898cd87a1327bf07649b9f2b",
"score": "0.47951797",
"text": "def raw_cookie\n env_table[\"HTTP_COOKIE\"]\n end",
"title": ""
},
{
"docid": "bf7123027cd3554ff5871561260f03c1",
"score": "0.47920606",
"text": "def set_logged_in(ip)\n @id = BeEF::Core::Crypto::secure_token\n @nonce = BeEF::Core::Crypto::secure_token\n @ip = ip\n end",
"title": ""
},
{
"docid": "e706fae0a0f2f79e9188f90fcabb76c9",
"score": "0.47905388",
"text": "def save_cookie(requested_lang)\n cookies[:lang] = {\n :value => requested_lang,\n :expires => 1.month.from_now,\n :path => root_path\n }\n end",
"title": ""
},
{
"docid": "186332ae80734f5bc1826f9500562b34",
"score": "0.4781482",
"text": "def session_dont_remember\n httpsession = Thread.current[:hayabusa][:httpsession]\n raise \"Could not figure out HTTP-session.\" if !httpsession\n session = httpsession.session\n raise \"Could not get session-variable from HTTP-session.\" if !session\n session[:remember] = 0\n \n self.cookie(\n \"name\" => \"HayabusaSession\",\n \"value\" => _httpsession.session_id,\n \"path\" => \"/\"\n )\n end",
"title": ""
},
{
"docid": "99ad35c4108a10d6656b4e82e9d4b173",
"score": "0.47809276",
"text": "def create_session_cookie_if_needed\n if !params[:fb_sig_in_iframe].blank? && cookies[ActionController::Base.session_options[:key]].nil?\n @handle_url = url_for(\"/fb_session/set?request_path=\" + URI::escape(non_fb_params, \"/=!?&\"))\n render :layout => \"fb_session\", :template => \"fb_session/cookie_handling\"\n end\n end",
"title": ""
},
{
"docid": "c2b41c40fb3cc626a4170b2fd332325e",
"score": "0.47786143",
"text": "def store_session(res)\n res.set_cookie(cookie_key, { value: @cookie.to_json, path: '/' })\n end",
"title": ""
}
] |
7cfa3107b74854130fe7fd6bd2ac237b
|
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/chat.rb74
|
[
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.0",
"text": "def to_s; end",
"title": ""
}
] |
[
{
"docid": "689202b8c570aabcbfb5307dc09210f4",
"score": "0.69484586",
"text": "def to_s\n '<Twilio::REST::Chat::V3>';\n end",
"title": ""
},
{
"docid": "2f1f121c481a49f24026198a9478fc9e",
"score": "0.6588045",
"text": "def to_s\n '<Twilio::REST::Chat::V3>'\n end",
"title": ""
},
{
"docid": "2999d86893745ad3072181fac524871c",
"score": "0.6363423",
"text": "def chat_messages(chat_messages = {}); JSON[Api::get_chat_messages(chat_messages, self)]; end",
"title": ""
},
{
"docid": "d9abd3bf3f9663c69a865e3256a6fdc9",
"score": "0.634711",
"text": "def response_msg(conversation_id)\n\t\t{\n \t\"conversation_id\": conversation_id,\n\t\t\t\"text\": \"우리멍냥 응답 메세지\",\n\t\t\t\"blocks\": [\n\t\t\t\t{\n\t\t\t\t \"type\": \"text\",\n\t\t\t\t \"text\": \"*처리되었습니다. 감사합니다.*🐱 🐶\",\n\t\t\t\t \"markdown\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}.to_json\t\n\tend",
"title": ""
},
{
"docid": "58edfd10d3dd290d9bbef1b826bc9462",
"score": "0.6227701",
"text": "def chat; end",
"title": ""
},
{
"docid": "3b1555b1401883048705131f4714018f",
"score": "0.6183386",
"text": "def tweet\n return \"Chirp chirp\"\n end",
"title": ""
},
{
"docid": "f3055ec6490d607bbc24cd33ce13cb2b",
"score": "0.6173222",
"text": "def to_s\r\n status = with_name\r\n \r\n if with_artist.length <= TWITTER_MAX_MSG_LEN\r\n status = with_artist\r\n end\r\n \r\n if with_album.length <= TWITTER_MAX_MSG_LEN\r\n status = with_album\r\n end\r\n \r\n if with_url.length <= TWITTER_MAX_MSG_LEN\r\n status = with_url\r\n end\r\n \r\n # if status.length > TWITTER_MAX_MSG_LEN # still too long, enforce length restriction\r\n # status = \"#{status[1, 137]}...\"\r\n # end\r\n \r\n status\r\n end",
"title": ""
},
{
"docid": "20dafa0851c8acd92a2b0ab8457cd2dc",
"score": "0.61611456",
"text": "def lux(chat)\n chat.post \"[Skype Bot] FLASH FOR FIRSTBLOOD!\"\nend",
"title": ""
},
{
"docid": "e4f5884410fe145b62305eb5bcd7ce7e",
"score": "0.6142637",
"text": "def render_msg \r\n render :text=>fbml_msg_format(params[:type],params[:msgs].split(\"####\"),{:title=>params[:title],:list=>params[:list] == \"true\"})\r\n end",
"title": ""
},
{
"docid": "4639e4d7e25f9bad633356678516725a",
"score": "0.6137166",
"text": "def chat_info\n return @chat_info\n end",
"title": ""
},
{
"docid": "b80332121d172467bed61d3897af590b",
"score": "0.607308",
"text": "def twitter_msg\n msg = PLANETOID_CONF[:twitter][config_key_for_class][:prefix][0..139]\n \n if msg.length < 135\n msg = msg + \" \" + title[0..(140 - msg.length - 2)]\n \n if msg.length < 140 && short_url.length < (140 - msg.length)\n msg = msg + \" \" + short_url\n end\n end\n\n msg\n end",
"title": ""
},
{
"docid": "9a6b9e2a9774eb32a01546ac1b26d35b",
"score": "0.6070785",
"text": "def get_text(msg)\n {\n response_type: 'in_channel',\n text: msg\n }.to_json\nend",
"title": ""
},
{
"docid": "31f972215c5e8b7186e86624bdc854db",
"score": "0.6070782",
"text": "def show\n render json: @chat_message\n end",
"title": ""
},
{
"docid": "137f94e6ace004889947f48301e4b703",
"score": "0.6061616",
"text": "def chat(text, owo = false)\n API.get(\"chat?text=#{URI.encode(text)}#{'&owo=true' if owo}\")['response']\n end",
"title": ""
},
{
"docid": "88a463bc754cbfe5c264324d78d9c67d",
"score": "0.6053261",
"text": "def chat(response)\n response.reply \"Lita #{Lita::VERSION} - http://www.lita.io/\"\n end",
"title": ""
},
{
"docid": "2ff4592682d3969114f0b4b5b254539f",
"score": "0.6050139",
"text": "def pretty\n \"(#{chat}) #{to || 'n/a'}: #{text.slice(0..20)}...\"\n end",
"title": ""
},
{
"docid": "29dc396fc25a6c3597b1c224d77d8d7e",
"score": "0.60430104",
"text": "def messages()\n user = params[:user_id]\n messages = []\n if params[:name]\n messages << {type: 'text', text: \"Hello, #{params[:name]}!\"}\n messages << {type: 'rich', html: \"<img src='https://m.popkey.co/b02639/pDgKO.gif'>\"}\n end\n if params[:text]\n msg = params[:text]\n location = \"\"\n reply = \"\"\n $QUERIES.each_with_index do |q, ind|\n tomorrow = q.include?('tomorrow')\n next unless location == \"\"\n if msg.include?(q)\n parse = msg.split(q).each{|phrase| phrase.strip}\n location = parse[-1]\n # grab coordinates\n coords = loc_json(location)\n if coords[:coords].empty?\n reply = \"Sorry, that location (#{location}) doesn't seem to exist. Try again?\"\n messages << {type: 'rich', html: reply}\n next\n else\n loc = coords[:coords]\n address = coords[:address]\n end\n # grab weather\n weather = weather_json(loc)\n # write out the response\n messages << {\n type: 'rich',\n html: \"<iframe src='#{icon(weather['currently']['icon'])}'></iframe>\"\n }\n reply = weather_response(address, weather, tomorrow)\n messages << {type: 'rich', html: reply}\n end\n end\n if reply.empty? # parrot back what you say unless you're asking about weather\n reply = \"<i>#{msg}</i>\"\n messages << {type: 'rich', html: reply}\n end\n end\n render json: {\n success: 'success',\n messages: messages\n }\n end",
"title": ""
},
{
"docid": "acab9da9ec7065abb1d3cc68a08c6bdd",
"score": "0.60369384",
"text": "def index\n @chat = 'http://www.twitch.tv/'+current_user.username+'/chat'\n end",
"title": ""
},
{
"docid": "918c3f3cb0da1959f8251e2c31c58f73",
"score": "0.6030067",
"text": "def message\n \"(#{@code}):#{@response[\"response\"][\"messages\"][\"msg\"]}\"\n end",
"title": ""
},
{
"docid": "16ac4dc21daf755d16dcfc707d963203",
"score": "0.601865",
"text": "def chat_info\n return @chat_info\n end",
"title": ""
},
{
"docid": "3bfd43f2bd0972bb567178149bcfdf05",
"score": "0.6007114",
"text": "def showprivatechat \n @messages = Message.find_all_by_user_id_to(params[:to]) \n \n @messages.each do |m| \n @conversation = \"#{@conversation}\\n#{m.created_at.localtime}:#{m.user_id_from}:#{m.message}\"\n end\n \n respond_to do |format|\n format.html # showprivatechat.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "d00024e35c6ced239013de70ce9ddef0",
"score": "0.5996437",
"text": "def show\n render json: @whatsapp_chat\n end",
"title": ""
},
{
"docid": "b215c068d889d91d4ce2202caaad35bf",
"score": "0.59408134",
"text": "def format_for_twitter\n url = shorten_url \"http://#{URL_BASE}/track/show/#{track.id}\"\n non_message_len = track.name.length + 2 + 1 + url.length\n message = replace_for_view(description, unlinked = true).chomp.strip\n track.name + ': ' + message[0, 140 - non_message_len] + ' ' + url\n end",
"title": ""
},
{
"docid": "93f708a9a814c555035659fff010d51f",
"score": "0.5933621",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat }\n end\n end",
"title": ""
},
{
"docid": "93f708a9a814c555035659fff010d51f",
"score": "0.5933621",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat }\n end\n end",
"title": ""
},
{
"docid": "dd6c88879107b4be6e451cc8e4608cca",
"score": "0.5923975",
"text": "def show\n @chatting = Chatting.find(params[:id])\n\n #respond_to do |format|\n #format.html # show.html.erb\n # format.json { render json: @chatting }\n #end\n end",
"title": ""
},
{
"docid": "9db8e1405ca6df70e6078314908188c8",
"score": "0.5912558",
"text": "def api_get_chat(chat)\n CHAT_PROPERTIES.inject({\"_id\" => chat}) do |result_hash, property|\n result_hash[property] = api_get_chat_property(chat, property)\n result_hash\n end\n end",
"title": ""
},
{
"docid": "06f72c56bee83de1db7b94ac181b28f6",
"score": "0.5901127",
"text": "def rpc_message(type, nickname, message)\n puts \"Chat > #{nickname}: #{message}\"\n end",
"title": ""
},
{
"docid": "cf8f8586764f1011c0a47179d7f95f07",
"score": "0.5894445",
"text": "def tweet\n\treturn \"chirp Chirp\"\nend",
"title": ""
},
{
"docid": "be773fcf9adc1a283d94c99f6d611e9a",
"score": "0.58890563",
"text": "def message\n # Customize the message with length of the incoming message\n msg_length = params[:Body].length\n\n # <Message> a text bac to the person who texted us\n response = Twilio::TwiML::MessagingResponse.new\n response.message(\"Your text to me was #{msg_length} characters long. Webhooks are neat :)\")\n\n # Return the TwiML\n render text: response.to_s\n end",
"title": ""
},
{
"docid": "ef9e6726c874f3486a2d4f69d837816a",
"score": "0.5880779",
"text": "def to_s\n \"conversation\"\n end",
"title": ""
},
{
"docid": "6ce66f02cf6b7f56f2d7fa721e1a1808",
"score": "0.5870244",
"text": "def execute\r\n resource = RestClient::Resource.new(\"https://slack.com/api/chat.postMessage\")\r\n body = \"token=#{@info_values['token']}\"\r\n body += \"&channel=#{@parameters['channel']}\"\r\n body += \"&text=#{@parameters['text']}\"\r\n body += \"&thread_ts=#{@parameters['thread_ts']}\" if !@parameters['thread_ts'].to_s.empty?\r\n\r\n error = nil\r\n begin\r\n response = resource.post(body)\r\n rescue Exception => e\r\n error = e\r\n end\r\n\r\n json = JSON.parse(response.body)\r\n puts json\r\n return \"<results><result name='Thread Id'>#{json[\"message\"][\"ts\"]}</result></results>\"\r\n\r\n end",
"title": ""
},
{
"docid": "0c20acc7497402e8cf832c577085dbae",
"score": "0.584569",
"text": "def show\n @chat = Chat.find_by_id(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat }\n end\n end",
"title": ""
},
{
"docid": "c9d7eee7c6130295f9be3e75ee4cfcf1",
"score": "0.58438164",
"text": "def wyslijchat(text)\n\tdo_wyslania=String.new(\"\")\n\ttext.each{|txt|\n\t\tdo_wyslania+=txt\n\t\tdo_wyslania+=\" \"\n\t}\n\[email protected]_wiadomosc(@chatjid,text,:chat)\n\tzapisz_historie(@chatjid.to_s,\"#{@jid}:\\n#{text}\")\n end",
"title": ""
},
{
"docid": "f5522dac9a3138be03d6e8abbf4f764e",
"score": "0.58437985",
"text": "def to_s\n \"Username: #{@username}, Real name: #{@real_name}, Slack ID: #{@id}\"\n end",
"title": ""
},
{
"docid": "82fc0aa7f73320f8f9ec1c3d4b68a437",
"score": "0.583493",
"text": "def message\n self.video.from=\"facebook\"\n self.video.more=self.recommendation #.serializable_hash if self.recommendation\n\n \"#{from_name} recommends: <a class='link_video' video='true' id='vid_#{video.id}' href='#hoverbox'>#{video.title}</a>\n <a href='#' class='mini_icons cueExternal' id='cueEvent_#{id}' ><img src='/images/icons/btn_play_green.png' height='12' width='12' title='Play now'></a>\n <a style='display:none' class='mini_icons' href='#' onclick='Mynewtv.enqueueExternal(\\\"ev_#{id}\\\")'><img src='/images/icons/btn_playlist_magenta.png' height='12' width='12' title='Add to playlist'></a>\"\n\n end",
"title": ""
},
{
"docid": "7b2dbda15d09cd7e6afa802557acae90",
"score": "0.58347946",
"text": "def show\n @chatter = Chatter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chatter }\n end\n end",
"title": ""
},
{
"docid": "a70ab17a332d5494d041d6daab3b6746",
"score": "0.5808883",
"text": "def format_api_tweet(tweet)\n\t\t\t{\n\t\t\t\tid: tweet.id,\n\t\t\t\tcreated_at: tweet.created_at,\n\t\t\t\ttext: tweet.full_text,\n\t\t\t\tretweet: tweet.retweet?,\n\t\t\t\toriginal_tweet: tweet.retweeted_status.id,\n\t\t\t\toriginal_user: tweet.retweeted_status.user.id,\n\t\t\t\treply: tweet.reply?,\n\t\t\t\treply_to: tweet.in_reply_to_status_id,\n\t\t\t\tmedia: self.build_media_array(tweet)\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "1871ad94fff7e6f27dee54386fdd2c08",
"score": "0.57965356",
"text": "def stream\n api == :twitch ? \"https://twitch.tv/#{channel}/\"\n : 'Unsupported'\n end",
"title": ""
},
{
"docid": "5d4815d091643938265751f783ca177a",
"score": "0.57925195",
"text": "def resp_text; end",
"title": ""
},
{
"docid": "5d4815d091643938265751f783ca177a",
"score": "0.57925195",
"text": "def resp_text; end",
"title": ""
},
{
"docid": "aae1c7c05a95e557eb60213f6ca35816",
"score": "0.57894707",
"text": "def chat(id) Skype::Chat.new(id) ; end",
"title": ""
},
{
"docid": "743bd70b14f5df8da0251733853d3ff7",
"score": "0.57736003",
"text": "def message(twitter_id, contents)\n\n\n\n\tend",
"title": ""
},
{
"docid": "73b7c963c3ae6777b54568e1333c6cfe",
"score": "0.57709605",
"text": "def show\n\t\trespond_to do |format|\n\t\t\tformat.json {render json: @chat_room.to_json(:include => :messages)}\n\t\t\tformat.html {render :show}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1fa4f0ee7969c5cb1096748655d97146",
"score": "0.57476175",
"text": "def message\n\t\treturn \"sin user\" if self.user.blank? \n\t\tTwitter.user_timeline(self.user).first.text\t\n\tend",
"title": ""
},
{
"docid": "25bd39799f9aef2614dab6bfdea937e2",
"score": "0.5746168",
"text": "def show\n @texte_de_chat = TexteDeChat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @texte_de_chat }\n end\n end",
"title": ""
},
{
"docid": "f2f54d8745f827bab12d9e0b75c562ef",
"score": "0.57351154",
"text": "def chat_params\n request.body.rewind\n JSON.parse(request.body.read)[\"chat\"]\n end",
"title": ""
},
{
"docid": "3153461a135f03328d3fc2b36985097f",
"score": "0.5719277",
"text": "def print_tweet(tweet)\r\n\tputs tweet[\"user\"][\"name\"] + \" - \" + tweet[\"text\"]\r\nend",
"title": ""
},
{
"docid": "d54822e73437fb21a5755e4b0bbc47d0",
"score": "0.5712112",
"text": "def to_message; end",
"title": ""
},
{
"docid": "9c07d0667ee5481593e903db6902b63d",
"score": "0.5709564",
"text": "def details\n return \"Channel name:#{name}\",\"Slack ID: #{slack_id}\", \"Topic:#{topic}\", \"Member count:#{member_count}\"\n end",
"title": ""
},
{
"docid": "7be0e27536751c5038b26f7e676ffe74",
"score": "0.57034403",
"text": "def chat_info=(value)\n @chat_info = value\n end",
"title": ""
},
{
"docid": "6e8d0cdc9efa8a6e182f5f4f301f6671",
"score": "0.57024235",
"text": "def api_chatmessage(chat, message)\n result_pattern = /MESSAGE (\\S+) STATUS (\\S+)/\n result = command(\"CHATMESSAGE #{chat} #{message}\")\n unless message_match = result_pattern.match(result)\n return nil\n end\n message_match[2]\n end",
"title": ""
},
{
"docid": "ca30873b1107fd508ddb254295373a7e",
"score": "0.569468",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat }\n end\n end",
"title": ""
},
{
"docid": "ca30873b1107fd508ddb254295373a7e",
"score": "0.569468",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat }\n end\n end",
"title": ""
},
{
"docid": "ff0ed82bf004bc29487d44a5c448c9c6",
"score": "0.5693629",
"text": "def fetch_chat_info\n res = @api.get(\n \"#{@base_uri.path}/wikia.php?#{URI.encode_www_form({\n :controller => 'Chat',\n :format => 'json'\n })}\", @headers)\n # @type [Hash]\n data = JSON.parse(res.body, :symbolize_names => true)\n @key = data[:chatkey]\n @room = data[:roomId]\n @mod = data[:isChatMod]\n @initialized = false\n @server = JSON.parse(\n @api.get(\n \"#{@base_uri.path}/api.php?#{URI.encode_www_form({\n :action => 'query',\n :meta => 'siteinfo',\n :siprop => 'wikidesc',\n :format => 'json'\n })}\"\n ).body,\n :symbolize_names => true\n )[:query][:wikidesc][:id] # >.>\n @request_options = {\n :name => @config['user'],\n :EIO => 2,\n :transport => 'polling',\n :key => @key,\n :roomId => @room,\n :serverId => @server\n }\n @socket = Net::HTTP.new(data[:chatServerHost], 443)\n @socket.use_ssl = true\n @socket.keep_alive_timeout = 60\n @socket.ssl_timeout = 60\n Signal.trap('INT') do\n quit\n end\n Signal.trap('TERM') do\n quit\n end\n res = get\n spl = res.body.match(/\\d+:0(.*)$/)\n if spl.nil?\n @running = false\n return\n end\n @request_options[:sid] = JSON.parse(spl.captures[0], :symbolize_names => true)[:sid]\n @headers['Cookie'] = res['Set-Cookie']\n end",
"title": ""
},
{
"docid": "8d9051f33b15ded70f072d14ff9970c8",
"score": "0.5687618",
"text": "def rest\n feed_me\n encode_utf8 super\n end",
"title": ""
},
{
"docid": "c29011de1ab7ba9feffe8b715118c0a6",
"score": "0.56794655",
"text": "def api_json\n {\n 'id' => self.id,\n 'conversation_id' => self.conversation.id,\n 'conversation_message_count' => self.conversation.messages.count,\n 'from_phone' => self.from,\n 'to_phone' => self.to,\n 'sent_by' => self.sent_by,\n 'body' => CGI::escape_html(self.body || ''),\n 'created_at' => self.created_at.to_i,\n }\n end",
"title": ""
},
{
"docid": "caee3c6b79ba25ac49af57a815c266a1",
"score": "0.5678802",
"text": "def show\n render json: @chat_template\n end",
"title": ""
},
{
"docid": "bcdcfc521e30f0a049f89f7de543e3cd",
"score": "0.56748277",
"text": "def message\n message = \"#{@method_type.to_s.upcase} #{@request_uri} RTSP/#{@version}\\r\\n\"\n message << headers_to_s(@headers)\n message << \"\\r\\n\"\n message << \"#{@body}\" unless @body.nil?\n\n #message.each_line { |line| RTSP::Client.log line.strip }\n\n message\n end",
"title": ""
},
{
"docid": "9d0d84952913851a21afedd17e8a92a2",
"score": "0.5669998",
"text": "def show\n @chat = Chat.find(params[:id])\n @message = Message.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat }\n end\n end",
"title": ""
},
{
"docid": "bae73cf66b81d3bf977908cf35a1b20a",
"score": "0.5655086",
"text": "def message\n self.video.from=\"like\"\n self.video.more = {:from_name => self.from_name } \n \n \"#{from_name} liked: <a class='link_video' video='true' id='vid_#{video.id}' href='#hoverbox' >#{video.title}</a>\n <a href='#' class='mini_icons cueExternal' id='cueEvent_#{id}' ><img src='/images/icons/btn_play_green.png' height='12' width='12' title='Play now'></a>\n <a class='mini_icons' href='#' onclick='Mynewtv.enqueueExternal(\\\"ev_#{id}\\\")'><img src='/images/icons/btn_playlist_magenta.png' height='12' width='12' title='Add to playlist'></a>\"\n end",
"title": ""
},
{
"docid": "5f36f7d58df6bcbc22c0dd4502a4cd8e",
"score": "0.5652124",
"text": "def inspect\n self.to_s.sub('>', \" #{data[:hub_id]}>\")\n end",
"title": ""
},
{
"docid": "958c0d232a68931298d0ff6adc6d2131",
"score": "0.5648413",
"text": "def get_most_recent_skype_question\n @chat.messages.reverse.each do |m|\n body = m.body.strip\n\n if body.split('').last == \"?\"\n return {body: body, user: m.user, type: :question}\n \n elsif body[0..3] == \"map-\"\n return {body: body[4..-1], user: m.user, type: :map}\n\n elsif body[0..4] == \"map -\"\n return {body: body[5..-1], user: m.user, type: :map}\n\n elsif body[0..3] == \"gif-\"\n return {body: body[4..-1], user: m.user, type: :animated_image}\n\n elsif body[0..4] == \"gif -\"\n return {body: body[5..-1], user: m.user, type: :animated_image}\n end\n\n next\n end\n end",
"title": ""
},
{
"docid": "a42ce6149074d301c46222d26457bca3",
"score": "0.56473994",
"text": "def chat\n new(CHAT)\n end",
"title": ""
},
{
"docid": "2374f2573e6e3aff620e24e66c2512e7",
"score": "0.56364256",
"text": "def show\n @chat_message = ChatMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat_message }\n end\n end",
"title": ""
},
{
"docid": "2374f2573e6e3aff620e24e66c2512e7",
"score": "0.56364256",
"text": "def show\n @chat_message = ChatMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat_message }\n end\n end",
"title": ""
},
{
"docid": "3d5d1a85355a3af4abc319b5d4d28c20",
"score": "0.56322473",
"text": "def rwt_message(message)\n case message\n when String\n msg= message\n when ActiveRecord::Errors\n msg= ''\n message.each do |key,errors|\n msg << \"<b>#{key}: </b> \"\n errors.each do |e|\n msg << \"#{e}, \"\n end\n msg << '<br>'\n end\n else\n msg= message.to_s\n end\n render :text => {:success=>true,:message=>msg}.to_json\n end",
"title": ""
},
{
"docid": "9bf3df9ea4cd1b510be3e75fe626f70a",
"score": "0.5627859",
"text": "def teach_stuff\n response = \"\"\n response += \"Listen, class, this is how everything works. \"\n response += \"*drops crazy knowledge bomb* \"\n response += \"... You're welcome.\"\n response\n end",
"title": ""
},
{
"docid": "97b235bd72edd44c40db1234e194c1d5",
"score": "0.56233686",
"text": "def chat_info=(value)\n @chat_info = value\n end",
"title": ""
},
{
"docid": "e311b2bdd59e6500d7a463f8a76faaca",
"score": "0.5619359",
"text": "def welcome_message\n {\n :title => \"欢迎你\",\n :content => '未完待续',\n :pic_url => 'http://www.baidu.com/img/bdlogo.gif',\n :url => wechat_home_url\n\n }\n end",
"title": ""
},
{
"docid": "61a3d310dae205453b90c620f449bddb",
"score": "0.56163293",
"text": "def type\n case super\n when 'chat' then :chat\n when 'error' then :error\n when 'groupchat' then :groupchat\n when 'headline' then :headline\n when 'normal' then :normal\n else nil\n end\n end",
"title": ""
},
{
"docid": "870d57fa4964bfb28b8b68ff8a0a32b2",
"score": "0.56111544",
"text": "def serialize_slackbot_data\n @data[:text]\n end",
"title": ""
},
{
"docid": "48a07c0ac19bdf4945f5c2ebc2c2475a",
"score": "0.56081235",
"text": "def to_s\n twitter\n end",
"title": ""
},
{
"docid": "95af836a47fb9627a3c699b9bb9b4859",
"score": "0.5605291",
"text": "def inspect\n \"<Message content=\\\"#{@content}\\\" id=#{@id} timestamp=#{@timestamp} author=#{@author} channel=#{@channel}>\"\n end",
"title": ""
},
{
"docid": "95af836a47fb9627a3c699b9bb9b4859",
"score": "0.5605291",
"text": "def inspect\n \"<Message content=\\\"#{@content}\\\" id=#{@id} timestamp=#{@timestamp} author=#{@author} channel=#{@channel}>\"\n end",
"title": ""
},
{
"docid": "95af836a47fb9627a3c699b9bb9b4859",
"score": "0.5605291",
"text": "def inspect\n \"<Message content=\\\"#{@content}\\\" id=#{@id} timestamp=#{@timestamp} author=#{@author} channel=#{@channel}>\"\n end",
"title": ""
},
{
"docid": "7cdcd0899a178f08606a4e86ce5141f7",
"score": "0.5596307",
"text": "def activity\n render json: human_readable_user_activity\n end",
"title": ""
},
{
"docid": "7cdcd0899a178f08606a4e86ce5141f7",
"score": "0.5594986",
"text": "def activity\n render json: human_readable_user_activity\n end",
"title": ""
},
{
"docid": "f5092f332be2082b8a4c0769836aab77",
"score": "0.55867386",
"text": "def message\n raw['detail']\n end",
"title": ""
},
{
"docid": "bfa215d45e3da323923b0e6603156f2c",
"score": "0.55856264",
"text": "def new\n @chat = Chat.new\n\n #respond_to do |format|\n #format.html # new.html.erb\n #format.json { render json: @chat }\n #end\n end",
"title": ""
},
{
"docid": "4a9fdfac16658581792dc2d703dd9a74",
"score": "0.55826044",
"text": "def message(message)\n respond_with :message, text: '哼! 铲屎哒~ 我只接受 `/cat 命令` 形式的撩哦 o(^・x・^)o'\n end",
"title": ""
},
{
"docid": "ac96d2f064bd8f5813c87f5cd694e8bd",
"score": "0.5579813",
"text": "def return_json\n {\n :chat => self,\n :chat_user => self.user\n }\n end",
"title": ""
},
{
"docid": "4965c30810824d8ada0a2e4a69c95cf7",
"score": "0.5573315",
"text": "def build_chat_hash\n\t\tuser = self.creator\n\t\tchat = {\n\t\t\tid: self.id.to_s,\n\t\t\t# users: self.user_ids.map(&:to_s),\n\t\t\tchat_type: self.chat_type\n\t\t\t# status: self.status\n\t\t}\n\t\tchat[:title] = self.title if self.title\n\t\tchat[:normal_cover] = self.cover.url if self.cover\n\t\tchat[:thumb_cover] = self.cover.thumb.url if self.cover\n\t\t# chat[:area] = self.area_id.to_s if self.area_id\n\t\tchat[:creator] = {id: user.id.to_s, user_name: user.user_name, avatar: user.avatar.url } if self.creator\n\t\tunless self.messages.blank?\n\t\t\tchat[:last_message] = self.messages.last.build_message_hash[:text]\n\t\telse\n\t\t\tchat[:last_message] = \"\"\n\t\tend\n\t\tchat\n\tend",
"title": ""
},
{
"docid": "a012c493191576f6c1df83313c8ac3aa",
"score": "0.5565255",
"text": "def render_twiml(response)\n render text: response.text\n end",
"title": ""
},
{
"docid": "a012c493191576f6c1df83313c8ac3aa",
"score": "0.5565255",
"text": "def render_twiml(response)\n render text: response.text\n end",
"title": ""
},
{
"docid": "60363ef754e490c29aca275bab847f98",
"score": "0.55606556",
"text": "def message(id)\n return {'video_id'=>id}.to_json\n end",
"title": ""
},
{
"docid": "b3e27886f069efe69871669bb5dbd4f3",
"score": "0.55565745",
"text": "def personal_message(msg)\n respond(msg, \"Hi. Your message was: #{msg.inspect}\")\n respond(msg, \"Body: #{msg.body.to_s}\")\n end",
"title": ""
},
{
"docid": "9211084ebb663c1b8ef88f3305767ea2",
"score": "0.5553964",
"text": "def to_s\n '<Twilio.Conversations.V1.WebhookPage>'\n end",
"title": ""
},
{
"docid": "7fbb6b90244d94a513ba2ea1e7ae376d",
"score": "0.5549334",
"text": "def response_text; end",
"title": ""
},
{
"docid": "51cbee3ac587a7b31d4940a034dc85d3",
"score": "0.5542738",
"text": "def build_chat_hash\n\t\t# user = self.user_id\n\t\tchat = {\n\t\t\tid: self.id.to_s,\n\t\t\tchat_type: self.chat_type,\n\t\t\tcreated_at: self.created_at\n\t\t\t# status: self.status\n\t\t}\n\t\tchat[:location] = self.location if self.location\n\t\tchat[:title] = self.title if self.title\n\t\tchat[:normal_cover] = self.cover.url if self.cover\n\t\tchat[:thumb_cover] = self.cover.thumb.url if self.cover\n\t\tchat[:darkened_cover] = self.cover.darkened.url if self.cover\n\t\tchat[:area_id] = self.area_id if self.area_id\n\t\tchat[:user_id] = self.user_id if self.user_id\n\t\t# chat[:user] = {id: user.id.to_s, user_name: user.user_name, avatar: user.avatar.url } if self.user\n\t\tunless self.messages.blank?\n\t\t\tmessages = self.messages\n\t\t\tlast_message = messages.last\n\t\t\tchat[:last_message] = last_message.build_message_hash\n\t\t\tchat[:message_count] = messages.count\n\t\telse\n\t\t\tchat[:last_message] = \"\"\n\t\t\tchat[:message_count] = 0\n\t\tend\n\t\tchat\n\tend",
"title": ""
},
{
"docid": "6b2279e8938074b421e49996cffdf67f",
"score": "0.55394965",
"text": "def msg\n raw[\"msg\"]\n end",
"title": ""
},
{
"docid": "bbf3a3aef707835270d0fa8228995a98",
"score": "0.5539429",
"text": "def new\n @chatting = Chatting.new\n \n\n #respond_to do |format|\n #format.html # new.html.erb\n #format.json { render json: @chatting }\n # end\n end",
"title": ""
},
{
"docid": "4ef0ac12cfbc6e3753e7f13752cce004",
"score": "0.553394",
"text": "def format_instant_reply(incoming_message, response_content)\n timestamp = Time.new.to_i\n # Sender and Receiver must be inverted in replies ;)\n return %(\n <xml>\n <ToUserName><![CDATA[#{incoming_message['sender']}]]></ToUserName>\n <FromUserName><![CDATA[#{incoming_message['receiver']}]]></FromUserName>\n <CreateTime>#{timestamp}</CreateTime>\n <MsgType><![CDATA[text]]></MsgType>\n <Content><![CDATA[#{response_content}]]></Content>\n </xml>\n )\n end",
"title": ""
},
{
"docid": "6b6ae8ac4bc04697b129f115b82a1723",
"score": "0.55265033",
"text": "def new\n @chat = Chat.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chat }\n end\n end",
"title": ""
},
{
"docid": "c68a27a7b18755d80ce23d12c155db9a",
"score": "0.5522069",
"text": "def render_twiml(response)\n render text: response.text\n end",
"title": ""
},
{
"docid": "a4856da88463327b0e5db58a0dc48b60",
"score": "0.5512545",
"text": "def message\n @response.try(:msg)\n end",
"title": ""
},
{
"docid": "1df64a6a9126032ed49182123fdaddbf",
"score": "0.55080074",
"text": "def show\n @chat_line = ChatLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat_line }\n end\n end",
"title": ""
},
{
"docid": "0fe94cd11858f72e7bf677333346ce02",
"score": "0.55073315",
"text": "def message\n response[\"message\"]\n end",
"title": ""
},
{
"docid": "0b176d0ad4ad44f06b5b2314d269c9de",
"score": "0.55039835",
"text": "def show_friends_and_me_messages options={} \n show_context(\"statuses/friends_timeline\",{:no_id_need_login=>true},options) \n end",
"title": ""
},
{
"docid": "17c0f216c2cc2893802e79d7b5e345a7",
"score": "0.55024964",
"text": "def api_response\n Net::HTTP.get_response(\n URI(\"#{TWITTER_API_URL}/users/show.json?screen_name=#{@username}\")\n ).body\n end",
"title": ""
},
{
"docid": "85f2913b8c3a31d312241c0457861ba7",
"score": "0.5497732",
"text": "def text\n @client = Twilio::REST::Client.new\n @client.messages.create(\n from: ENV['TWILIO_PHONE_NUMBER'],\n to: self.phone,\n body: 'Hi - this is Rena from Actualize. Do you have a minute to chat?'\n )\n end",
"title": ""
}
] |
85734a845437f0dbeb21f3cfcd62c8d3
|
Establish connection to each of application's adapters
|
[
{
"docid": "38f80575a785441dbbe0abd39a5e77e9",
"score": "0.0",
"text": "def connect\n false\n end",
"title": ""
}
] |
[
{
"docid": "f47c4473ccd58ae150bc17308602b0ba",
"score": "0.7124214",
"text": "def adapters\n setup\n @adapters\n end",
"title": ""
},
{
"docid": "f3c85bd6d382023f07b5de0dc5c6eeb8",
"score": "0.68407637",
"text": "def connect_all\n self.class.addresses(@options[:host], @options[:port]).map do |a|\n identity = self.class.identity(a[:host], a[:port])\n BrokerClient.new(identity, a, @serializer, @exception_stats, @non_delivery_stats, @options, nil)\n end\n end",
"title": ""
},
{
"docid": "a97c59149b514b1d68cdf3e8a4aa3de0",
"score": "0.66970485",
"text": "def instantiate_connections\n @master_pool = Makara::Pool.new('master', self)\n @config_parser.master_configs.each do |master_config|\n @master_pool.add master_config do\n graceful_connection_for(master_config)\n end\n end\n\n @slave_pool = Makara::Pool.new('slave', self)\n @config_parser.slave_configs.each do |slave_config|\n @slave_pool.add slave_config do\n graceful_connection_for(slave_config)\n end\n end\n end",
"title": ""
},
{
"docid": "4557fe506be53d0652b9b39d96ca96b9",
"score": "0.66741526",
"text": "def clients\n @adapters ||= {\n bunny: Multidapter::Adapters::Amqp::AmqpBunnyAdapter,\n sneakers: Multidapter::Adapters::Amqp::AmqpSneakersAdapter,\n }\n end",
"title": ""
},
{
"docid": "5aead0e55687031bf01c3586c0992eaa",
"score": "0.6621828",
"text": "def connect_all\n @connect_strategy.connect(self)\n end",
"title": ""
},
{
"docid": "a47126d1c72107d0c9827d7a416a5fd0",
"score": "0.66067916",
"text": "def instantiate_connections\n @primary_pool = Makara::Pool.new('primary', self)\n @config_parser.primary_configs.each do |primary_config|\n @primary_pool.add primary_config do\n graceful_connection_for(primary_config)\n end\n end\n\n @replica_pool = Makara::Pool.new('replica', self)\n @config_parser.replica_configs.each do |replica_config|\n @replica_pool.add replica_config do\n graceful_connection_for(replica_config)\n end\n end\n end",
"title": ""
},
{
"docid": "a9730b5010d498e6e0e4b14aaa0133cf",
"score": "0.6573215",
"text": "def adapters\n @adapters ||= {}\n end",
"title": ""
},
{
"docid": "51c7f5e72dfbf3590564ae708a022147",
"score": "0.655635",
"text": "def adapters\n class_variable_get :@@adapters\n end",
"title": ""
},
{
"docid": "8bb6e41df0c2e1dbb1c5235b1a7afa2c",
"score": "0.6543321",
"text": "def adapters\n @adapters ||= {}\n end",
"title": ""
},
{
"docid": "933d2ee988357fc085663692005de3c1",
"score": "0.6481048",
"text": "def connections\r\n end",
"title": ""
},
{
"docid": "68dbd62d15d0d13c503e54f21c16fff8",
"score": "0.62855446",
"text": "def init_app_connections(user = current_user)\n # TODO moving its to the very position (n: refactor)\n if user && user.app_connections.empty?\n Application.all.each do |app|\n client = Rack::OAuth2::Server.get_client(app.client_id)\n # grant_type none call\n access_token = Rack::OAuth2::Server::AccessToken.get_token_for(user.id, client, client.scope)\n user.app_connections.create!(client_id: client.id, access_token: access_token.token)\n end\n end\n end",
"title": ""
},
{
"docid": "2f23f090da1f91b01d2e2fa089bb15c3",
"score": "0.62566894",
"text": "def open_connections\n start_ipv4_socket\n start_ipv6_socket\n end",
"title": ""
},
{
"docid": "723621e573372248f6c27d2aeca445ae",
"score": "0.6136507",
"text": "def initialize_adapter\n ApplicationRecord.default_timezone = :utc\n\n if connection_established? && ApplicationRecord.connection_config[:adapter] == ADAPTER\n dlog(\"Already established connection to #{ADAPTER}, so reusing active connection.\")\n self.drivers << ADAPTER\n self.driver = ADAPTER\n else\n begin\n ApplicationRecord.establish_connection(adapter: ADAPTER)\n ApplicationRecord.remove_connection\n rescue Exception => error\n @adapter_error = error\n else\n self.drivers << ADAPTER\n self.driver = ADAPTER\n end\n end\n end",
"title": ""
},
{
"docid": "ef49d57a73b294c53642d70ae8c6f45e",
"score": "0.61357117",
"text": "def open_connections\n dbh_src = nil\n dsn_src = \"dbi:#{APP_CONFIG[:dbi_src][:adapter]}:#{APP_CONFIG[:dbi_src][:database]}\"\n dbh_dst = nil\n dsn_dst = \"dbi:#{APP_CONFIG[:dbi_dst][:adapter]}:#{APP_CONFIG[:dbi_dst][:database]}\"\n begin\n dbh_src = DBI.connect(dsn_src, APP_CONFIG[:dbi_src][:user], APP_CONFIG[:dbi_src][:password])\n begin\n dbh_dst = DBI.connect(dsn_dst, APP_CONFIG[:dbi_dst][:user], APP_CONFIG[:dbi_dst][:password])\n rescue\n $stderr.print \"could not open #{dsn_dst}: #{$!}\\n\"\n exit\n end\n rescue\n $stderr.print \"could not open #{dsn_src}: #{$!}\\n\"\n exit\n end\n [dbh_src, dbh_dst]\nend",
"title": ""
},
{
"docid": "1923c31afb54c36bced0a4a1dc59753e",
"score": "0.611483",
"text": "def each_adapter(options)\n Sms::Adapters::Factory.products(options).each do |klass|\n Sms::Adapters::Factory.instance.create(klass)\n end\n end",
"title": ""
},
{
"docid": "36588421f9c8d5636bad60a16188769d",
"score": "0.6100547",
"text": "def open_connections\n self.log(\"Opening connections\")\n @bugzilladb = self.open_connection(@bugzillainfo)\n @redminedb = self.open_connection(@redmineinfo)\n end",
"title": ""
},
{
"docid": "52d5be5ca77d5cfdff631cddeadbfcb4",
"score": "0.60963434",
"text": "def connect(*args, &block)\n @adapter.connect(*args, &block)\n end",
"title": ""
},
{
"docid": "cbd017f7762329011780e346a5b3869d",
"score": "0.60850674",
"text": "def connect!\n connections.each &:connect!\n self\n end",
"title": ""
},
{
"docid": "b6b91c0e480819759fa896d0a2a3f7dd",
"score": "0.60802615",
"text": "def bind connections\n raise \"not started\" unless @started\n connections.each do |k,v|\n native_bind(k, v)\n end\n end",
"title": ""
},
{
"docid": "d0c7dcdeb00aef8141fa9894477d5488",
"score": "0.60622346",
"text": "def connections; end",
"title": ""
},
{
"docid": "4862c202c40dd8b6a76acfbd918746c5",
"score": "0.60191715",
"text": "def connections\n @connections ||= Connections.new client\n end",
"title": ""
},
{
"docid": "73eda80d7e2682a89d906c4abd772878",
"score": "0.6000826",
"text": "def each_adapter\n return enum_for(:each_adapter) unless block_given?\n adapters.each { |_, adapter| yield(adapter) }\n end",
"title": ""
},
{
"docid": "48842ee088d0f8c66a31e832743d06bd",
"score": "0.5975743",
"text": "def connection\n @adapter || establish_connection\n end",
"title": ""
},
{
"docid": "7419c63a148eb7dec89f42a7baa6f058",
"score": "0.59692645",
"text": "def connect options=nil\n Sunshine.logger.info :app, \"Connecting...\" do\n threaded_each options do |server_app|\n server_app.shell.connect\n end\n end\n end",
"title": ""
},
{
"docid": "5dd41063d6c89ac627462976362c5e33",
"score": "0.595027",
"text": "def establish_connection(options)\n ActiveRecord::Base.establish_connection(options)\n EventProvider.establish_connection(options)\n Event.establish_connection(options)\n end",
"title": ""
},
{
"docid": "437ec92440409e04a76ba80f74181ada",
"score": "0.5949041",
"text": "def establish_connection\n end",
"title": ""
},
{
"docid": "444dc3097bc36b840cf40ffb7269dd9e",
"score": "0.5944918",
"text": "def connect\n unless @connected\n ActiveRecord::Base.establish_connection(**adapter_config)\n @connected = true\n end\n end",
"title": ""
},
{
"docid": "021e19de97cf11f2cd2e7de4fb379e26",
"score": "0.5915077",
"text": "def default_connection_managers; end",
"title": ""
},
{
"docid": "0412a92b38bd73469ff9905276aa94d5",
"score": "0.58771116",
"text": "def adapter\n reconnect! unless @adapter\n @adapter\n end",
"title": ""
},
{
"docid": "0412a92b38bd73469ff9905276aa94d5",
"score": "0.58771116",
"text": "def adapter\n reconnect! unless @adapter\n @adapter\n end",
"title": ""
},
{
"docid": "5dbb33609080e590a2876e91430ca0cf",
"score": "0.58762884",
"text": "def connect!\n @clients = servers.collect { |server|\n Client.new(server)\n }.compact\n end",
"title": ""
},
{
"docid": "6a7e41adbe90056a8e5ea4593671f7bc",
"score": "0.5875898",
"text": "def each_adapter(*args)\n Sms::Adapters::Factory.products.each do |klass|\n yield(klass.new)\n end\n end",
"title": ""
},
{
"docid": "b67b069aa59db4e159b46811743f9ece",
"score": "0.58756566",
"text": "def connect_adapter()\n @adapter=\"Lolita::Adapter::#{self.adapter_name.to_s.camelize}\".constantize.new(self)\n end",
"title": ""
},
{
"docid": "a9dba49934fb0d5b65fc315b8e78ab72",
"score": "0.58159673",
"text": "def set_up_connections\n EdiHelper::edi_log.write \"connecting to db..\"\n ActiveRecord::Base.establish_connection(Globals.get_mes_conn_params)\n EdiHelper::edi_log.write \"connected to db\" \n true\n end",
"title": ""
},
{
"docid": "134ae5df2146878bd18dbbfbe46dfebf",
"score": "0.5808894",
"text": "def adapter\n setup! unless setup?\n\n @adapter\n end",
"title": ""
},
{
"docid": "95b640e07f79fe15d9ac982899e66e35",
"score": "0.57935",
"text": "def link_providers\n connections = ClientHelper.client_admin.connections\n connections.map do |connection|\n connection['strategy'] if connection['enabled_clients'].include?(Rails.application.secrets.auth0_client_id)\n end.compact\n end",
"title": ""
},
{
"docid": "caea610f4ee0818d69c03aede773abb1",
"score": "0.57906216",
"text": "def connect(server)\n conn = super\n conn.extend(AdapterMethods)\n conn\n end",
"title": ""
},
{
"docid": "be2b29d1b900b9f9a3bc05068757e732",
"score": "0.5789862",
"text": "def __build_connections\n Connections::Collection.new \\\n :connections => hosts.map { |host|\n host[:protocol] = host[:scheme] || options[:scheme] || DEFAULT_PROTOCOL\n host[:port] ||= options[:port] || DEFAULT_PORT\n if options[:user] && !host[:user]\n host[:user] ||= options[:user]\n host[:password] ||= options[:password]\n end\n url = __full_url(host)\n\n Connections::Connection.new \\\n :host => host,\n :connection => ::Faraday::Connection.new(url, (options[:transport_options] || {}), &@block )\n },\n :selector_class => options[:selector_class],\n :selector => options[:selector]\n end",
"title": ""
},
{
"docid": "d55eea6e201b13d79fdf1ecac8a90bd9",
"score": "0.5778166",
"text": "def connections\n registry.keys\n end",
"title": ""
},
{
"docid": "2c96be464fdb70eec408ca30eff0b818",
"score": "0.5771087",
"text": "def each_connection() raise \"abstract method\" end",
"title": ""
},
{
"docid": "946d26095238735115035d061764a127",
"score": "0.57627535",
"text": "def connect\n networks = @networks.select {|network| not network.connected? }\n \n EventMachine.run do\n networks.each do |network|\n network.delegate = self\n network.connect\n end\n\n EventMachine.error_handler{|e| p e }\n end\n end",
"title": ""
},
{
"docid": "f8674dc06b9f5e8658acdeb826b8f9d2",
"score": "0.57523817",
"text": "def connect(cids)\n raise \"Invalid EMS given\" if cids.length != 1\n puts \"Connecting to #{cids[0]}...\"\n $emsConnections.currentConnection = cids[0]\n puts \"done\"\n end",
"title": ""
},
{
"docid": "fccb53ccce726d3fc55865c57437d856",
"score": "0.5727273",
"text": "def connect!\n ActiveRecord::Base.establish_connection(\n :adapter => self.adapter,\n :database => self.database\n )\n end",
"title": ""
},
{
"docid": "edd3efd21f19cc8e3c1dba78dcc56735",
"score": "0.5721887",
"text": "def init_connections\n conf_file = \"#{__dir__}/../conf/auth.json\"\n @conf = WIKK::Configuration.new(conf_file)\n\n @ldap = UOA_LDAP.new(conf: @conf)\n\n # Team member file access – Team information and auditing, plus the ability to perform any action as any team member\n @dbx_file = Dropbox.new(token: @conf.team_file_token)\n\n # Team member management – Team information, plus the ability to add, edit, and delete team members\n @dbx_mng = Dropbox.new(token: @conf.team_management_token)\n\n # Team information – Information about the team and aggregate usage data\n @dbx_info = Dropbox.new(token: @conf.team_info_token)\n\n # Team member file access – Team information and auditing, plus the ability to perform any action as any team member\n # In this case, impersonating an admin user to perform user based calls.\n # Replaces using an Admin's user_token, which no longer works.\n # @dbx_person = Dropbox.new(token: @conf.user_token, as_admin: true)\n @dbx_person = Dropbox.new(token: @conf.team_file_token, admin_id: @conf.admin_id)\n\n @licenses = @conf.licenses\nend",
"title": ""
},
{
"docid": "c2f4bb848e63b932c38e8294526e8ba0",
"score": "0.57153887",
"text": "def all_connections\n all_wrappers.map(&:connection)\n end",
"title": ""
},
{
"docid": "ea37399157e824347ae8808b5755d053",
"score": "0.5699431",
"text": "def connections\n\t\tread_and_cache(\"connections\") do\n\t\t\tsymbolize(@client.connections.to_hash)[:all]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "20984b489288afaa01734bc2a703c9da",
"score": "0.5699143",
"text": "def index\n @network_adapters = NetworkAdapter.all\n end",
"title": ""
},
{
"docid": "f88c50cb1d20ec157f5404d480875a84",
"score": "0.5688775",
"text": "def configure_connection; end",
"title": ""
},
{
"docid": "1f5b37ad3118dd9886938f8e8b94df26",
"score": "0.5682339",
"text": "def connections\r\n @connection_pools.each do |name, pool|\r\n conn = pool.borrow_object\r\n yield(name, conn)\r\n end\r\n end",
"title": ""
},
{
"docid": "01d5a4a6ebd1e309772bcd19925c8984",
"score": "0.5672384",
"text": "def initialize_applications\n application_names = (settings['applications'] || '').split(',').flatten.compact.map(&:strip).uniq\n self.applications = []\n application_names.each do |app_name|\n app = Application.find(:name => app_name, :host_id => host.id)\n if app\n self.applications << app\n else\n app = Application.new(:name => app_name, :host_id => host.id)\n if app.save\n self.applications << app\n else\n warn(\"Could not create application '#{app_name}' for host #{host.name}\")\n end\n end\n end\n self.applications\n end",
"title": ""
},
{
"docid": "5e42b61c7a06e7cb61f3c801b7f095bc",
"score": "0.56721693",
"text": "def establish_connection\n @connection = ::Veritas::Adapter::DataObjects.new(uri)\n end",
"title": ""
},
{
"docid": "39d8d17ad84a88762c6886868cde6994",
"score": "0.5670021",
"text": "def connect(params)\n self.class.connect(params)\n end",
"title": ""
},
{
"docid": "85ddcc98dda8271834cfc9c120c215a3",
"score": "0.56546766",
"text": "def initialize\n self.connections = []\n begin\n config = YAML.load_file(\"#{File.dirname(__FILE__)}/../config/config.yml\")\n puts \"config profile: #{config['profile']}\"\n connection_configs = config[config['profile']]['connections']\n rescue\n puts \"config.yml not found, please copy it from the template and modify as required. (`cp config/config.yml.template config/config.yml`)\"\n abort\n end\n connection_configs.each do |connection|\n hostname = connection['hostname']\n port = connection['port']\n begin\n sock = UDPSocket.new\n sock.connect(hostname, port)\n self.connections << sock\n if connection['volume']\n self.send_command((connections.length - 1), \"track_volume #{connection['volume']}\")\n else\n puts \"Connection: #{connections.length - 1} is missing the volume attribute!\"\n abort\n end\n puts \"Connection established on #{hostname}:#{port}\"\n rescue Errno::ECONNREFUSED, Errno::ENETUNREACH\n puts \"Connection refused! Please ensure single.pd or quartet.pd is running in puredata and listening on #{hostname}:#{port}\"\n abort\n rescue SocketError\n puts \"Hostname and port are invalid. Please make sure they're a valid ip address and port number.\"\n abort\n rescue => er\n puts \"Unknown error: #{er.message}\"\n puts er.backtrace\n abort\n end\n end\n end",
"title": ""
},
{
"docid": "7214d6d4215aed6b3780ca78c0deaa6d",
"score": "0.5624467",
"text": "def connect\n\t\tend",
"title": ""
},
{
"docid": "2b5f4bfc6c0b26e80ddf6b4293bb2ebc",
"score": "0.5603447",
"text": "def connect\n @client.connect\n @client.auth(@password)\n @client.send(Presence.new.set_type(:available))\n \n #the \"roster\" is our bot contact list\n @roster = Roster::Helper.new(@client)\n \n #...to accept new subscriptions\n start_subscription_callback\n \n #...to do something with the messages we receive\n start_message_callback\n \n #When the backend application has done its job, it tells the listener\n #via the \"listener\" message queue.\n process_queue\n end",
"title": ""
},
{
"docid": "c9878f5cf7477301c2952bda7ac0f901",
"score": "0.5581797",
"text": "def connect\n end",
"title": ""
},
{
"docid": "9f97a998cb4d68b706692d39b0248ecc",
"score": "0.55785704",
"text": "def connect(adapter, settings)\n driver = ADAPTERS[adapter.intern]\n driver.new(settings)\n end",
"title": ""
},
{
"docid": "59650fe6b186f8f4caa59ef6a1fdae47",
"score": "0.55680794",
"text": "def each_adapter(&block)\n loop do\n raise StopIteration if adapters.empty?\n yield next_adapter\n end\n end",
"title": ""
},
{
"docid": "02560e3cf1890e06db0787ec900c6f27",
"score": "0.5564146",
"text": "def connect!\n connect\n end",
"title": ""
},
{
"docid": "26063bc0882eda4f99c5b93430ffb158",
"score": "0.5560793",
"text": "def connections\n # We can't simply rely on the open returning the block's value in unit testing.\n # http://rubyforge.org/tracker/?func=detail&atid=7477&aid=8687&group_id=1917\n entries = nil\n ApacheDBNodes.open(ApacheDBNodes::READER) do |d|\n entries = d.select { |k, v|\n k.split('/')[0] == @fqdn\n }.map { |k, v|\n decode_connection(k.sub(@fqdn, \"\"), v)\n }\n end\n entries\n end",
"title": ""
},
{
"docid": "98e2a69298194f00a6d29d9669385c12",
"score": "0.5558021",
"text": "def retrieve_connectors()\n start.uri('/api/connector')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "18276b4f2f96ac4c66397648f31c1f82",
"score": "0.5556414",
"text": "def process_connect\n self.class.setup\n logger.info \"Initializing the current instance\"\n self.channels = []\n self.connections << self\n logger.info \"Setting the client for each handler\"\n self.handlers.each { |h| h.client = self if h.respond_to?(:client=) }\n logger.info \"Dispatching the default :client_connected event\"\n dispatch :client_connected\n end",
"title": ""
},
{
"docid": "43472032f528cfbb98094c5b2c848cbf",
"score": "0.55533284",
"text": "def setup_connection_adapter\n connection = Connection.new(host, port)\n connection.add_auth(database, username, password) if username && password\n connection\n end",
"title": ""
},
{
"docid": "4cc5852ee32f0d8fac1885e27dc964d3",
"score": "0.55526626",
"text": "def initialize(connections)\r\n end",
"title": ""
},
{
"docid": "78bc21d4489fa9c3e5114dfe2ce1aa09",
"score": "0.55478185",
"text": "def connections\n # TODO: Implement me using associations!\n end",
"title": ""
},
{
"docid": "25eff075345dc4bd58972405f001c211",
"score": "0.5539919",
"text": "def connect; end",
"title": ""
},
{
"docid": "25eff075345dc4bd58972405f001c211",
"score": "0.5539919",
"text": "def connect; end",
"title": ""
},
{
"docid": "2a8894f9f87985e52a8e20c730416237",
"score": "0.55393595",
"text": "def connect(*) end",
"title": ""
},
{
"docid": "7c09b6357aa0c3db6ca5938cdcf4634d",
"score": "0.5526546",
"text": "def establish_connections_to(servers)\n # force the connection factory to be instantiated synchronously,\n # otherwise we wind up with multiple gateway instances, because\n # each connection is done in parallel.\n connection_factory\n\n failed_servers = []\n servers_array = Array(servers)\n\n threads = servers_array.map { |server| establish_connection_to(server, failed_servers) }\n threads.each { |t| t.join }\n\n if failed_servers.any?\n messages = failed_servers.map { |h| \"#{h[:server]} (#{h[:error].class}: #{h[:error].message})\" }\n error = ConnectionError.new(\"connection failed for: #{messages.join(', ')}\")\n error.hosts = failed_servers.map { |h| h[:server] }.each {|server| failed!(server) }\n raise error\n end\n end",
"title": ""
},
{
"docid": "2f0aeb55598f03601086f1452b038373",
"score": "0.5524373",
"text": "def db \n # gateway thing for production make sure to open_port at the beginning of tasks\n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database=>\"crawlfishdevdb\",\n :user=>\"root\",\n :password=>\"Sector@123\",\n :host=>\"127.0.0.1\",\n :port => 3307).connection()\n # Old school local approach for development\n #ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n # :database=>\"prod2\",\n # :user=>\"root\",\n # :password=>\"Sector@123\").connection() \n end",
"title": ""
},
{
"docid": "0fca78678b151a7bf70cfe17a520502a",
"score": "0.55098724",
"text": "def connection_configs\n BunnyManager.configuration.connection_configs\n end",
"title": ""
},
{
"docid": "91aa3d647e4c2dfd547e35336b3b0605",
"score": "0.5504457",
"text": "def connection_manager\n ExperellaProxy.connection_manager\n end",
"title": ""
},
{
"docid": "81e04bd11fdfeabdb4e54866ba5ca37e",
"score": "0.5496014",
"text": "def connect_base; end",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.54939944",
"text": "def connect!; end",
"title": ""
},
{
"docid": "5ad352c9c1e343d5a86fff71052e5c6c",
"score": "0.5480662",
"text": "def __build_connections\n @request_options = {}\n\n if options.key?(:headers)\n @request_options[:headers] = options[:headers]\n end\n\n client_options = options[:transport_options] || {}\n client_options[:ssl] = options[:ssl] || {}\n\n Connections::Collection.new \\\n :connections => hosts.map { |host|\n host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL\n host[:port] ||= DEFAULT_PORT\n\n host.delete(:user) # auth is not supported here.\n host.delete(:password) # use the headers\n\n url = __full_url(host)\n\n Connections::Connection.new \\\n :host => host,\n :connection => ::Manticore::Client.new(client_options)\n },\n :selector_class => options[:selector_class],\n :selector => options[:selector]\n end",
"title": ""
},
{
"docid": "7f800d57b82008e71ca325ebd99eeb76",
"score": "0.54800725",
"text": "def init_conn_cinder\n os_endpoint_cinder = Rails.application.config.os_endpoint_cinder\n @conn[:cinder] = Faraday.new(:url => \"#{os_endpoint_cinder}\") do |faraday|\n faraday.adapter :net_http_persistent\n end\n end",
"title": ""
},
{
"docid": "498526ea93de414d6d7a6275362bead4",
"score": "0.5479889",
"text": "def each_server_app(&block)\n @app.each(@options, &block)\n end",
"title": ""
},
{
"docid": "e164ddd9849fa93fcc39be554884307a",
"score": "0.54765123",
"text": "def connections\n @connections\n end",
"title": ""
},
{
"docid": "8094f35c0ab74f7d92a3053541bbcfaa",
"score": "0.5472103",
"text": "def get_conns\n call(\"get-conns\")\n end",
"title": ""
},
{
"docid": "a59d8bbfcb8ff9f5b4e9aa7ef1d62139",
"score": "0.5471654",
"text": "def check_for_connections\n connect checkout_agent, get_next_caller while call_waiting? && agent_available?\n end",
"title": ""
},
{
"docid": "a59d8bbfcb8ff9f5b4e9aa7ef1d62139",
"score": "0.5471654",
"text": "def check_for_connections\n connect checkout_agent, get_next_caller while call_waiting? && agent_available?\n end",
"title": ""
},
{
"docid": "369ce266f2710cd2419225860664ed2c",
"score": "0.54693776",
"text": "def connect(settings = nil, &block)\n if settings && settings[:adapter]\n adapter = load_adapter(settings[:adapter])\n else\n adapter = self\n end\n\n @settings = AMQ::Client::Settings.configure(settings)\n instance = adapter.new\n instance.establish_connection(@settings)\n # We don't need anything more, once the server receives the preable, he sends Connection.Start, we just have to reply.\n\n if block\n block.call(instance)\n\n instance.disconnect\n else\n instance\n end\n end",
"title": ""
},
{
"docid": "8a257ddb682f63c82c729ca68277dbe5",
"score": "0.54689175",
"text": "def establish_connection(settings)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "620eea1033b0555992c09394909a671c",
"score": "0.54685616",
"text": "def adapter_initialize\n raise(Error, \"No connection string specified\") unless uri\n if prok = Sequel::Database.load_adapter(subadapter.to_sym, :map=>DATABASE_SETUP, :subdir=>'do')\n prok.call(self)\n end\n end",
"title": ""
},
{
"docid": "58ed15b47d5ec6a36f3edcb35af56809",
"score": "0.5464268",
"text": "def def_adapter_method(*adapters) # :nodoc:\n adapters.each do |adapter|\n define_singleton_method(adapter){|*args, &block| adapter_method(adapter, *args, &block)}\n end\n end",
"title": ""
},
{
"docid": "4ca84e179bbd71d9cae5f4a97d1a0b61",
"score": "0.54619426",
"text": "def do_to_connections\n all_connections.each do |conn|\n begin\n yield(conn)\n rescue => e\n if @logger\n @logger.warn(\"Error in do_to_connections\")\n @logger.warn(e.message)\n @logger.warn(e.backtrace.inspect)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c496369af9b92ba39140235e88b64ea",
"score": "0.546091",
"text": "def connections(interface = :inet)\n @proc.connections(interface)\n end",
"title": ""
},
{
"docid": "24006f110aa689d8047feba33e9d12d4",
"score": "0.54592377",
"text": "def connection(env); end",
"title": ""
},
{
"docid": "24006f110aa689d8047feba33e9d12d4",
"score": "0.54592377",
"text": "def connection(env); end",
"title": ""
},
{
"docid": "bd6b56ed600c044d9b581c614de38afa",
"score": "0.5454617",
"text": "def setup_sockets\n options = @settings[:client][:socket] || Hash.new\n options[:bind] ||= \"127.0.0.1\"\n options[:port] ||= 3030\n @logger.debug(\"binding client tcp and udp sockets\", :options => options)\n @sockets << EM::start_server(options[:bind], options[:port], Socket) do |socket|\n socket.logger = @logger\n socket.settings = @settings\n socket.transport = @transport\n end\n @sockets << EM::open_datagram_socket(options[:bind], options[:port], Socket) do |socket|\n socket.logger = @logger\n socket.settings = @settings\n socket.transport = @transport\n socket.protocol = :udp\n end\n end",
"title": ""
},
{
"docid": "60bfcfefaf4664b54908c34a3cf8aeca",
"score": "0.5451226",
"text": "def connect\n EM.error_handler do |exception|\n p exception\n end\n\n EM.run do\n @servers.each do |server|\n connection = EM.connect server.host, server.port, Connection, server\n end\n end\n end",
"title": ""
},
{
"docid": "f574f2ac0848dcd38399025ee8a6e7f4",
"score": "0.5449987",
"text": "def list_shared_eth_adapters\n command = \"lsmap -all -net\"\n execute_vios_cmd(command)\n end",
"title": ""
},
{
"docid": "50fe17c156440c31e1dcdcf5f2cc0f4e",
"score": "0.54344785",
"text": "def parallel_connection\n Faraday.new(\n base_path, headers: base_request_headers, request: request_options\n ) do |conn|\n conn.use :breakers\n conn.request :camelcase\n conn.request :json\n\n conn.response :snakecase\n conn.response :json, content_type: /\\bjson$/\n conn.response :vaos_errors\n conn.use :vaos_logging\n conn.adapter :typhoeus\n end\n end",
"title": ""
},
{
"docid": "264cc89f246f463892049ba85aa19231",
"score": "0.54309976",
"text": "def setup_connection\n @base_uri ||= \"http://localhost:5000\"\n @base_uri = @base_uri + \"/applications/#{@application_id}/api/versions/#{@api_version}/\"\n \n connection({:user_agent => \"Anypresence Extension\"})\n end",
"title": ""
},
{
"docid": "7c6e6e95759f2da31f08e78723390fcb",
"score": "0.54304117",
"text": "def connect\n @configuration.slaves.collect do |slave_details|\n start_host(slave_details)\n end\n end",
"title": ""
},
{
"docid": "ec7a4481c18b71118c59c36407699ef3",
"score": "0.54299116",
"text": "def connections\n $connections\n end",
"title": ""
},
{
"docid": "aa5fbcd33a7c2056b75159e8f3097cd2",
"score": "0.542761",
"text": "def resolve\n ConnectionAdapters::ConnectionSpecification::Resolver.new(config).resolve_all\n end",
"title": ""
},
{
"docid": "14d4e23d52b3a949c859967dc3bf56b1",
"score": "0.5426057",
"text": "def connect\n self.connection.connect\n end",
"title": ""
},
{
"docid": "326b370355d7c8ccdd047f2a5e74352d",
"score": "0.54233867",
"text": "def initialize\n @questions_conn = Faraday.new :url => QUESTIONS_ENDPOINT\n @score_conn = Faraday.new :url => SCORE_ENDPOINT\n @sms_conn = Faraday.new :url => SMS_ENDPOINT\n end",
"title": ""
},
{
"docid": "f3590461aa670dbc8c23053b973a5d9e",
"score": "0.5422102",
"text": "def connect\n ::Sequel.connect(adapter_connection, {\n logger: logger,\n max_connections: pool\n })\n end",
"title": ""
},
{
"docid": "2da1f035559b2c0a0da77d13b263ae0a",
"score": "0.5405247",
"text": "def establish_connection\n super\n\n begin\n locator = WIN32OLE.new('WbemScripting.SWbemLocator')\n\n debug 'attempting connection to cimv2 namespace'\n @wmi = locator.ConnectServer(@host, 'root\\cimv2', @user, @password, nil, nil, 128)\n debug 'connection to cimv2 namespace successful'\n \n debug 'attempting connection to wmi root namespace'\n @root_wmi = locator.ConnectServer(@host, 'root\\WMI', @user, @password, nil, nil, 128)\n debug 'connection to wmi root namespace successful'\n\n debug 'attempting connection to registry'\n @registry = locator.ConnectServer(@host, 'root\\default', @user, @password, nil, nil, 128).Get('StdRegProv')\n debug 'connection to registry successful'\n\n debug 'all required connections established'\n @connected = @reconnectable = true\n\n rescue WIN32OLERuntimeError => error\n @connected = false\n if error.message =~ /access is denied/i\n warn \"connection failed (connection made but credentials not accepted with user #{@user})\"\n @failure_messages << CONN_FAILURE_AUTH_FAILED\n @reconnectable = true\n elsif error.message =~ /call was canceled by the message filter/i\n warn CONN_FAILURE_RPC_FILTERED\n @failure_messages << CONN_FAILURE_RPC_FILTERED\n @reconnectable = false\n elsif error.message =~ /rpc server is unavailable/i\n warn CONN_FAILURE_RPC_UNAVAILABLE\n @failure_messages << CONN_FAILURE_RPC_UNAVAILABLE\n @reconnectable = false\n elsif error.message =~ /user credentials cannot be used for local connections/i\n # clear the credentials then try to connect again\n warn CONN_FAILURE_LOCAL_CREDENTIALS\n @user = nil\n @password = nil\n establish_connection\n else\n message = \"connection failed (#{error.message.gsub(/\\n\\s*/, '. ')})\"\n warn message\n @failure_messages << message\n @reconnectable = true\n end\n end\n\n if @connected == false && @reconnectable == true\n info 'connection available for retry'\n elsif @reconnectable == false\n info 'connection does not seem to be available (so we will not retry)'\n end unless @transport\n\n self\n end",
"title": ""
}
] |
3d39ad73d1ef7adee96ed688882af8a1
|
to determine sheet ID in range
|
[
{
"docid": "1bcbbe0be1d4b9fe39f8f152367a1bac",
"score": "0.0",
"text": "def get_day(timeslot)\n return timeslot.starttime.strftime(\"%d\").to_i\nend",
"title": ""
}
] |
[
{
"docid": "69d9dd839173b63f2242403e55d3c6a8",
"score": "0.7514566",
"text": "def worksheet_id(sheet_name)\n @spreadsheet.worksheets.tap { |sheets|\n @logger.debug(\"==== Worksheets ====\")\n @logger.debug([' [Sheet Name]', '[Sheet ID]'].join(\" \"))\n sheets.each { |x| @logger.debug(x.join(\" \")) }\n }.each { |sheet|\n return sheet[1] if sheet[0] == sheet_name\n }\n end",
"title": ""
},
{
"docid": "edc2d7069d3d0496477140bba1c3f29e",
"score": "0.6631081",
"text": "def sheet_ids\n sheet_ids = []\n sheets = Sheet.find_all_by_survey_id(self.id)\n sheets.each do |sheet|\n sheet_ids << sheet.id\n end\n return sheet_ids\n end",
"title": ""
},
{
"docid": "aef72e4ef6b338c565a40b3bc092fb26",
"score": "0.63589084",
"text": "def set_sheet\n @sheet = @campaign.sheets.find(params[:id])\n end",
"title": ""
},
{
"docid": "3179147cfdeab3d20699c5588adee998",
"score": "0.6329612",
"text": "def local_sheet_id=(value)\n Axlsx.validate_unsigned_int(value)\n @local_sheet_id = value\n end",
"title": ""
},
{
"docid": "fa95489c96aecc0f016b7e1d2d40ef77",
"score": "0.62886274",
"text": "def people_worksheet_range\n 'People!A:G'\nend",
"title": ""
},
{
"docid": "b19aef0a682fe65f6fc7533363232bab",
"score": "0.62615067",
"text": "def getSheet\n case ftype\n when FTYPE_SHEET\n return Sheet.find_by_id(type_index)\n else # \n return nil\n end\n end",
"title": ""
},
{
"docid": "4dd0e0d9f5d8aa757d9c28583d660ae1",
"score": "0.6245957",
"text": "def find_resource_identifier(sheet, name)\n\t\t\ti = 0\n\t\t\theader = XlsReader.header(sheet)\n\t\t\theader.each do |p|\n\t\t\t\tif p.to_s.upcase.eql? name\n\t\t\t\t\treturn i\n\t\t\t\telse\n\t\t\t\t\ti = i + 1\n\t\t\t\tend\n\t\t\tend\n\t\t\t-1\n\t\tend",
"title": ""
},
{
"docid": "291df69bf40ce2d956469dc0f74e6372",
"score": "0.62004846",
"text": "def set_sheet\n @sheet = Sheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "291df69bf40ce2d956469dc0f74e6372",
"score": "0.62004846",
"text": "def set_sheet\n @sheet = Sheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "291df69bf40ce2d956469dc0f74e6372",
"score": "0.62004846",
"text": "def set_sheet\n @sheet = Sheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "291df69bf40ce2d956469dc0f74e6372",
"score": "0.62004846",
"text": "def set_sheet\n @sheet = Sheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "d730e64aa7beb8d7d2c4034c7cc11a3b",
"score": "0.6020366",
"text": "def worksheet idx\n case idx\n when Integer\n @worksheets[idx]\n when String\n @worksheets.find do |sheet| sheet.name == idx end\n end\n end",
"title": ""
},
{
"docid": "d0a088f8fceec0943415a99b99b53ec9",
"score": "0.5954975",
"text": "def sheet(i = nil)\n @current_sheet = i if i\n @sheet = @book.getSheetAt(@current_sheet)\n end",
"title": ""
},
{
"docid": "50eaaee0ef706703d3e50e0bb2e650f6",
"score": "0.5917647",
"text": "def get_spreadsheet_id(date_time)\n month = date_time.strftime(\"%m\").to_i\n year = date_time.strftime(\"%Y\").to_i\n id = Spreadsheet.get_id_by_date(month, year)\n return id\nend",
"title": ""
},
{
"docid": "a280fe5ebd7245407db8859c0872df45",
"score": "0.5847503",
"text": "def set_sheet\n user = authenticate\n sheet = Sheet.friendly.find(params[:id]) \n if sheet.user_id == user['id']\n @sheet = sheet\n else\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "36b6d0a2a17d6b6d459a1103f50b35ee",
"score": "0.5840543",
"text": "def sheet_no(name)\n return name - 1 if name.is_a?(Fixnum)\n worksheets.each_with_index do |worksheet, index|\n return index if name == normalize_string(worksheet.name)\n end\n raise StandardError, \"sheet '#{name}' not found\"\n end",
"title": ""
},
{
"docid": "916e5945f2b1ad6ccd0b7ed5d2def5f5",
"score": "0.5760661",
"text": "def get_chart_range(range) # :nodoc:\n # Split the range formula into sheetname and cells at the last '!'.\n pos = range.rindex('!')\n return nil unless pos\n\n if pos > 0\n sheetname = range[0, pos]\n cells = range[pos + 1..-1]\n end\n\n # Split the cell range into 2 cells or else use single cell for both.\n if cells =~ /:/\n cell_1, cell_2 = cells.split(/:/)\n else\n cell_1 = cells\n cell_2 = cells\n end\n\n # Remove leading/trailing apostrophes and convert escaped quotes to single.\n sheetname.sub!(/^'/, '')\n sheetname.sub!(/'$/, '')\n sheetname.gsub!(/''/, \"'\")\n\n row_start, col_start = xl_cell_to_rowcol(cell_1)\n row_end, col_end = xl_cell_to_rowcol(cell_2)\n\n # Check that we have a 1D range only.\n return nil if row_start != row_end && col_start != col_end\n\n [sheetname, row_start, col_start, row_end, col_end]\n end",
"title": ""
},
{
"docid": "3ffcdd7e08a65040051cc8e5e0763634",
"score": "0.5678972",
"text": "def sheets\n @sheetlist\n end",
"title": ""
},
{
"docid": "ab0dc2f0671ad96a26be8050a0b09bab",
"score": "0.5660043",
"text": "def [](ind)\n case ind\n when Integer then worksheets[ind]\n when String then worksheets.find { |ws| ws.sheet_name == ind }\n end\n end",
"title": ""
},
{
"docid": "ab0dc2f0671ad96a26be8050a0b09bab",
"score": "0.5660043",
"text": "def [](ind)\n case ind\n when Integer then worksheets[ind]\n when String then worksheets.find { |ws| ws.sheet_name == ind }\n end\n end",
"title": ""
},
{
"docid": "ab0dc2f0671ad96a26be8050a0b09bab",
"score": "0.5660043",
"text": "def [](ind)\n case ind\n when Integer then worksheets[ind]\n when String then worksheets.find { |ws| ws.sheet_name == ind }\n end\n end",
"title": ""
},
{
"docid": "95c1845c139a7cf562163b148ca66efd",
"score": "0.5659953",
"text": "def get(range:, id:)\n begin\n open(get_request_path(range,id)).read \n rescue => e\n \"error fetching spreadsheet id #{id} with range #{range}\" \n end\n end",
"title": ""
},
{
"docid": "d20adef0a95e86740f75670746c113fc",
"score": "0.5641225",
"text": "def get_range_parts(range)\n if range =~ /([' a-zA-Z]+!)?([A-Z]+\\d+):([A-Z]+\\d+)/\n sheet = $1\n range1 = $2\n range2 = $3\n if sheet\n sheet = sheet[0..sheet.size-2]\n if sheet =~ /'(.+)'/\n sheet = $1\n end\n end\n return [sheet, range1, range2]\n end\n nil\n end",
"title": ""
},
{
"docid": "e20b689faa9189bacabf41c1c1ff3bde",
"score": "0.5637175",
"text": "def set_spreadsheet\n @spreadsheet = Spreadsheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "e12900a66019dbb9a6abde1de5c46623",
"score": "0.5628804",
"text": "def part2(grid)\n grid.non_overlapping.id\nend",
"title": ""
},
{
"docid": "f3f95ce5e725c790d4a8812130470431",
"score": "0.55761194",
"text": "def compute_sheet_ids_with_max_position(sheet_scope)\n highest_hash = {}\n all_positions = Grid.joins(:sheet_variable)\n .merge(SheetVariable.where(sheet_id: sheet_scope.select(:id)))\n .pluck(:sheet_id, :position)\n all_positions.each do |sheet_id, position|\n highest_hash[sheet_id.to_s] ||= 0\n highest_hash[sheet_id.to_s] = position if position > highest_hash[sheet_id.to_s]\n end\n highest_hash.collect { |sheet_id, position| [sheet_id.to_i] * (position + 1) }.flatten.sort.reverse\n end",
"title": ""
},
{
"docid": "1b0e617c9ad1479461f23251f459de44",
"score": "0.55134284",
"text": "def set_worksheet\n @worksheet = Worksheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "e66f193348f1df0a37c59414f8921453",
"score": "0.54938",
"text": "def usedrange\n raise NoMethodError, 'Sheet is empty' if empty?\n Range.new( self, 'A1:' + indices_to_address( maxrow, maxcol ) )\n end",
"title": ""
},
{
"docid": "6f4c62579c8e065919c77017d95a837d",
"score": "0.5471407",
"text": "def goal_sheet_input\n goal_ranges.each do |range|\n @range = range\n @goal_sheet = @xlsx.sheet(@range).parse(header_search: [])\n create_goals\n end\n end",
"title": ""
},
{
"docid": "e94e5aed33a56029248590d6887334f1",
"score": "0.54245245",
"text": "def sheet_params\n params[:sheet].permit(:user_id)\n end",
"title": ""
},
{
"docid": "845fa16cc378b0378d00bda5b0a58eb6",
"score": "0.5413421",
"text": "def data_responsible_person_sheet\r\n @book.worksheet(WBF[:people_sheet])\r\n end",
"title": ""
},
{
"docid": "7b5bcfd0404d6e18000229dfacbbe5c3",
"score": "0.5410998",
"text": "def worksheet_by_name(sheetname = nil)\n sheets.select { |s| s.name == sheetname }.first\n end",
"title": ""
},
{
"docid": "797e1d9579a26c633ee94710c38425a8",
"score": "0.5399179",
"text": "def set_googlesheet\n @googlesheet = Googlesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "a57a6ce350eb0bdb7b76a5f6356b1369",
"score": "0.5361563",
"text": "def get_sheet_response(range)\n spreadsheet_id = get_spreadsheet_id(Time.now) #gets id of spreadsheet of current month\n $service.get_spreadsheet_values(spreadsheet_id, range).values # mock this\nend",
"title": ""
},
{
"docid": "aa50e195ee649239d9d0b172a292704e",
"score": "0.5334621",
"text": "def sheets( ref=nil )\n if ref.nil?\n return to_enum (:each) unless block_given?\n each { |s| yield s }\n else\n case ref\n when Fixnum ; @sheets[ ref - 1 ]\n when String ; @sheets.find { |s| s.name =~ /^#{ ref }$/i }\n when Regexp ; @sheets.find { |s| s.name =~ ref }\n end\n end\n end",
"title": ""
},
{
"docid": "6e0ee8598d75033fc0cc2763398c6402",
"score": "0.53075546",
"text": "def getColumnIndex map,ws\r\n\t#range gives a two dimensional array\r\n\theadLines = ws.range(\"a1:o1\").value[0]\r\n\tmap.each do |key,val|\r\n\t\t#Check if the given column itself exists in the workbook (Ex : CSCRM)\r\n\t\tindex = headLines.index key\r\n\t\tif index\r\n\t\t\tmap[key] = index + 1\r\n\t\telse\r\n\t\t\tkey_alias = $columnNameMap[key]\r\n\t\t\tif key_alias\r\n\t\t\t\t#if the column name alias exists, check for the alias name exists in the worksheet\r\n\t\t\t\tindex = headLines.index key_alias\r\n\t\t\t\tmap[key] = index + 1 if index\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\nend",
"title": ""
},
{
"docid": "bcf7a105d9cfbf3a6c761fbe6029d4bb",
"score": "0.5306516",
"text": "def get_spreadsheet_key_by_title(spreadsheet_name)\n spreadsheets_uri = \"http://spreadsheets.google.com/feeds/spreadsheets/private/full?title=#{spreadsheet_name}&title-exact=true\"\n my_spreadsheets = get_feed(spreadsheets_uri)\n \n doc = create_datastructure_from_xml(my_spreadsheets.body)\n \n return doc[\"entry\"][0][\"id\"][0][/full\\/(.*)/, 1]\n end",
"title": ""
},
{
"docid": "ac64dfc5934f54a99c90c551fdd21201",
"score": "0.5290004",
"text": "def sheets?\n @gapi.source_format == \"GOOGLE_SHEETS\"\n end",
"title": ""
},
{
"docid": "3fde76947dc0af289d3447da67f665fe",
"score": "0.528547",
"text": "def get_id_from_ref(def_header, ref_key)\n @sheet_results.each do |sh, res|\n ref_ids = res[:_ref_ids]\n next if ref_ids.nil? # this shouldn't really happen\n hdr_ids = ref_ids[def_header]\n next if hdr_ids.nil?\n id = hdr_ids[ref_key]\n return id unless id.nil?\n end\n return nil\n end",
"title": ""
},
{
"docid": "7889c053bc5a7abfdac5c8b49a4b842d",
"score": "0.5285055",
"text": "def openSheet(sheet_key, page=0) \n\t\tws = @session.spreadsheet_by_key(sheet_key).worksheets[page]\n\tend",
"title": ""
},
{
"docid": "48e97a3f25f80f66f6aa2f08f4b604f4",
"score": "0.5264787",
"text": "def sheet?(wb,wsname)\n\n result=false\n return result if (!wb.is_a?(WIN32OLE))\n\n if (wsname.is_a?(String))\n result=false\n wb.worksheets().each { |ws| break if (result=(ws.name==wsname)) }\n elsif (wsname.is_a?(Integer))\n nosh = wb.worksheets().count\n result = ((wsname>=1) and (wsname<=nosh) )\n end\n return result\nend",
"title": ""
},
{
"docid": "11a84026e28dd2e4c667043b2b00a053",
"score": "0.5259563",
"text": "def get_answer_sheet\n @answer_sheet = answer_sheet_type.find(params[:id])\n case @answer_sheet.class.to_s\n when 'Apply'\n unless @answer_sheet.applicant == current_person || (si_user && si_user.can_su_application?)\n redirect_to root_path\n return false\n end\n when 'ReferenceSheet'\n \n else\n redirect_to root_path\n return false\n end\n \n end",
"title": ""
},
{
"docid": "52249a0f8478d8077083030cf2c0ecc8",
"score": "0.525329",
"text": "def get_sheet\n\tsheet = Array.new\n\ti = 1\n\twhile i < RC_C.num_rows\n\t\tsheet[i-1] = RC_C.rows[i]\n\t\ti += 1\n\tend\n\treturn sheet\nend",
"title": ""
},
{
"docid": "3d7bbcffcbd8b05ad92ac1bb6136dc64",
"score": "0.52484435",
"text": "def row_index\n worksheet.rows.index(self)\n end",
"title": ""
},
{
"docid": "405e518f50e05f9ddee7a1746239e7c7",
"score": "0.52452874",
"text": "def longest_sheet\n sheet(worksheets.inject {|m, o|\n o.row_count > m.row_count ? o : m\n }.name)\n end",
"title": ""
},
{
"docid": "fcaf343bc9de3d15ed1f71c903383ade",
"score": "0.523523",
"text": "def sheets\r\n ['default']\r\n end",
"title": ""
},
{
"docid": "2e67a05969fd6334f7515daf1f34c8a0",
"score": "0.5235005",
"text": "def get_spreadsheet(session, excel)\n\t\t#on recupere le fichier de notre drive\n\t\tfile = session.spreadsheet_by_title(excel)\n\n\t\t#je me positionne dans le 1er onglet de mon fichier spreadsheet drive (excel drive)\n\t\treturn onglet1 = file.worksheets[0]\n\tend",
"title": ""
},
{
"docid": "b02606f2f1283488b413d084150a16c8",
"score": "0.5222526",
"text": "def get_answer_sheet\n @application = @answer_sheet = answer_sheet_type.find(params[:id])\n case @answer_sheet.class.to_s\n when 'SpApplication'\n unless @answer_sheet.person == current_person || (sp_user && sp_user.can_su_application?)\n redirect_to root_path\n return false\n end\n when 'Fe::ReferenceSheet'\n return true\n else\n redirect_to root_path\n return false\n end\n end",
"title": ""
},
{
"docid": "dfd4df2a65aeaa9ed0b2eeafa0dcb7ce",
"score": "0.52205026",
"text": "def [](cell_def)\n sheet_name = cell_def.split('!')[0] if cell_def.include?('!')\n worksheet = worksheets.find { |s| s.name == sheet_name }\n raise ArgumentError, 'Unknown Sheet' unless sheet_name && worksheet.is_a?(Worksheet)\n\n worksheet[cell_def.gsub(/.+!/, \"\")]\n end",
"title": ""
},
{
"docid": "306b65c8a288e19ca9fea86ac58f888a",
"score": "0.52181953",
"text": "def postToolsGooglesheetWorksheet_id( spreadsheet_key, worksheet_name)\n params = Hash.new\n params['spreadsheet_key'] = spreadsheet_key\n params['worksheet_name'] = worksheet_name\n return doCurl(\"post\",\"/tools/googlesheet/worksheet_id\",params)\n end",
"title": ""
},
{
"docid": "6cc97b9f8e9c17a92f2569a32d4cc1b8",
"score": "0.5209248",
"text": "def sheet_count\n @worksheets.length\n end",
"title": ""
},
{
"docid": "599258d35afe11337f9c4d1c99c932b3",
"score": "0.5205268",
"text": "def get_answer_sheet\n @answer_sheet = answer_sheet_type.find(params[:id])\n end",
"title": ""
},
{
"docid": "282b0623512761f859d97247c95d0e55",
"score": "0.51913136",
"text": "def find_row(ts_starttime, starttime, sheet_ID)\n spreadsheet_id = get_spreadsheet_id(ts_starttime)\n vals = $service.get_spreadsheet_values(spreadsheet_id, \"#{sheet_ID}!A1:B\" ).values\n # vals = list representation of the cells in the spreadsheet\n row = 0\n while (starttime != format_time(vals[row][0])) do\n row += 1\n end\n return row + 1\nend",
"title": ""
},
{
"docid": "1fa33df7177429ed87303498d05bf1a9",
"score": "0.51803404",
"text": "def set_sheet_b\n @sheet_b = SheetB.find(params[:id])\n end",
"title": ""
},
{
"docid": "eeaf775c785ee29bec4b47da2e953bfb",
"score": "0.51702935",
"text": "def initialize(spreadsheet_id)\n # Initialize the API\n @service = Google::Apis::SheetsV4::SheetsService.new\n @service.client_options.application_name = APPLICATION_NAME\n @service.authorization = authorize\n\n # Prints the names and majors of students in a sample spreadsheet:\n # https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit\n # spreadsheet_id = \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n # range = \"Insert your updates here!A3:E\"\n range = \"'Published factchecks'!A:Q\"\n response = @service.get_spreadsheet_values spreadsheet_id, range\n puts \"No data found.\" if response.values.empty?\n\n @spreadsheet_id = spreadsheet_id\n @values = response.values\n end",
"title": ""
},
{
"docid": "885b1758c1d75a3626975e2758b66f9d",
"score": "0.5139359",
"text": "def header_cell_refs\n Axlsx.range_to_a(header_range).first\n end",
"title": ""
},
{
"docid": "a5c1949911847b0e553395ebdbad118b",
"score": "0.5137486",
"text": "def set_time_sheet\n @time_sheet = current_user.time_sheets.find(params[:id])\n end",
"title": ""
},
{
"docid": "24f8a6caec9642196bdef2c7241011b0",
"score": "0.5137391",
"text": "def set_time_sheet\n @time_sheet = TimeSheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "524b7f1924211c144254d1d377c1c5c6",
"score": "0.51354074",
"text": "def returned_sheets?\n returned_sheets > 0\n end",
"title": ""
},
{
"docid": "0caab78b35f562e77c73e17207a3e25a",
"score": "0.5112514",
"text": "def range_start; range.first; end",
"title": ""
},
{
"docid": "b4860ba1d7c014c65b1a44e2c1f58c35",
"score": "0.5101757",
"text": "def cell_range= range\n start_cell, end_cell = range.split(\":\")\n unless start_cell.nil? || start_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n start_cell = start_cell.upcase\n self.start_column, self.start_row = from_alpha(start_cell.sub(/[0-9]+/,\"\")), start_cell.sub(/[A-Z]+/,\"\").to_i\n self.end_column, self.end_row = nil, nil\n if end_cell.nil?\n self.end_column = self.start_column\n self.end_row = self.start_row\n else\n end_cell = end_cell.upcase\n unless end_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n self.end_column, self.end_row = from_alpha(end_cell.sub(/[0-9]+/,\"\")), end_cell.sub(/[A-Z]+/,\"\").to_i\n else\n start_row = nil\n end\n end\n else\n start_row = nil\n end\n end",
"title": ""
},
{
"docid": "8d2929849350827894db1b4822949eb4",
"score": "0.50779474",
"text": "def worksheets\n @worksheets ||= (1..number_of_worksheets).collect { |n| Nokogiri::XML(zipfile.read(\"xl/worksheets/sheet#{n}.xml\")) }\n end",
"title": ""
},
{
"docid": "518e46356f14a6c1a736f90e92735329",
"score": "0.5065823",
"text": "def set_first_sheet\n hidden = 0 # Active worksheet can't be hidden.\n firstsheet = index\n end",
"title": ""
},
{
"docid": "6b3e3a5e9b941e4f4dfcc6e578ddbece",
"score": "0.5065519",
"text": "def index\n worksheet.rows.index(self)\n end",
"title": ""
},
{
"docid": "478a87cb48c4da3397eaf066f039dfa8",
"score": "0.5065139",
"text": "def set_class_sheet\n @class_sheet = ClassSheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "816e8e912355c9a5d82e4dff3b1b919a",
"score": "0.5050342",
"text": "def sheets_on_subject_event(current_user)\n current_user.all_viewable_sheets\n .where(subject_event_id: id)\n .where(design_id: required_design_ids)\n end",
"title": ""
},
{
"docid": "6ba743b768020220c53d11ef0c8b871a",
"score": "0.5047766",
"text": "def sheet_props\n self[:sheet].map(&:last).inject({}, &:merge)\n end",
"title": ""
},
{
"docid": "d905a3bc8841692d3cc24e978640f17f",
"score": "0.5047559",
"text": "def sheet_params\n params.require(:sheet).permit(:spreadsheet, :campaign_id)\n end",
"title": ""
},
{
"docid": "5ce808045876184bb2c6fcc245cfa4ff",
"score": "0.5045692",
"text": "def rows(range = 'Sheet1!A1:E')\n get_spreadsheet_data('1eu1Dk67gKnrIgQQ9Fm0Y-RCMzRfZf1UaTQzEt7hjWp0', range)\n end",
"title": ""
},
{
"docid": "fb5c979b8b41f147c6962c20fa92932c",
"score": "0.50404876",
"text": "def header_cells\n data_sheet[header_range]\n end",
"title": ""
},
{
"docid": "e70812b4a48ad23a7d0d8b5b895bfcb5",
"score": "0.50343007",
"text": "def first_sheet_title\n \"Tonnage Statistics\"\n end",
"title": ""
},
{
"docid": "8e383f6a603c10fa412ae6b5aae33825",
"score": "0.50278026",
"text": "def activate_sheet(term)\n\n if @workbook\n x = term.is_a?(String) ? @workbook.getSheetIndex(term.to_java(java.lang.String)) : term\n @sheet = worksheet(x)\n\n if @sheet\n @current_sheet_index = x\n @workbook.setActiveSheet(@current_sheet_index)\n @sheet = @workbook.getSheetAt(@current_sheet_index)\n @sheet.setActive(true)\n end\n end\n @sheet\n end",
"title": ""
},
{
"docid": "cf6d0d01c68c2ba97bbe4dd7a37cae84",
"score": "0.50219667",
"text": "def sheets\n [\"default\"]\n end",
"title": ""
},
{
"docid": "5f7ced4ac337aaa8108ddb2fce0fc605",
"score": "0.50167",
"text": "def set_issue_exists_in_google_sheet\n @issue_exists_in_google_sheet = IssueExistsInGoogleSheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "a78e290cfa65c619127f2533a3ee1367",
"score": "0.50073487",
"text": "def first_row(sheet=nil)\n sheet = @default_sheet unless sheet\n unless @first_row[sheet]\n sheet_no = sheets.index(sheet) + 1\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] = @gs.oben_unten_links_rechts(sheet_no)\n end \n return @first_row[sheet]\n end",
"title": ""
},
{
"docid": "0b90acaf76ba2f64e0044b01726d748a",
"score": "0.50054795",
"text": "def buildsheet(sheet, options)\n ydiff, xdiff = 0,0\n if !options[:paginate].nil?\n ydiff = options[:paginate][0] * (options[:paginate][1]-1)\n elsif !options[:cellrange].nil?\n xdiff = x(options[:cellrange].begin)\n ydiff = y(options[:cellrange].begin)\n end\n\n m=Sheet.build(sheet[:cells].last.y+1-ydiff, sheet[:cells].last.x+1-xdiff) {nil}\n sheet[:cells].each do |c|\n m[c.y-ydiff, c.x-xdiff] = c\n end\n return m\n end",
"title": ""
},
{
"docid": "dcc2ec37f699bc53d7f43e0d1919cd8b",
"score": "0.50051796",
"text": "def range_key\n table_range_key && read_attribute(table_range_key)\n end",
"title": ""
},
{
"docid": "66b7b788389017a648cce5281a8d8621",
"score": "0.50045407",
"text": "def worksheet\n @session ||= GoogleDrive::Session.from_service_account_key(\"client_secret.json\")\n @spreadsheet ||= @session.spreadsheet_by_title(\"Mentormonth\")\n @worksheet ||= @spreadsheet.worksheets.first\nend",
"title": ""
},
{
"docid": "379831f28c15123cc7d486b2fdb15af1",
"score": "0.50039",
"text": "def sheet_by_name(name)\n encoded_name = Axlsx.coder.encode(name)\n @worksheets.find { |sheet| sheet.name == encoded_name }\n end",
"title": ""
},
{
"docid": "e4d480e241f0a0ecde90ca6abf16b2ae",
"score": "0.4997587",
"text": "def set_timesheet\n begin\n @timesheet = @current_employee.timesheets.find(params[:id])\n rescue StandardError => ex\n @timesheet = nil\n end\n end",
"title": ""
},
{
"docid": "b068ec404104ad748925318b317955ed",
"score": "0.49953714",
"text": "def set_list_spreadsheet\n @list_spreadsheet = ListSpreadsheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "d5bf5fef5ab2d1b0a323094927ef8ca7",
"score": "0.4995281",
"text": "def extract_document_id_from_feed(feed,entry)\n links={}\n entry.elements.each('link') do |link|\n links[link.attribute('rel').value] = link.attribute('href').value\n end\n\n if feed==\"documents\"\n @id=entry.elements['id'].text[/.com\\/feeds\\/documents\\/private\\/full\\/spreadsheet%3A(.*)/, 1]\n elsif feed==\"spreadsheets\"\n @id=entry.elements['id'].text[/.com\\/feeds\\/spreadsheets\\/(.*)/, 1]\n else\n puts \"Invalid Feed: Must be 'documents' or 'spreadsheets'.\"\n @id=nil\n end\n \n return @id\n end",
"title": ""
},
{
"docid": "cb22e433247ea385d070580b30c5e324",
"score": "0.49936986",
"text": "def expand_id_range(id, **opt)\n opt[:sid_key] = sid_column unless opt.key?(:sid_key)\n super\n end",
"title": ""
},
{
"docid": "d13592ed34f25ede727d311d3f14afad",
"score": "0.49900088",
"text": "def create_new_sheet(date, new_spreadsheet_id)\n #make copy of template sheet to new spreadsheet\n new_sheet_id = copy_sheet(new_spreadsheet_id)\n \n #set the name of that sheet\n set_name_of_sheet(date.day.to_s, new_sheet_id, new_spreadsheet_id)\n \n #set the date on the sheet\n set_date_of_sheet(date, new_spreadsheet_id)\nend",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.49855894",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.49855894",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.49855894",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.49855894",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.49855894",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "0d81172743aa277af7346f06d711da8d",
"score": "0.49855062",
"text": "def sheets\n @sheets = document.css(['sheet']).map do |sheet|\n sheetfile = document.relationships\n .css(\"Relationship[@Id=#{sheet.attr('r:id')}]\")\n .first.attributes['Target'].value\n Sheet.new(self, sheet.attr(\"name\"), sheet.attr(\"sheetid\"), sheet.attr(\"state\"), sheet.attr(\"visible\"), sheet.attr(\"r:id\"), sheetfile)\n end\n end",
"title": ""
},
{
"docid": "7bfaae11b71d08cb7e9a3cb95d7ba20a",
"score": "0.4978674",
"text": "def set_permission_sheet\n @permission_sheet = PermissionSheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "61a369f92aafe897128eb6aa1f4fc468",
"score": "0.497401",
"text": "def copy_sheet(dest_spreadsheet_id)\n template_sheet_id = ENV[\"TEMPLATE_SHEET_ID\"]\n template_spreadsheet_id = ENV[\"TEMPLATE_SPREADSHEET_ID\"]\n copy_request = Google::Apis::SheetsV4::CopySheetToAnotherSpreadsheetRequest.new\n copy_request.destination_spreadsheet_id = dest_spreadsheet_id\n new_sheet_properties = $service.copy_spreadsheet(template_spreadsheet_id, template_sheet_id, copy_request)\n return new_sheet_properties.sheet_id\nend",
"title": ""
},
{
"docid": "6a157aac86eb3d4c60cb0ea63419480b",
"score": "0.4972976",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "787e83b68eba75d6a57d7947f3ca5cdf",
"score": "0.4970531",
"text": "def sheet()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Sheet::SheetRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "6d9690ccaf2cb21fa97725daf01879f4",
"score": "0.49681568",
"text": "def [](row = 0)\n sheet_data[row]\n end",
"title": ""
},
{
"docid": "4ecefd8e16d18082efdbc74751764527",
"score": "0.49679226",
"text": "def set_excel\n @excel = Excel.find(params[:id])\n end",
"title": ""
},
{
"docid": "4ecefd8e16d18082efdbc74751764527",
"score": "0.4967833",
"text": "def set_excel\n @excel = Excel.find(params[:id])\n end",
"title": ""
},
{
"docid": "570937cbb37afca9f708b86028d1e3ae",
"score": "0.49551788",
"text": "def set_date_of_sheet(date, spreadsheet_id)\n day = date.day\n month = date.month\n year = date.year\n weekday = date.strftime('%A')\n formatted_date = \"#{month}/#{day}/#{year} #{weekday}\"\n range = \"#{day}!A2\" #sheet_name = date\n write_sheet_values(range, [[formatted_date]], date)\nend",
"title": ""
},
{
"docid": "39c2095c2190f8849ee1f88098ddc707",
"score": "0.49527168",
"text": "def apri_file(file)\n s = Roo::Excel.new(file.to_s)\n return s.sheet(0)\n end",
"title": ""
},
{
"docid": "01c158afded5e812824920c16c327b4d",
"score": "0.49526885",
"text": "def sheets\n return_sheets = []\n #TODO: @workbook_doc.find(\"//*[local-name()='sheet']\").each do |sheet|\n @workbook_doc.xpath(\"//*[local-name()='sheet']\").each do |sheet|\n #TODO: return_sheets << sheet.attributes.to_h['name']\n return_sheets << sheet['name']\n end\n return_sheets\n end",
"title": ""
},
{
"docid": "de6903301d643b8a263f88b260a723fd",
"score": "0.49405545",
"text": "def newSheet(table, taskName, id=nil)\n # open the Google Sheet service\n service = Google::Apis::SheetsV4::SheetsService.new\n service.client_options.application_name = APPLICATION_NAME\n service.authorization = authorize\n\n # open the Google Drive service\n drive = Google::Apis::DriveV3::DriveService.new\n drive.client_options.application_name = APPLICATION_NAME\n drive.authorization = authorize\n puts \"id in export sheet\"\n puts id\n\n #create a new sheet\n if id == nil\n\n spreadsheet = {\n properties: {\n title: taskName\n }\n }\n spreadsheet = service.create_spreadsheet(spreadsheet,\n fields: 'spreadsheetId')\n puts \"Spreadsheet ID: #{spreadsheet.spreadsheet_id}\"\n #fill the sheet with the data 'table'\n data = [\n {\n range: 'A:Z',\n majorDimension: \"ROWS\",\n values: table,\n }\n ]\n value_range_object = Google::Apis::SheetsV4::ValueRange.new(range: 'A:Z',\n majorDimension: \"ROWS\",\n values: table)\n result = service.update_spreadsheet_value(spreadsheet.spreadsheet_id,\n 'A:Z',\n value_range_object,\n value_input_option: 'RAW')\n puts = \"#{result.updated_cells} cells updated.\"\n file = drive.get_file(spreadsheet.spreadsheet_id)\n puts \"Create this file name: #{file.name}\"\n id = spreadsheet.spreadsheet_id\n\n ##\n # change the permision of the created file\n # line in google-api-ruby-client/lib/google/apis/core/api_command.rb return {} and make and error.\n # self.body = request_representation.new(request_object).to_json(user_options: { skip_undefined: true })\n #\n data = \n {\n \"role\" => \"writer\",\n \"type\" => \"anyone\"\n }\n # byebug\n permision = drive.create_permission(id, data.to_json,\n options: {skip_serialization: true})\n \n link = \"https://docs.google.com/spreadsheets/d/#{file.id}\"\n puts \"use this link: #{link}\"\n \n return link\n ##\n # Updating the file with new information\n else\n id = id.split('/')[5]\n file = drive.get_file(id)\n #geting the info of the sheet\n get_celds = service.get_spreadsheet_values(id, 'A:C')\n #byebug\n puts get_celds.values.length\n n = get_celds.values.length + 1\n range = \"A#{n}:B#{n}\"\n #write!\n value_range_object = Google::Apis::SheetsV4::ValueRange.new(range: range,\n values: table)\n result = service.update_spreadsheet_value(id,\n range,\n value_range_object,\n value_input_option: 'RAW')\n puts \"Updating this: #{file.name}\"\n link = \"https://docs.google.com/spreadsheets/d/#{file.id}\"\n puts \"use this link: #{link}\"\n return link\n end\nend",
"title": ""
}
] |
b2ff535b1b6f085c75af94ef6c8fa8af
|
List Item Transactions Retrieve an ordered and paginated list of Transactions associated with the Item using a given &x60;:id&x60;.
|
[
{
"docid": "5d3d5253ea680a242dcad1c2ad656487",
"score": "0.67653376",
"text": "def list_item_transactions_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ItemsApi.list_item_transactions ...'\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 ItemsApi.list_item_transactions\"\n end\n # resource path\n local_var_path = '/items/{id}/transactions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Transactions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth', 'oAuth2ClientCredentials']\n\n new_options = opts.merge(\n :operation => :\"ItemsApi.list_item_transactions\",\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: ItemsApi#list_item_transactions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "35c0e22e18366386d5a0751f2bfd4fde",
"score": "0.7663678",
"text": "def list_item_transactions(id, opts = {})\n data, _status_code, _headers = list_item_transactions_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "26aa0008c4dc963c853a97cf7be7bb1b",
"score": "0.60566634",
"text": "def list_transactions(id: nil, account_id: nil, detail: nil, unconfirmed: nil, from: nil, count: nil)\n params = {\n id: id,\n account_id: account_id,\n detail: detail,\n unconfirmed: unconfirmed,\n from: from,\n count: count\n }\n client.make_request('/list-transactions', 'post', params: params)\n end",
"title": ""
},
{
"docid": "64f80b917ba9c5fe0c3a052f934eba22",
"score": "0.6048794",
"text": "def list_item_batch_transactions(id, opts = {})\n data, _status_code, _headers = list_item_batch_transactions_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "76034455e88c4f199ac79f4bbb8a510a",
"score": "0.5952462",
"text": "def transactions account_id\n data = perform_get(\"#{ACCOUNTS_PATH}/#{account_id}/transactions\")\n data[:accountTransactions] || []\n end",
"title": ""
},
{
"docid": "a461d1dbce77896cf64c0a60939c4fc8",
"score": "0.59146947",
"text": "def show_transactions\n items = @db.execute \"SELECT * FROM Items\"\n\n items.each do |item|\n puts \"Item Name: #{item[1]}\"\n puts \"Available Quantity: #{item[2] - item[3]}\"\n\n transactions = @db.execute \"SELECT * FROM Transactions WHERE item_id = #{item[0]}\"\n\n unless transactions.empty?\n puts \"\\nTransaction ID \\t Date/time \\t Type \\t Quantity\"\n\n transactions.each do |txn|\n puts \"#{txn[0]} \\t #{txn[4]} \\t #{txn[1]} \\t #{txn[2]}\"\n end\n end\n\n puts \"---\"\n end\n\n main_with_line_break\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.5909161",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.5909161",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.5909161",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "dc1ee8bcaf9cefb89cf9d8aca0e4339a",
"score": "0.5748325",
"text": "def get_transactions_of(id)\n # takes one arg of the account id\n transactions = (find id).transactions\n # find the account and sets its transactions equal to the transactions local variable\n TransactionsMessage.new(transactions)\n # creates and returns a transactions message, message is responsible for its own output of the transactions array\n rescue ItemExist => message\n # catches exceptions and saves them to a message, then executes code inside block\n message\n # returns exception as message\n end",
"title": ""
},
{
"docid": "327a77aa27cd429c3ba606cc9888d0f7",
"score": "0.5737122",
"text": "def list_item_batch_transactions_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ItemsApi.list_item_batch_transactions ...'\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 ItemsApi.list_item_batch_transactions\"\n end\n # resource path\n local_var_path = '/items/{id}/batch_transactions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'ListBatchTransactions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth', 'oAuth2ClientCredentials']\n\n new_options = opts.merge(\n :operation => :\"ItemsApi.list_item_batch_transactions\",\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: ItemsApi#list_item_batch_transactions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ce99ed24bf449a84a60724e5c8cce00a",
"score": "0.56604874",
"text": "def listtransactions(account, count = 10)\n request :listtransactions, account, count\n end",
"title": ""
},
{
"docid": "065e7a163c543b9c9f2ccc4528e0bdac",
"score": "0.56444097",
"text": "def listtransactions(account = '' , count = 10, from = 0)\n @api.request 'listtransactions', account, count, from\n end",
"title": ""
},
{
"docid": "6936c8a8c0f02edef3b3d605fab39712",
"score": "0.56332994",
"text": "def transactions(account_id, opts = {})\n query = {}\n query['cursor'] = opts[:cursor] if opts[:cursor]\n query['start'] = opts[:start] if opts[:start]\n query['end'] = opts[:end] if opts[:end]\n query['time_field'] = opts[:time_field] if opts[:time_field]\n\n api_get(path(account_id), query)\n end",
"title": ""
},
{
"docid": "cc5e2c1aa5ba477097b5d88a0e22f336",
"score": "0.5617311",
"text": "def get_transaction_items\n transaction.transaction_details\n end",
"title": ""
},
{
"docid": "f3841977e081ffce22e38be51bd6e4fd",
"score": "0.56115353",
"text": "def transactions\n res = filter\n .apply( account.all_transactions.reverse_order(:created_at) )\n\n res\n .paginate(page, per_page)\n end",
"title": ""
},
{
"docid": "dedca7da8dfa4daf92c60c183fd0a330",
"score": "0.5592021",
"text": "def transactionById\n results = HTTParty.get(\"http://192.168.99.101:4050/transactions/\" + (params[:id]).to_s)\n render json: results.parsed_response, status: results.code\n end",
"title": ""
},
{
"docid": "281c733b9c39c24687e0ff90d781a24c",
"score": "0.55842817",
"text": "def transactions\n txs = @client.listtransactions.reverse\n txs.map do |tx|\n tx = symbolize tx\n Transaction.new(\n account: tx.f(:account),\n address: tx.f(:address),\n category: tx.f(:category),\n amount: tx.f(:amount),\n vout: tx.f(:vout),\n confirmations: tx.f(:confirmations),\n blockhash: tx[:blockhash],\n blockindex: tx[:blockindex],\n blocktime: tx[:blocktime],\n txid: tx.f(:txid),\n keychainconflicts: tx.f(:keychainconflicts),\n time: tx.f(:time),\n timereceived: tx.f(:timereceived),\n )\n end\n end",
"title": ""
},
{
"docid": "9b4a600537ce5d2e0f138c3a613e00f1",
"score": "0.55617154",
"text": "def list_wallet_transactions(wallet_id: default_wallet_id, params: {})\n call :get, \"/wallet/#{wallet_id}/tx\", params\n end",
"title": ""
},
{
"docid": "f50fa139def45eeec41e2948ea824a75",
"score": "0.5557626",
"text": "def listtransactions(account, count = 10)\n coind.listtransactions account, count\n end",
"title": ""
},
{
"docid": "9ca34d8bc0cc7e002200386ad98b10ea",
"score": "0.55153275",
"text": "def get_tx_list(options = {})\n body = {\n cmd: \"get_tx_ids\"\n }\n body[:limit] = [options[:limit].to_i, 100].min if options[:limit] # limit The maximum number of transaction IDs to return from 1-100. (default: 25)\n body[:start] = options[:start] if options[:start] # start What transaction # to start from (for iteration/pagination.) (default: 0, starts with your newest transactions.)\n body[:newer] = options[:newer] if options[:newer] # newer Return transactions started at the given Unix timestamp or later. (default: 0)\n body[:all] = options[:all] if options[:all] # By default we return an array of TX IDs where you are the seller for use with get_tx_info_multi or get_tx_info. If all is set to 1 returns an array with TX IDs and whether you are the seller or buyer for the transaction.\n post body\n end",
"title": ""
},
{
"docid": "8580284b1391e5fe6a5328424be6b49d",
"score": "0.5419123",
"text": "def transactions\n JSON.parse(response.body).fetch('transactions')\n end",
"title": ""
},
{
"docid": "1fef514105cf08c53e68ad23a4a75e09",
"score": "0.54071295",
"text": "def transactions(options = {})\n @gateway.customer.transactions(id, options)\n end",
"title": ""
},
{
"docid": "422ab14864897268df37863b440f70bb",
"score": "0.5337983",
"text": "def transactions\n JSON.parse(call_blockchain_api(\"transactions\"))\n end",
"title": ""
},
{
"docid": "194603914e9d693bbacacaa8f88a5514",
"score": "0.5268691",
"text": "def index\n @transactions = @transactions.paginate(:page => params[:page], :per_page => 10)\n end",
"title": ""
},
{
"docid": "c27e01f1f53044863c79830c2c92f39e",
"score": "0.52255845",
"text": "def list_transactions(location_id, opts = {})\n data, _status_code, _headers = list_transactions_with_http_info(location_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "55d4896f4a2a8316a0fc20d4060fb586",
"score": "0.5214972",
"text": "def get_transactions(opts = {})\n data, _status_code, _headers = get_transactions_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "f9239911f0750fa94af4e4d378124ac5",
"score": "0.52044207",
"text": "def find(id)\n response = JSON.parse(@client.get(\"transactions/#{id}\").body)\n Promisepay::Transaction.new(@client, response['transactions'])\n end",
"title": ""
},
{
"docid": "702ed58ad1adf6208a5d416f096f0bd6",
"score": "0.51996994",
"text": "def transactions\n @transactions ||= ArkEcosystem::Client::API::Transactions.new(@client) # rubocop:disable Metrics/LineLength\n end",
"title": ""
},
{
"docid": "ba3ad15bd8b6cd9762803d03a2b2dec7",
"score": "0.51985645",
"text": "def transactions(count = 10)\n @client.transactions(name, count)\n end",
"title": ""
},
{
"docid": "c6728f5060a71abd0feac45161161881",
"score": "0.51720667",
"text": "def getTransaction( transaction_id)\n params = Hash.new\n params['transaction_id'] = transaction_id\n return doCurl(\"get\",\"/transaction\",params)\n end",
"title": ""
},
{
"docid": "5ce561dd761b3b93810cd6ab4d6b4c26",
"score": "0.51718915",
"text": "def get_transcriptions()\n @client.make_request(:get, @client.concat_user_path(\"#{RECORDING_PATH}/#{id}/transcriptions\"))[0]\n end",
"title": ""
},
{
"docid": "c7bb165a5befbf710f557efc877d4216",
"score": "0.5151815",
"text": "def index\n @transactions = current_user.transactions\n end",
"title": ""
},
{
"docid": "7da1f81fee7eddce0462c9fa40ef411d",
"score": "0.5139107",
"text": "def transcriptions(id, optional_params = {})\n response = Network.get(['Recordings', id, 'Transcriptions'], optional_params)\n ResourceCollection.new(response, 'transcriptions', Transcription)\n end",
"title": ""
},
{
"docid": "b9e9396903fdb4effdb61a1e862dfcad",
"score": "0.51305354",
"text": "def get_transactions(opts = {})\n data, _status_code, _headers = get_transactions_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "28fe9714a695dd028d4ac0a898af15bf",
"score": "0.513021",
"text": "def get_transactions\n @transactions\n end",
"title": ""
},
{
"docid": "629f921194bc9dcb1da39864216c6d8f",
"score": "0.5128292",
"text": "def transactions(customer_id, status=\"NotSettled\")\n unless Transaction::STATUSES.include?(status)\n raise ArgumentError, \"Invalid status: #{status}\"\n end\n\n resp = get(\"/customer/#{customer_id}/Transactions/#{status}\")\n resp[\"Transactions\"].map { |t| Transaction.new(t) }\n end",
"title": ""
},
{
"docid": "ac172b2595ad9f55780d80152e608371",
"score": "0.5119187",
"text": "def index\n @q = ItemPurchaseLog.ransack(params[:q])\n @item_purchase_logs = @q.result.page(params[:page])\n end",
"title": ""
},
{
"docid": "d1806a800cbb5180c1bf4041f8a18f48",
"score": "0.509412",
"text": "def all_transactions\n json_response(Transaction.all)\n end",
"title": ""
},
{
"docid": "a673078bf4dff286861c8dfbddd85e12",
"score": "0.50913644",
"text": "def get_transaction(tx_id:)\n client.make_request('/get-transaction', 'post', params: {tx_id: tx_id})\n end",
"title": ""
},
{
"docid": "42dfab2f0a5c6884e9b933b7b07ca6be",
"score": "0.50886565",
"text": "def index\n @m_transactions = MTransaction.all\n end",
"title": ""
},
{
"docid": "d60684cea238885d1541dee2d6938856",
"score": "0.50885534",
"text": "def wallet_transactions_listing(wallet_id, type)\n add_timestamp\n add_salt\n headers = { 'content-type' => 'application/json',\n 'signature' => signature('', 'get', \"/v1/user/#{wallet_id}/transactions?type=#{type}\"), 'salt' => salt, 'timestamp' => timestamp, 'access_key' => access_key }\n response, msg = rest_client.getCall(\"/v1/user/#{wallet_id}/transactions?type=#{type}\", headers)\n JSON.parse(response)['data'] if response.present?\n rescue StandardError => e\n Rails.logger.error e\n nil\n end",
"title": ""
},
{
"docid": "4f493e608ea8c4ab17a776369eb53899",
"score": "0.5086441",
"text": "def index\n @transactions = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "0af44930b56757f1dc0bef773e5d4557",
"score": "0.50746894",
"text": "def index\n @transactions = Transaction.all\n end",
"title": ""
},
{
"docid": "6b6dd7fc49242f1c550085a436009851",
"score": "0.5073326",
"text": "def index\n @account_transactions = AccountTransaction.paginate(page: params[:page], per_page: 30)\n end",
"title": ""
},
{
"docid": "8338a47b457eeea0c9b99711c102c911",
"score": "0.50723684",
"text": "def transactions_get(opts = {})\n data, _status_code, _headers = transactions_get_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "bf830d5105b98be62e62b20f21879dd6",
"score": "0.50699604",
"text": "def index\n @help = \"Transaction List\"\n @transactions = @account.transactions.find(:all, :order => \"tran_date desc, created_at desc\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transactions }\n end\n end",
"title": ""
},
{
"docid": "14128b3beefceda712c923d7ea00d1db",
"score": "0.505927",
"text": "def get_transactions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PaymentsTransactionsApi.get_transactions ...\"\n end\n # resource path\n local_var_path = \"/transactions\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_invoice'] = opts[:'filter_invoice'] if !opts[:'filter_invoice'].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 => 'PageResourceTransactionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentsTransactionsApi#get_transactions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "62fa0efcc2c0fee8e3ab77bc075dbb82",
"score": "0.5037076",
"text": "def index\n @trade_items = TradeItem.all\n end",
"title": ""
},
{
"docid": "98ce3a445d70141917d828be66864ab3",
"score": "0.50192845",
"text": "def items\n response = @client.request :get, \"#{LISTS_PATH}/#{@id}\"\n raise(StandardError, 'unexpected response') unless response\n response['items']&.map { |i| TodoableItem.new self, i, @client }\n end",
"title": ""
},
{
"docid": "cb455e452abd403fde22387ea64540e9",
"score": "0.5010226",
"text": "def index\n @transactions = current_user.wallet.transactions\n\n end",
"title": ""
},
{
"docid": "466d26cc04738d476b11e3faa8227471",
"score": "0.5005625",
"text": "def get_transaction(id)\n submit GetTransaction.new(:transaction_id => id)\n end",
"title": ""
},
{
"docid": "8c0904ea7e1a3ee09b0e005714f383e7",
"score": "0.49869525",
"text": "def transactions(account_name=nil, count=10)\n transaction_data = request('listtransactions', account_name, count)\n transaction_data.map do |txdata|\n Transaction.new(self, txdata['txid'], txdata)\n end\n end",
"title": ""
},
{
"docid": "3984654237246b1c61e96eaee65a0fa2",
"score": "0.49793172",
"text": "def index\n @items = Item.all.order(:id)\n end",
"title": ""
},
{
"docid": "ca1691652e1a6b97567a593b952423e5",
"score": "0.49683875",
"text": "def index\n @transactions = Transaction.all \n end",
"title": ""
},
{
"docid": "53f3f7cba0450c62d547062db1fd3a2b",
"score": "0.49619997",
"text": "def index\n @clienttransactions = current_user.clienttransactions.order(\"id DESC\")\n end",
"title": ""
},
{
"docid": "0dcf14c0f13719ee6edb914dd3a6330b",
"score": "0.49576783",
"text": "def getTransactions\n\t\t\n\tend",
"title": ""
},
{
"docid": "613747a87e8b06b0308159c453828491",
"score": "0.4956637",
"text": "def get_items\n response_xml = http_get(@client, \"#{xero_url}/Items\")\n parse_response(response_xml, {}, {:request_signature => 'GET/items'})\n end",
"title": ""
},
{
"docid": "9c0635f1ce938ecafb02b7b675548cb7",
"score": "0.49532643",
"text": "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter)\n\t\t\tclient.add_param(kparams, 'pager', pager)\n\t\t\tclient.queue_service_action_call('transactionhistory', 'list', 'KalturaBillingTransactionListResponse', 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": ""
},
{
"docid": "dd6741ff4090f8798577fd4f5a9edbd5",
"score": "0.49522915",
"text": "def index\n @task_items = Task::Item.all\n end",
"title": ""
},
{
"docid": "fd77792cd16f4fce80d291a90003ce92",
"score": "0.4949601",
"text": "def get_transaction(id, opts = {})\n data, _status_code, _headers = get_transaction_with_http_info(id, opts)\n return data\n end",
"title": ""
},
{
"docid": "454003bfe8150f01ea4084857dfc4919",
"score": "0.49477038",
"text": "def get_transaction(account_id, transaction_id)\n query_api_object Transaction, \"/rest/accounts/#{account_id}/transactions/#{transaction_id}\"\n end",
"title": ""
},
{
"docid": "23691c38257ec245559e159e6219e614",
"score": "0.49409685",
"text": "def show\n @item_transaction = ItemTransaction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_transaction }\n end\n end",
"title": ""
},
{
"docid": "e5661789f45e50460fef0cd9800bc77c",
"score": "0.4935287",
"text": "def my_transactions\n @transactions = Transaction.find_all_by_user_id(current_user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transactions }\n end\n end",
"title": ""
},
{
"docid": "d91836da96c7e09578bf3911d8bef862",
"score": "0.4928878",
"text": "def index\n @trans = Tran.all\n end",
"title": ""
},
{
"docid": "974a1ba15eafd40e6de7a10ce3157467",
"score": "0.49286902",
"text": "def index\n @transactions = current_user.transactions.order(date: :desc).limit(100)\n end",
"title": ""
},
{
"docid": "a1b54046276d33606c9be7d9003b7533",
"score": "0.49185303",
"text": "def items\n @items = current_user.items.paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "cb7affe7937529d2f8e431d24d375581",
"score": "0.49162695",
"text": "def get_transactions_list(targacct, action_set, page, per_page)\n # Set up the :conditons query \n query = \"target_account_id = ?\"\n args = [targacct]\n # If we have and action set add the actions.\n if (!action_set.nil? && !action_set.empty?)\n as = AcctActionSet.find(action_set)\n if as\n\tactions = as.actions\n\tquery << \" AND (acct_action_id = ? \"\n\targs << actions.first\n\tactions.shift\n\tfor act in actions\n\t query << \"OR acct_action_id = ? \"\n\t args << act\n\tend\n query << \")\"\n end\n end\n conditions = [query] + args\n p conditions\n AcctTransaction.paginate(\n :page => page,\n :per_page => per_page,\n :conditions => conditions,\n :order => \"date DESC, id DESC\")\n end",
"title": ""
},
{
"docid": "ea2190cc8ddbd51ae303ed053b8cba5e",
"score": "0.4911982",
"text": "def fetch_wallets_transactions(filters = {})\n MangoPay.request(:get, url() + \"/transactions\", {}, filters)\n end",
"title": ""
},
{
"docid": "95bc9701002164d39ff32249eeb8a3e0",
"score": "0.49109527",
"text": "def transactions(account_id = nil, since = nil, count = 1000, offset = 0, include_pending = false)\n data = {\"count\" => count.to_s, \"offset\" => offset.to_s, \"include_pending\" => include_pending ? \"1\" : \"0\"}\n data[\"since\"] = ((since.is_a?(Date) ? since.to_s : since) unless since.nil?)\n\n query_api_object Transaction, (account_id.nil? ? \"/rest/transactions?\" : \"/rest/accounts/#{account_id}/transactions?\") + URI.encode_www_form(data), nil, \"GET\", \"transactions\"\n end",
"title": ""
},
{
"docid": "f21f3ab87dd96cd27cb8d2092f271ff9",
"score": "0.4905748",
"text": "def index\n @contratos_items = ContratosItem.all\n end",
"title": ""
},
{
"docid": "9666c883faaa885725bf071174107122",
"score": "0.49045444",
"text": "def show_transactions\n @product = Product.find(params[:id])\n @transaction_details = @product.transaction_details.order(created_at: :desc).page(params[:page])\n end",
"title": ""
},
{
"docid": "ff5647f3f6f2d235c1de970edf537848",
"score": "0.4893998",
"text": "def index\n @transactions = Transaction.all \n end",
"title": ""
},
{
"docid": "224a13d56d7c4deae2fdf5bd816f3abc",
"score": "0.48910895",
"text": "def get_transactions(service)\n\t\treturn @transport.get_path(\"transactions\",service)\n\tend",
"title": ""
},
{
"docid": "4717a4a2449319ac92a3409d95f55861",
"score": "0.48878175",
"text": "def index\n @items = Item.all\n\n if params[:search]\n @items = Item.search(params[:search]).order(\"created_at DESC\")\n else\n @items = Item.all.order(\"created_at DESC\")\n end\n\n session[:conversations] ||= []\n\n @users = User.all.where.not(id: current_user)\n @conversations = Conversation.includes(:recipient, :messages)\n .find(session[:conversations])\n end",
"title": ""
},
{
"docid": "7653bcbc21813b850d32a5f049b9a73c",
"score": "0.48836145",
"text": "def getTransactionBy_paypal_transaction_id( paypal_transaction_id)\n params = Hash.new\n params['paypal_transaction_id'] = paypal_transaction_id\n return doCurl(\"get\",\"/transaction/by_paypal_transaction_id\",params)\n end",
"title": ""
},
{
"docid": "ab65adf0d2ece3b6f0c2ed0055a8621d",
"score": "0.487956",
"text": "def show\n @transactions = Transaction.where(user_id: params[:id])\n render json: @transactions\n end",
"title": ""
},
{
"docid": "fd2deac9adc67fb23b1d2594ee3b8061",
"score": "0.48753154",
"text": "def index\n @transactions = @account.transactions\n paginate @transactions.count, 20 do |limit, offset|\n render json: @transactions.limit(limit).offset(offset)\n end\n\n # render json: @transactions\n end",
"title": ""
},
{
"docid": "f991830c7543c5da9f1e5fa8a7ffbaaa",
"score": "0.48736742",
"text": "def index\n @transaction_group_items = @transgroup.transaction_group_items.find(:all, :order => \"order_number ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transaction_group_items }\n end\n end",
"title": ""
},
{
"docid": "082be4d689aabe4f498cb2edc7943434",
"score": "0.48676345",
"text": "def transaction\n add_breadcrumb \"Merchants\", epsadmin_merchants_path\n add_breadcrumb \"#{@transc_merchant.first_name}\", epsadmin_merchant_path(@transc_merchant.merchant_uniq_id)\n @epsadmin_transaction_list = @transc_merchant.transactions.order(\"created_at DESC\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @epsadmin_transaction_list }\n end\n end",
"title": ""
},
{
"docid": "a0a3d27aa1936f5187423661bf9ea8bb",
"score": "0.48648605",
"text": "def internal_transactions(address, args = {})\n action = 'txlistinternal'\n transcations(action, address, nil, args)\n end",
"title": ""
},
{
"docid": "bb5193c07f5c7e24b043c98e0ebcd7d8",
"score": "0.48636",
"text": "def index\n @txes = Tx.all\n end",
"title": ""
},
{
"docid": "d7ec393a9562845e2dec724815ab7bf8",
"score": "0.48620707",
"text": "def transactions(number = nil)\n sql = \"SELECT * FROM transactions WHERE transactions.tag_id = $1 ORDER BY transaction_date DESC LIMIT $2\"\n values = [@id, number]\n transactions = SqlRunner.run(sql, values)\n return transactions.map { |transaction| Transaction.new(transaction) }\n end",
"title": ""
},
{
"docid": "c7c52dfc0a684a328cf07e30e835eb4a",
"score": "0.48570395",
"text": "def index\n @transactions = Transaction.find_all_by_user_id(current_user.id)\n if not @transactions\n flash.now[:error] = \"No transactions found for this user!\"\n end\n end",
"title": ""
},
{
"docid": "007f74dcc8d63013696f751ff6889685",
"score": "0.48505312",
"text": "def index\n @w_transactions = WTransaction.all\n end",
"title": ""
},
{
"docid": "e48191e5980dbce96b37b2c0a0d95c0c",
"score": "0.48442304",
"text": "def transactions(since = nil, start_id = nil, count = 1000, include_pending = false)\n data = {}\n data[\"since\"] = (since.is_a?(Date) ? since.to_s : since) unless since.nil?\n data[\"start_id\"] = start_id unless start_id.nil?\n data[\"count\"] = count.to_s\n data[\"include_pending\"] = include_pending ? \"1\" : \"0\"\n response = query_api(\"/rest/transactions?\" + URI.encode_www_form(data)) \n return response[\"transactions\"].map {|transaction| Transaction.new(self, transaction)}\n end",
"title": ""
},
{
"docid": "412996bf7c3a83868deb51288fc96dad",
"score": "0.48436898",
"text": "def index \n \t@items = Item.paginate(page: params[:page])\n\n @user_items = current_user.user_items.pluck(:id).uniq\n @all_user_items = UserItem.where(id: @user_items)\n end",
"title": ""
},
{
"docid": "c0e47bb5a0e88de8455059339c10dce4",
"score": "0.48404077",
"text": "def index\n if current_user.is_admin?\n @transactions = Transaction.order('created_at DESC')\n else\n @transactions = current_user.transactions.order('created_at DESC')\n end\n @transactions = @transactions.page(params[:page])\n end",
"title": ""
},
{
"docid": "a89a2b486067bde45c867f15625f96e8",
"score": "0.48403087",
"text": "def index\n @bitcoin_transactions = BitcoinTransaction.all\n end",
"title": ""
}
] |
74ccda4c7cd318c1c34cc7fef221053e
|
send notification in english to this address
|
[
{
"docid": "4cda09ba1622de1c607882c13324120b",
"score": "0.7066022",
"text": "def notify_english(dest)\n mail(dest, ENGLISH_SUBJECT, mail_content(english_model_file))\n end",
"title": ""
}
] |
[
{
"docid": "ab1e2376238e8fe7d048c1aa2f3df4f2",
"score": "0.64111954",
"text": "def notify_french(dest)\n mail(dest, FRENCH_SUBJECT, mail_content(french_model_file))\n end",
"title": ""
},
{
"docid": "bcafb994c1c51ad063607afeb76708f0",
"score": "0.6263988",
"text": "def tender_updated\n @greeting = \"Χαίρετε\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "1b6f0c68011653ca82e3f09a32f9f94b",
"score": "0.62529945",
"text": "def admin_broadcast(desired_locale, emails_as_string, subject, body)\n ActionMailer::Base.smtp_settings = APP_CONFIG[:admin_mail]\n set_locale( desired_locale )\n\n @content_type = \"text/html\"\n @recipients = \"[email protected]\"\n @bcc = emails_as_string\n @from = head_encode(\"\\\"Kroogi (No Reply)\\\"\".t) + \" <[email protected]>\"\n @subject = head_encode(\"[Kroogi] \" + subject)\n @sent_on = Time.now\n @body[:url] = \"http://#{APP_CONFIG[:hostname]}/\"\n @body[:body] = body\n end",
"title": ""
},
{
"docid": "0a6befef99c6612fb6c89deae540ecfe",
"score": "0.62239",
"text": "def send_notification\n\n\n end",
"title": ""
},
{
"docid": "79aa0180cf14181ea53ae52b16bddadb",
"score": "0.6223147",
"text": "def notify_shipped(order)\n @order = order\n @info = @order.info\n email = @order.user.email\n subject = \"特快車出貨通知! (訂單編號:#{@order.token})\"\n\n mail(to: email, subject: subject) do |format|\n format.text\n format.html\n end\n end",
"title": ""
},
{
"docid": "386f0d2a964b43eee18fd2caeb43978a",
"score": "0.62105626",
"text": "def notify_mail\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\", subject: \"[Localgarage]Printer_URL\"\n end",
"title": ""
},
{
"docid": "b93a8b3c043f02d008a43d6fd903c19b",
"score": "0.6192396",
"text": "def notification\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "b5fc82c5230385637928353e7881852b",
"score": "0.61874944",
"text": "def send_text_message(note)\n @greeting = note.message + \" (\" + note.created_at.in_time_zone(\"Eastern Time (US & Canada)\").strftime('%m/%d/%Y') + \")\"\n\n mail to: '[email protected], [email protected], [email protected], [email protected]', subject: 'Love Note'\n end",
"title": ""
},
{
"docid": "3ae3a140c7be4d73bd08b31a4b028c89",
"score": "0.61850315",
"text": "def follow_notification\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "fee2e704041b325b1593133161b6a2da",
"score": "0.6183237",
"text": "def new_letter_notification(message)\n sender = User.find message.user_id\n reciever = User.find message.reciever\n setup_email(reciever)\n @subject += \"Вам пришло личное сообщение от #{sender.full_name}\"\n body[:sender] = sender\n body[:message] = message\n body[:url] = RAILS_URL + \"messages/view/#{message.id}\"\n end",
"title": ""
},
{
"docid": "7c5b4cbef5cdab22ea805a969f759e3a",
"score": "0.613429",
"text": "def notification(params)\n mail(params)\n end",
"title": ""
},
{
"docid": "a2bbe64eb14ea50362c4f95cc44e0f84",
"score": "0.6119588",
"text": "def send_message(short_msg, long_msg, notification_type_name, sanitize_text = true, data = '', push_data = '')\n message = Alerter::MessageBuilder.new({\n recipients: self,\n short_msg: short_msg,\n long_msg: long_msg,\n data: data,\n push_data: push_data.to_s,\n notification_type: NotificationType.find_or_create_by(name: notification_type_name),\n }).build\n message.save!\n message.deliver sanitize_text\n end",
"title": ""
},
{
"docid": "4976be44608d3d64e8ccc68f45a9dd4a",
"score": "0.6111077",
"text": "def notify from, to, message, data = nil\n string = \"Alert: #{@@alert_name}\n\n[ #{from} ] => [ #{to} ]\n \n#{message}\n \n \"\n string += \"\n \n Data: \n #{data}\n \" if data\n print string\n self.send_slack(string)\n self.send_telegram(string)\n end",
"title": ""
},
{
"docid": "30d1d3d806f3888c45286be658d19038",
"score": "0.6101984",
"text": "def notify\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "a02fbf56549d15fb47c1ac8d02c1ae7f",
"score": "0.6058111",
"text": "def message\n \"You have a new notification!\"\n end",
"title": ""
},
{
"docid": "cdbb47e4cac42a017c61849f23941fe6",
"score": "0.6035919",
"text": "def send_devise_notification(notification, *args)\n I18n.with_locale(locale) { super notification, *args }\n end",
"title": ""
},
{
"docid": "94e8b2c0b8d218fa1149c936c9f60a20",
"score": "0.6025501",
"text": "def send_message(email, text)\n @notification_server.send_message email, text\n end",
"title": ""
},
{
"docid": "834c152e70a96b01cfca8e3c68829966",
"score": "0.6006228",
"text": "def sms_notify(username, source_system, message)\r\n sender = SmsGlobal::Sender.new :user => CONFIG[:sms_global_settings][:user_name].to_s, :password => CONFIG[:sms_global_settings][:password].to_s\r\n\r\n sender.send_text message, username, source_system\r\n Rails.logger.info \"#{Time.now.utc} - sms_notify - #{username} - #{source_system} - #{message}\"\r\n end",
"title": ""
},
{
"docid": "fcf147f6fd3fe1f65aac7a31357ead87",
"score": "0.5996783",
"text": "def broadcast_messages\n @info = ['Gol', 'Zmiana','Żółta Kartka','Druga Żółta Kartka','Czerwona Kartka',]\n end",
"title": ""
},
{
"docid": "e8ed99be50f569bb9c592f286f0982cf",
"score": "0.5979157",
"text": "def growl_notify\n\t\t\toptions = { :title => @application,\n\t\t\t\t\t\t\t\t\t:description => @message.gsub(/[\\n]+/, \"\"),\n\t\t\t\t\t\t\t\t\t:application_name => @application,\n\t\t\t\t\t\t\t\t\t:image_from_location => @icon,\n\t\t\t\t\t\t\t\t\t:sticky => false,\n\t\t\t\t\t\t\t\t\t:priority => 0,\n\t\t\t\t\t\t\t\t\t:with_name => notifications.first }\n @growl.notify options\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "b676d5d82b81d782c1848bd013907b3b",
"score": "0.5969079",
"text": "def new_notification\n mail(to: \"[email protected]\", subject: 'New Notification', sent_on: Time.now)\n end",
"title": ""
},
{
"docid": "a7f4f84897a8d82e6a5f8e224babc4ec",
"score": "0.5960152",
"text": "def send_notification(user, questionnaire)\n I18n.default_locale = I18n.locale = questionnaire.language.locale\n headers = {\n :from => 'Bnei Baruch <[email protected]>',\n :subject => I18n.t('notification.mailer.new_questionnaire_for_you'),\n :to => user.email,\n :date => Time.now.to_formatted_s(:rfc822)\n }\n @user = user\n @questionnaire = questionnaire\n mail(headers)\n end",
"title": ""
},
{
"docid": "d01df2f16db1c33a10f1f4dfc3bb158c",
"score": "0.5959944",
"text": "def send_questionnaire_notification(user, questionnaire)\n @locale = questionnaire.language.locale\n headers = {\n :from => 'Bnei Baruch <[email protected]>',\n :subject => I18n.t('notification.mailer.new_questionnaire_for_you', :locale => @locale),\n :to => user.email,\n :date => Time.now.to_formatted_s(:rfc822)\n }\n @user = user\n @questionnaire = questionnaire\n mail(headers) do |format|\n format.text\n format.html\n end\n end",
"title": ""
},
{
"docid": "1e2448ec9b61c6c11b6211deb20cf260",
"score": "0.59561974",
"text": "def send_notification(msg)\n $BLIX_NOTIFY.push(msg)\n puts \"[DummyServer] notify: message=#{msg}\" if $DEBUG\n end",
"title": ""
},
{
"docid": "da97c872aefc367fb1ca76a92b9f387a",
"score": "0.5953028",
"text": "def notify_manager(request)\n @greeting = \"Hi\"\n\n mail :to => \"[email protected]\"\n end",
"title": ""
},
{
"docid": "0ea9987375feddd6ce6a1531c3061f1c",
"score": "0.59427565",
"text": "def notification(to,f)\n send_as :notification\n recipients to\n from f\n fbml \"Not\"\n end",
"title": ""
},
{
"docid": "35fdcaf3697f73507f35ef851f1b6573",
"score": "0.59267825",
"text": "def notify_subscriber\n @greeting = \"Hi\"\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "1c609baa329ea3db20761031a5cdf673",
"score": "0.5926193",
"text": "def notice(notification)\n @notification = notification\n\n mail to: @notification.user_email, :subject => \"Cipher-tech wants you to know: #{@notification.notifier_type} #{@notification.message}\"\n end",
"title": ""
},
{
"docid": "5b26cce0d5a003b34ea7826a5fd17159",
"score": "0.5917677",
"text": "def send_questionnaire_notification(user, questionnaire)\n @locale = questionnaire.language.locale\n headers = {\n :from => 'Bnei Baruch <[email protected]>',\n :subject => I18n.t('notification.mailer.new_questionnaire_for_you', :locale => @locale),\n :to => user.email,\n :date => Time.now.to_formatted_s(:rfc822)\n }\n @user = user\n @questionnaire = questionnaire\n mail(headers) do |format|\n format.text\n format.html\n end\n end",
"title": ""
},
{
"docid": "7a0dbc2d645f78f6c985abc09f95aaec",
"score": "0.5905038",
"text": "def notify(internet_up)\n time = Time.now\n if internet_up\n %x( growlnotify -m \"The internet is up!\")\n puts \"Internet is UP\".green + \" @ #{time.strftime(\"%I:%M:%S %p\")}\"\n puts \"Text sent!\".blue if @mail.deliver\n else\n %x( growlnotify -m \"Internet is DOWN\" )\n puts \"Internet is DOWN\".red + \" @ #{time.strftime(\"%I:%M:%S %p\")}\"\n end\nend",
"title": ""
},
{
"docid": "606638e8e1bcc576e39f444f9b50dcdf",
"score": "0.58893347",
"text": "def new_notification(name,email,mobile,description)\n @name = name\n @email = email\n @mobile = mobile\n @description = description\n mail to: \"[email protected], [email protected] \", subject: \"Query From Super White Marble\"\n end",
"title": ""
},
{
"docid": "621ca1c27a66e324d5844aa0781e2a81",
"score": "0.5884609",
"text": "def new_place_notification (merchant)\n @merchant = merchant\n mail to: \"[email protected]\", subject: \"A Place Has Been Listed\"\n end",
"title": ""
},
{
"docid": "110e60ade6f207b3c336e26c3aa93ef3",
"score": "0.5882146",
"text": "def content(address, name)\n @greeting = \"Hi! #{name}\"\n\n mail to: address, subject: '謝謝你報名參加TKU Hackathon,提醒您活動時間是2014/3/29'\n end",
"title": ""
},
{
"docid": "19fa9ef4acf4ca1c81d0c805ae2b1d66",
"score": "0.58675545",
"text": "def sent(order)\n @order = order\n mail :to => \"[email protected]\", :subject => \"注文を受けました\"\n end",
"title": ""
},
{
"docid": "a4fc8b882036d03dbed88a3afaadbadf",
"score": "0.58605725",
"text": "def sendmail_confirm\n @greeting = \"元気ー?\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "f7e09d46c93667db6dcfcada44c6a5e3",
"score": "0.5845681",
"text": "def admin_order_inform\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "432e0de7f1895a2325059f7f370f7fee",
"score": "0.5845224",
"text": "def say_hi(medium)\n @medium = medium\n\n mail(to: '[email protected]' , subject: \"视频#{@medium.subject}更新通知\")\n mail(to: '[email protected]' , subject: \"视频#{@medium.subject}更新通知\")\n mail(to: '[email protected]' , subject: \"视频#{@medium.subject}更新通知\")\n mail(to: '[email protected]' , subject: \"视频#{@medium.subject}更新通知\").deliver\n end",
"title": ""
},
{
"docid": "ad256e133ec226778a0f55932ec6570d",
"score": "0.5828579",
"text": "def received(vin_cod)\n @vin_cod = vin_cod\n\n mail to: \"[email protected]\", subject: 'Запрос по vin коду на Falcon motors'\n end",
"title": ""
},
{
"docid": "84daa29168e8b9526810e95c2a48dbd0",
"score": "0.581395",
"text": "def email_welcome_and_pass\r\nold_gt = I18n.locale\r\nI18n.locale = self.language unless self.language.blank?\r\nUserMailer.deliver_account_infos(self, @password) # Uniq time with decoded password\r\nI18n.locale = old_gt\r\nend",
"title": ""
},
{
"docid": "67ca52c6921b3e4d9671c233b8ea5840",
"score": "0.5808179",
"text": "def host_thank_you\n mail to: @show.host_em, subject: \"Thank you\"\n end",
"title": ""
},
{
"docid": "e1fed03d663cd09e321fd16d4f8db9ca",
"score": "0.58027095",
"text": "def send_message(text)\n end",
"title": ""
},
{
"docid": "81a0c6371865d4ffee2e8dcb59f2b451",
"score": "0.5796669",
"text": "def send_ta_notification(user, msg)\n\t\t@user = user\n\t\t@msg = msg\n\t\tmail( :to => @user.email, :subject => 'You have just been assigned to a course!')\n\tend",
"title": ""
},
{
"docid": "a187be1dacdb982941dc995be2833f5d",
"score": "0.5767238",
"text": "def tutor_reserved_notification\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "bb30ba600b06d97dc1f66181ede8e8dc",
"score": "0.57629824",
"text": "def send_a_mail(name, title, body)\n @name = name\n @body = body\n @title = title\n\n #mail to: \"[email protected]\"\n mail subject: \"Сообщение от сайта Никиты с темой #{@title}\"\n end",
"title": ""
},
{
"docid": "61d6675f4d061c6d1105ead4610b3024",
"score": "0.5762126",
"text": "def send_messages(event)\n begin\n scheme = request.scheme\n host = request.host\n rescue NameError\n scheme = 'http'\n host = 'testing'\n end\n message = <<EOL\nPlease attend this blood drive event and help save lives.\n#{scheme}://#{host}/events/#{event.id}\nEOL\n Donor.where(zipcode: event.zipcode).map(&:phone).each do |ph|\n @client.messages.create(:from => twilio_number, :to => ph , :body =>message)\n end\n end",
"title": ""
},
{
"docid": "6d7b29aaec67e52361416fc121f19fc9",
"score": "0.5752702",
"text": "def show_notfication\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end",
"title": ""
},
{
"docid": "4330d52fd43f0221340e3ffc41833e0f",
"score": "0.5742379",
"text": "def send_sms\n status = self.status\n if status.upcase == 'INTERVENTION'\n self.message\n end\n end",
"title": ""
},
{
"docid": "fa8992b928df322900f4a682cd1e4d17",
"score": "0.5741032",
"text": "def notify(params)\n @body = params[\"/contact\"][:message]\n @from = params[\"/contact\"][:email]\n @phone = params[\"/contact\"][:phone]\n @name = params[\"/contact\"][:name]\n mail to: \"[email protected]\", subject: 'Mail from website', from: \"#{@from}\"\n end",
"title": ""
},
{
"docid": "aec0cecff19bfef3b06b9b55fb988125",
"score": "0.5729917",
"text": "def notification_for(product)\n \t@product = product \n mail(:to => @product.user.email, :subject => \"Perishab.ly alert regarding your #{@product.name}\")\n end",
"title": ""
},
{
"docid": "a49a9fe1e28f456568bb673c35f96492",
"score": "0.57005334",
"text": "def send_email(message)\n @message = message\n mail to: \"[email protected], [email protected]\", subject: \"Request from website\"\n end",
"title": ""
},
{
"docid": "9d63756eeb3d6491a45f218160e7841d",
"score": "0.570007",
"text": "def nmwp_notify(api_key, source_system, message)\r\n uri = URI.parse('https://notifymywindowsphone.com/publicapi/notify/')\r\n http = Net::HTTP.new(uri.host, uri.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n params = {'apikey' => api_key, 'application' => \"Ventyx\", 'event' => source_system, 'description' => message}\r\n\r\n request = Net::HTTP::Post.new(uri.request_uri)\r\n request.set_form_data(params)\r\n response = http.request(request)\r\n\r\n Rails.logger.info \"#{Time.now.utc} - nmwp_notify - #{api_key} - #{source_system} - #{message}\"\r\n end",
"title": ""
},
{
"docid": "db8a99212cf0bc070b5d580de8ad5d67",
"score": "0.56965935",
"text": "def send_notifications\n return if participant.nil?\n return unless participant.phone_number.length == 10\n\n # grab first 95 characters of description to serve as a preview\n description_preview = description[0...95]\n send_sms(participant.phone_number,\n \"An event in Binder has been assigned to you: #{description_preview}...\")\n end",
"title": ""
},
{
"docid": "1c9bd6e80d3fd2978c2599ee99fd63be",
"score": "0.56811464",
"text": "def send_notifications\n end",
"title": ""
},
{
"docid": "74dfe061fb5995eee40b796140b6c3bd",
"score": "0.5680871",
"text": "def notify_host\n OrganisationMailer.notify_host\n end",
"title": ""
},
{
"docid": "de533fb0a8e9d8c85e333f8cfb40903b",
"score": "0.5666342",
"text": "def send_text_message(client:, user:, body:, tax_return: nil, locale: nil, to: nil)\n intake = Hub::ClientsController::HubClientPresenter.new(client).intake\n return unless intake.sms_notification_opt_in_yes?\n\n if intake.sms_notification_opt_in_yes? && !intake.sms_phone_number.present?\n DatadogApi.increment('clients.missing_sms_phone_number_for_sms_opt_in')\n return\n end\n\n replacement_args = { body: body, client: client, preparer: user, tax_return: tax_return, locale: locale }\n replaced_body = ReplacementParametersService.new(**replacement_args).process\n client.outgoing_text_messages.create!(\n to_phone_number: to || intake.sms_phone_number,\n sent_at: DateTime.now,\n user: user,\n body: replaced_body,\n )\n end",
"title": ""
},
{
"docid": "c161458435b2b0ba4886a857483a45f9",
"score": "0.5660884",
"text": "def email_sent(to)\n puts green(\"Notification sent to: #{to}\")\n end",
"title": ""
},
{
"docid": "09c25e2106b5c54c3a881df31ee7f215",
"score": "0.5653075",
"text": "def notify(bodystr, subject=nil, *to_addrs)\n from = '\"VAUtil\" <vautil@' + `/bin/hostname`.chomp + '>'\n to = to_addrs.map { |a| '<' + a + '>' }.join(', ')\n message = <<HERE\nFrom: #{from}\nTo: #{to}\nSubject: #{subject.nil? ? \"VAUtil Notification\" : subject }\nDate: #{Time.now}\nMessage-Id: <#{(0...20).map{ (('0'..'9').to_a + ('a'..'z').to_a).to_a[rand(36)] }.join}@coredial.com>\n\n#{bodystr}\nHERE\n Net::SMTP.start(VAUtil.config['mail_host'], 25, 'coredial.com') do |smtp|\n smtp.send_message(message, from, to_addrs)\n end\n end",
"title": ""
},
{
"docid": "217c354bb30d8d4f338a63b689d74b45",
"score": "0.56525224",
"text": "def notification(inquiry)\n @inquiry = inquiry\n\n mail :to => @inquiry.email, :subject => \"New Inquiry\"\n end",
"title": ""
},
{
"docid": "795c11a179a22b3ebcedc357c74ed7cd",
"score": "0.56485987",
"text": "def notify(msg, subject)\n end",
"title": ""
},
{
"docid": "463f835e10b102f20027dc37b4c2b042",
"score": "0.56468016",
"text": "def signup_notification(user)\n setup_email(user)\n @subject += I18n.t 'mailer.signup.subject'\n \n @body[:url] = \"http://www.dripplet.com/#{user.locale}/activate/#{user.activation_code}\"\n \n end",
"title": ""
},
{
"docid": "fccb79de1dd84e4734b24142605097c4",
"score": "0.56449336",
"text": "def send_confirmation_sms\n SmsApi.send_sms \"+1#{self.phone}\", \"Your confirmation code for StreetEats is #{self.phone_confirmation_code}\"\n end",
"title": ""
},
{
"docid": "5b6c1d86fbe09c565c53d760e3728a2b",
"score": "0.5643478",
"text": "def notify_order(order)\n @order = order\n to = ADMIN_EMAIL\n\n mail :to => email_to(to), :subject => \"Pocket Prints Order ##{order.order_code}\"\n end",
"title": ""
},
{
"docid": "b797fe0af6609796f74afcfd87d0c711",
"score": "0.5636069",
"text": "def text_notification(email)\n content = \"\"\n address = email\n phone = User.where(email: email).first.phone\n Membership.where(email: email).each do |membership|\n Task.where(group_id: membership.group_id).each do |task|\n if task.priority == 3\n content << \"#{task.title}\\n\"\n end\n end\n Subtask.where(group_id: membership.group_id).each do |subtask|\n if subtask.priority == 3\n content << \"#{subtask.task.title}: #{subtask.title}\\n\"\n end\n end\n end\n unless phone.nil?\n if content.empty? == false\n TWILIO_CLIENT.account.sms.messages.create(\n from: TWILIO_NUMBER,\n to: \"+#{phone}\",\n body: content\n )\n end\n end\n end",
"title": ""
},
{
"docid": "63c70e148d4507bbc6782a16adff5161",
"score": "0.56320316",
"text": "def reminder_email(user)\n @user = user\n I18n.with_locale user.locale do\n mail to: @user.email\n end\n end",
"title": ""
},
{
"docid": "520209c10a688580b7f8253486b78152",
"score": "0.5631378",
"text": "def send_status_notification\n message = case @state\n when :hungry then \"I'm hungry!!!\"\n when :sick then \"I'm not feeling so well... :(\"\n when :playful then 'Come play with me!'\n end\n\n DesktopNotifications.notify(message) unless message.nil?\n end",
"title": ""
},
{
"docid": "d33b7ffeb7c5592292bd35433e7bb5c9",
"score": "0.56303036",
"text": "def message text\n $status_message.value = text # trying out 2011-10-9 \n end",
"title": ""
},
{
"docid": "a20813f59de989e680390bd618d98f90",
"score": "0.56299394",
"text": "def name\n\t\t\t\t\"notify\"\n\t\t\tend",
"title": ""
},
{
"docid": "a20813f59de989e680390bd618d98f90",
"score": "0.56299394",
"text": "def name\n\t\t\t\t\"notify\"\n\t\t\tend",
"title": ""
},
{
"docid": "e833e1ab23cc9e283aa7cb9dd1e43e2e",
"score": "0.5628106",
"text": "def notify\n @greeting = \"Just a test\"\n mail(to: \"[email protected]\") #.deliver_later\n end",
"title": ""
},
{
"docid": "38fec0151c3450e75ced91c9b5547618",
"score": "0.5616661",
"text": "def push_notification\n NotificationMailer.push_notification\n end",
"title": ""
},
{
"docid": "3053e2b17c26494ab38223d983d49274",
"score": "0.5602066",
"text": "def notify(user, answer)\n @user = user\n @answer =answer\n mail(to: user.email, subject: 'You has new answers') \n end",
"title": ""
},
{
"docid": "c65ea2507f6e7beef8c257c45bfc0ba1",
"score": "0.5600965",
"text": "def notify *args # :nodoc:\n printf \"%8s %s\\n\", *args\n end",
"title": ""
},
{
"docid": "48ce000a747a49381a99c77ebc672348",
"score": "0.55981237",
"text": "def notify_send(type, message)\n @notify_send ||= '/usr/bin/notify-send'\n puts \"#@notify_send -i gtk-dialog-#{type} 'CruiseControl' \\\"#{message}\\\"\"\n `#@notify_send -i gtk-dialog-#{type} 'CruiseControl' \\\"#{message}\\\"`\n end",
"title": ""
},
{
"docid": "899016b3b5f24235e4a67be60a99a7cb",
"score": "0.5593772",
"text": "def event_notify(uri, event, hdrs = {})\n hnames = hdrs.keys.map { |k| k.to_s.downcase } || []\n hdrs[\"To\"] = \"<#{uri}>\" unless hnames.include?(\"to\")\n hdrs[\"From\"] = \"<#{uri}>;tag=#{rand(1 << 32)}\" unless hnames.include?(\"from\")\n hdrs[\"Event\"] = EVENTNOTIFY[event] || event.to_s\n\n uac_dlg \"NOTIFY\", uri, hdrs\n end",
"title": ""
},
{
"docid": "7defefb74ac1f8dc4c1d0f7597cf33e6",
"score": "0.5593635",
"text": "def order_notification(ship)\n @ship = ship\n mail :subject => t('mytranslations.order_notification.subject'),\n :to => Refinery::Inquiries::Setting.notification_recipients,\n :reply_to => ship.client.email\n end",
"title": ""
},
{
"docid": "7569f20059bbe79d4f2ee91be6ec1fac",
"score": "0.5593527",
"text": "def name\n\t\t\t\"notify\"\n\t\tend",
"title": ""
},
{
"docid": "7569f20059bbe79d4f2ee91be6ec1fac",
"score": "0.5593527",
"text": "def name\n\t\t\t\"notify\"\n\t\tend",
"title": ""
},
{
"docid": "59f105e280284238b2e969bbed3262a9",
"score": "0.55879515",
"text": "def notification_msg\n author_name = author.firstname\n \"An issue has been reported by #{author_name}\"\n end",
"title": ""
},
{
"docid": "88d1d896e2f07fbaeb5895c1c13f4552",
"score": "0.55751026",
"text": "def inquiry(inquiry)\n @inquiry = inquiry\n @greeting = \"咨询\"\n\n mail to: \"[email protected]\", subject:\"有人咨询\", temlate_path: 'refer_notifier',template_name: 'inquiry'\n end",
"title": ""
},
{
"docid": "ae5fe4d0c30c919d018a4d5ce518e748",
"score": "0.5573338",
"text": "def notify(subject,body,obj = nil,sanitize_text=true,notification_code=nil,send_mail=true,sender=nil)\n Mailboxer::Notification.notify_all([self],subject,body,obj,sanitize_text,notification_code,send_mail,sender)\n end",
"title": ""
},
{
"docid": "56105d01b888cad48568e92d51437ffe",
"score": "0.5569718",
"text": "def notifyViaSMS(number, message, api, user, password)\n result = nil\n message = CGI.escape message\n request = \"/http/sendmsg?api_id=#{api}&user=#{user}&password=#{password}&to=#{number}&text=#{message}&from=RIVR\" \n Net::HTTP.start( 'api.clickatell.com', 80 ) { |http| result = http.get(request).body } \n return result \n end",
"title": ""
},
{
"docid": "016f0f337e13019bfa666a97276c381b",
"score": "0.55665696",
"text": "def order_shipped(order)\n @order = order\n mail :to => User.find_by_id(@order.user_id).email, :subject => \"来自Time international GmbH的包裹发送信息\"\n end",
"title": ""
},
{
"docid": "f7d4b539d652eafa5b30981d69798283",
"score": "0.55637527",
"text": "def user_notification_address(user)\n ['\"', user.name, '\" <notifications@', domain, '>'].join\n end",
"title": ""
},
{
"docid": "c550f92cc10bd874e98afe4a3251cfa7",
"score": "0.5559887",
"text": "def sendmail_confirm(user)\n @greeting = \"Hi\"\n @username = user.username\n @userid = user.userid\n\n mail to: \"[email protected]\", subject: \"登録完了通知\"\n end",
"title": ""
},
{
"docid": "c6d96fe1677102880b06f6d65605106d",
"score": "0.555326",
"text": "def admin_behavior_warning(email, company_phone, notification)\n @company_phone = company_phone\n @company = @company_phone.company\n @notification = notification\n mail(\n to: email,\n subject: 'GurúComm | Una línea esta cerca del límite de uso'\n )\n end",
"title": ""
},
{
"docid": "b064a6579520d5f453c916977a179e83",
"score": "0.5551572",
"text": "def mail_sent_to_admin(user)\n subject \"4D Techlab - New user\"\n from \"4d Techlab Notifier <[email protected]>\"\n headers \"Reply-to\" => \"[email protected]\"\n recipients '[email protected]'\n sent_on Time.now\n #content_type = \"text/plain\"\n body :user_url => user_url(user)\n end",
"title": ""
},
{
"docid": "81fd6f45efe47f2865db6ef4f2d25782",
"score": "0.55487984",
"text": "def confirm(order)\n @order = order\n mail :to => \"[email protected]\", :subject => \"注文を受けました。ありがとうございます。\"\n end",
"title": ""
},
{
"docid": "0abded13b53562b53fb3e31a0b0201cf",
"score": "0.55461514",
"text": "def trainee_report\n @user = @receiver\n @notification = @user.notifications.find_by(link: \"/reports/#{@report.id}\")\n subject = \"[FBC] #{@report.user.login_name}さんが日報【 #{@report.title} 】を書きました!\"\n mail to: @user.email, subject: subject\n end",
"title": ""
},
{
"docid": "3cffa9fb87247ba7c8676d5828572582",
"score": "0.553831",
"text": "def notify_business\n business.add_message_to_queue(\"Hey #{business.name}, we've just deposited #{amount} into your account! Thanks for being great!\")\n end",
"title": ""
},
{
"docid": "3a61d145c02c0035aaf11aca8a443910",
"score": "0.55371636",
"text": "def curate_text\n notification_type = get_nagios_var('NAGIOS_NOTIFICATIONTYPE')\n if notification_type.eql?('ACKNOWLEDGEMENT')\n @text += self.content[:short_text][:ack_info] unless self.content[:short_text][:ack_info].empty?\n else\n [:host_info, :state_info, :additional_info, :additional_details].each do |info|\n @text += self.content[:short_text][info] unless self.content[:short_text][info].empty?\n end\n end\n end",
"title": ""
},
{
"docid": "a8320cab14a981149b5a2faaccf03902",
"score": "0.5534912",
"text": "def post_announcement\n @user = @receiver\n @notification = @user.notifications.find_by(path: \"/announcements/#{@announcement.id}\")\n mail to: @user.email, subject: \"[bootcamp] #{@announcement.user.login_name}さんからお知らせです。\"\n end",
"title": ""
},
{
"docid": "310c03a5d7e8efe76031cbfe5960a8ce",
"score": "0.5532257",
"text": "def notify(message)\n Mail.deliver do\n to to\n from from\n subject subject\n body message\n end\n\n puts \"New message has been notified on Mail: #{message}\"\n end",
"title": ""
},
{
"docid": "a73a4d310c315876138e6fa77abe301e",
"score": "0.5530586",
"text": "def notify_by_push\n PushNotification.new(user: context.user,\n message: context.message,\n n_type: context.n_type,\n data: { from_id: context.user_from.try(:id), from_name: context.user_from.try(:name),\n donation_id: context.donation.try(:id) })\n .simple_notification\n end",
"title": ""
},
{
"docid": "db4dc8e8a121070f03f6c828b7b30f0a",
"score": "0.5530129",
"text": "def notify(message, options={})\n title = options.delete(:title) || 'Rulebow Notification'\n Notify.notify(title, message.to_s, options)\n end",
"title": ""
},
{
"docid": "a65ec301f814c378e5fcce664a6e512c",
"score": "0.553012",
"text": "def send_mail_to_admin\n \tNotification.send_mail_to_admin(self).deliver!\n end",
"title": ""
},
{
"docid": "522bc7528c3db3469bb4812e901f88dc",
"score": "0.5528695",
"text": "def message\n t(\".message\")\n end",
"title": ""
},
{
"docid": "522bc7528c3db3469bb4812e901f88dc",
"score": "0.5528695",
"text": "def message\n t(\".message\")\n end",
"title": ""
},
{
"docid": "b6f0e9ed1bb0f4cebf69d872749a9a63",
"score": "0.55194634",
"text": "def notify_changed_request_status(request)\n @request=request\n mail(to: request.user.email,\n subject: \"#{request.user.name} your request has been #{I18n.t \"request_status.#{request.status}\"}\")\n end",
"title": ""
},
{
"docid": "4ef0f7271edf73ae6135b961a6244b57",
"score": "0.55192834",
"text": "def send_ta_notification(user)\n\t\t@user = user\n\t\tmail( :to => @user.email, :subject => 'You have just been assigned to a course!')\n\tend",
"title": ""
},
{
"docid": "181aab42b3941dbf1d5bafe227a9a915",
"score": "0.5502715",
"text": "def geo_notification(to_user, cc_users, new_subs, hostname)\n recipients \"#{to_user.name} <#{to_user.email}>\"\n cc cc_users.map{|user| \"#{user.name} <#{user.email}>\"}\n from \"[email protected]\"\n reply_to \"[email protected]\"\n subject GEO_SUBJECT_TEMPLATE\n body :name => to_user.name.split(/ /).first,\n :subs_with_geo => new_subs[:with_geo],\n :subs_no_geo => new_subs[:no_geo],\n :subs_processing => new_subs[:processing],\n :hostname => hostname\n end",
"title": ""
}
] |
95c608c9827a4f98dfee59a9319a9a57
|
Returns true if the template with the given name is a template or not. In other words it cannot be a TemplatedPage.
|
[
{
"docid": "0e8af7497c0a1565e991104f1ae9e826",
"score": "0.90368193",
"text": "def is_a_template?(name)\n if template_exists?(name)\n return @pages[name].is_a?(PageTemplate)\n else\n puts \"Warning: cannot check if the template #{name} is a page because \" \\\n + \"it doesn't exist in the site.\"\n return false\n end\n end",
"title": ""
}
] |
[
{
"docid": "a56d40775fa95d5390497b3e924e2762",
"score": "0.8143779",
"text": "def is_a_page?(name)\n if template_exists?(name)\n return @pages[name].is_a?(TemplatedPage)\n else\n puts \"Warning: cannot check if the page #{name} is a page because it \" \\\n + \"doesn't exist in the site.\"\n return false\n end\n end",
"title": ""
},
{
"docid": "86405fe948da3fca265557c8723dddfd",
"score": "0.81189173",
"text": "def template_exists?(name)\n return @pages[name] != nil\n end",
"title": ""
},
{
"docid": "f87701448121af29d4c1b1a47c9c0063",
"score": "0.7816855",
"text": "def is_template?(template_name, template_type)\n case template_type\n when PinPress::Template::TYPE_PIN\n templates = configuration.pin_templates\n when PinPress::Template::TYPE_TAG\n templates = configuration.tag_templates\n end\n !templates.find { |t| t.keys[0] == template_name.to_sym }.nil?\n end",
"title": ""
},
{
"docid": "6d1a94b54562009087150b2b9638fa76",
"score": "0.7808727",
"text": "def has_template? name\n lookup_context.template_exists?( name, lookup_context.prefixes, false )\n end",
"title": ""
},
{
"docid": "314c3405a2628ccf3bdc6b3acc59c1c8",
"score": "0.77583736",
"text": "def check_for_template?(path)\n @page.templates[path]\n end",
"title": ""
},
{
"docid": "314c3405a2628ccf3bdc6b3acc59c1c8",
"score": "0.77583736",
"text": "def check_for_template?(path)\n @page.templates[path]\n end",
"title": ""
},
{
"docid": "9e782d3bf85c183db9e5fcf207e00253",
"score": "0.77479655",
"text": "def has_template_object?(name=nil)\n !template_objects[name].nil?\n end",
"title": ""
},
{
"docid": "554781fcebacf1407f7c965871c1eac3",
"score": "0.77236474",
"text": "def has_template_object?(name=nil)\n !template_objects[name].nil? \n end",
"title": ""
},
{
"docid": "8d5d84419ec2cba422fe802b34c315db",
"score": "0.76747704",
"text": "def check_for_template?(path)\n @page.templates[path]\n end",
"title": ""
},
{
"docid": "a7892a9d0fe6479c43fa64358f539e9d",
"score": "0.7672674",
"text": "def template_name?(name, opts = {})\n [email protected](name, opts)\n end",
"title": ""
},
{
"docid": "786b178fbdae29788583b64519a5c119",
"score": "0.7527145",
"text": "def template?\n @type == :template\n end",
"title": ""
},
{
"docid": "435e3e68447f5af29a4c7c8645e893f7",
"score": "0.7459874",
"text": "def path_is_a_template?(path)\n path.present? && template_path_exist(path)\n end",
"title": ""
},
{
"docid": "e365202629498948c11a9466d5d2b0d3",
"score": "0.72788614",
"text": "def template?\n true\n end",
"title": ""
},
{
"docid": "86ddfed987b447374cec7e71b3e85555",
"score": "0.7241723",
"text": "def template_exists?(template_name)\n finder.file_exists?(template_name)\n end",
"title": ""
},
{
"docid": "2ebeefa19742c6dac4c21797c747431a",
"score": "0.71259016",
"text": "def has_template?(template, type)\n templates[template].has_key?(type)\n end",
"title": ""
},
{
"docid": "fd176a6c01fc6a10277b3f9777e66b80",
"score": "0.7104154",
"text": "def template_exists?(file_name)\n return true if file_exists?(file_name)\n \n extensions = ActionMailer::Base.template_extensions\n extensions.each do |extension|\n [content_type.gsub('/', '.'), nil].each do |middle|\n full_name = [filename, middle, extension].compact.join('.')\n return true if file_exists?(full_name)\n end\n end\n false\n end",
"title": ""
},
{
"docid": "f8ed30b585e16365c08b58cd46a66111",
"score": "0.7086524",
"text": "def has_template_object?(name=nil)\n ActiveSupport::Deprecation.warn(\"response.has_template_object? has been deprecated. Use tempate.assigns[name].nil? instead\", caller)\n !template_objects[name].nil?\n end",
"title": ""
},
{
"docid": "4cd08544989c9d8e62d93e2534e55162",
"score": "0.7020105",
"text": "def has_own_partial?(name)\n view_paths.find_template(\"_#{name}\", default_template_format) != nil\n rescue ActionView::MissingTemplate\n return false\n end",
"title": ""
},
{
"docid": "519e5e4fc079bc5c140f8ac486e516df",
"score": "0.69994146",
"text": "def template?\n if proxy?\n store.page(proxied_to).template?\n else\n return false if source_file.nil?\n !::Tilt[source_file].nil?\n end\n end",
"title": ""
},
{
"docid": "090381d6a40441538b81e9435b9b2c7b",
"score": "0.6976299",
"text": "def handles? name\n @templates.key? name\n end",
"title": ""
},
{
"docid": "645641cd109651027e60a4db688c52c5",
"score": "0.6911839",
"text": "def template_exists?(template_name, partial = false)\n lookup_context.exists? template_name, '', partial\n end",
"title": ""
},
{
"docid": "a5820792b0d641bbf50e3cc8799d1af6",
"score": "0.6883217",
"text": "def template_exists?(name, dir = '')\n File.exists?(File.join(@src_dir, 'pages', dir, \"#{name}.haml\")) || File.exists?(File.join(@src_dir, 'stylesheets', dir, \"#{name}.sass\"))\n end",
"title": ""
},
{
"docid": "b64aa3ca0d2624d74ab0d4352b31f0fc",
"score": "0.6874158",
"text": "def templated?\n false\n end",
"title": ""
},
{
"docid": "dbf7d2125ecb05bea4fa5e548a9eb2e5",
"score": "0.68735975",
"text": "def templated?\n template_id.present?\n end",
"title": ""
},
{
"docid": "82717bd55e72d25081b1e84eafd1ec38",
"score": "0.68676555",
"text": "def template_exists?(name, dir = '')\n File.exists?(File.join(@src_dir, 'pages', dir, \"#{name}.haml\")) || File.exists?(File.join(@src_dir, 'stylesheets', \"#{name}.sass\")) || File.exists?(File.join(@src_dir, 'stylesheets', \"#{name}.scss\"))\n end",
"title": ""
},
{
"docid": "b1b9f9b7cbd2b7c67d270dcf9c9d5de2",
"score": "0.6862058",
"text": "def manage_template?(posttype = nil)\n get_option('has_template', (posttype || post_type).get_option('has_template', true))\n end",
"title": ""
},
{
"docid": "8c854ba2e805f6081cf9f4d9f7124b4a",
"score": "0.6828175",
"text": "def disable_template(name)\n name = name.to_sym\n\n return false if @disabled_templates.include?(name)\n\n if (template_dir = Template.templates[name])\n source_paths.delete(template_dir)\n\n @templates.delete_if { |template| template.path == template_dir }\n @enabled_templates.delete(name)\n end\n\n @disabled_templates << name\n return true\n end",
"title": ""
},
{
"docid": "dad10e0cb86cb16322618abf936c2559",
"score": "0.6825037",
"text": "def template_exists?(template_name, lookup_overrides = false)\n begin\n method = 'find_template'\n method << '_without_active_scaffold' unless lookup_overrides\n self.view_paths.send(method, template_name, @template_format)\n return true\n rescue ActionView::MissingTemplate => e\n return false\n end\n end",
"title": ""
},
{
"docid": "494ce8d84f7df1c03890d10b6fe914d2",
"score": "0.6810677",
"text": "def template_type_exists?(template_type)\n\t\t\t\tklass = Core::Template.const_get(template_type)\n\t\t\t\treturn klass.is_a?(Class) ? klass : false\n\t\t\trescue NameError\n\t\t\t\treturn false\n\t\t\tend",
"title": ""
},
{
"docid": "024ed47d0241eaa37f299e27875ac622",
"score": "0.67718077",
"text": "def handles? name\n @templates.key? name\n end",
"title": ""
},
{
"docid": "7e36df53e77ec381ac2f849a2a570cf2",
"score": "0.67404085",
"text": "def resource_check_template_exists?(path) #:nodoc:\n template_exists?(path)\n end",
"title": ""
},
{
"docid": "986d59c444f661bca78a31efcd5576d3",
"score": "0.67328686",
"text": "def templated?\n @templated || false\n end",
"title": ""
},
{
"docid": "c665a2c93bce62cfd99f76b5f57cadc9",
"score": "0.6686902",
"text": "def exist?(template)\n templates.has_key?(template)\n end",
"title": ""
},
{
"docid": "231a3e7cd03a1672b4c9ae821fa01f98",
"score": "0.66257876",
"text": "def check_template_name\n if @template_name.nil? || @template_name.empty?\n jumpstart_menu\n end\n end",
"title": ""
},
{
"docid": "3aa051d27f4062d532ded352f390637a",
"score": "0.65850514",
"text": "def exists?\n if self.class.onetemplate_list().include?(resource[:name])\n self.debug \"Found template #{resource[:name]}\"\n true\n end\n end",
"title": ""
},
{
"docid": "cdc53af82e9cef4eb48aaf881ca08338",
"score": "0.6539094",
"text": "def exist?(template)\n File.exist?(File.join(@template_path, template + \".erb\"))\n end",
"title": ""
},
{
"docid": "5072466a9e976e15b2c9ea6b5735bbc6",
"score": "0.6538676",
"text": "def template_exists?(section)\n File.exist?(template(section))\n end",
"title": ""
},
{
"docid": "96f37289b5b7aabc011589b4d0f5eeb6",
"score": "0.65156746",
"text": "def has_default_template?\n self.class.default_template\n end",
"title": ""
},
{
"docid": "2202fb4811e1853e7b0bdfa4cc526998",
"score": "0.6509968",
"text": "def template(name)\n templates.find { |t| t.name == name }\n end",
"title": ""
},
{
"docid": "f45efc6e9d69b6b053706112e2904c08",
"score": "0.65068156",
"text": "def create?\n @template.present?\n end",
"title": ""
},
{
"docid": "be52b87e2dc39b3c5070733295007b7f",
"score": "0.64934516",
"text": "def check_template_exists\n Template.find(self.template_id) unless self.template_id.nil?\n end",
"title": ""
},
{
"docid": "4396a20c3396196749bd93c1c872018a",
"score": "0.6452419",
"text": "def has_template_for_node?(node, template_filename)\n !!find_preferred_manifest_record(node, :templates, template_filename)\n end",
"title": ""
},
{
"docid": "1d3407c3acb8b975430f8899461fcb91",
"score": "0.643436",
"text": "def resource_check_template_exists?(path) #:nodoc:\n controller.resource_check_template_exists?(path)\n end",
"title": ""
},
{
"docid": "74d7bc6e2ee7c98064350794e0ee4421",
"score": "0.6421887",
"text": "def compiled?\n (@template && @template.is_a?(Template)) || self.class.compiled?\n end",
"title": ""
},
{
"docid": "4761219d9abd97a4346f607369e90c83",
"score": "0.63868517",
"text": "def template_exists?(template_name, partial = false)\n if @_view_paths\n restore_view_paths = lookup_context.view_paths\n lookup_context.view_paths = @_view_paths\n end\n (@_lookup_context || lookup_context).exists?(template_name, '', partial).tap do\n lookup_context.view_paths = restore_view_paths if @_view_paths\n end\n end",
"title": ""
},
{
"docid": "7e2584bdff29961700127ffb5b93159b",
"score": "0.6381783",
"text": "def renders_template(name)\n name = name.to_s\n actual_template_path = actual.response.rendered[:template].to_s\n actual_template_name = File.basename(actual_template_path)\n msg = \"expected template #{name.inspect}, not #{actual_template_path.inspect}\"\n actual_template_name.to_s.match(/^#{name}(\\.\\w+)*$/) || fail(msg)\n end",
"title": ""
},
{
"docid": "86939eb2a542b41d3a8068ac4ec0f8e0",
"score": "0.6375856",
"text": "def compiled?\n (@template && @template.is_a?(Template)) || self.class.compiled?\n end",
"title": ""
},
{
"docid": "86939eb2a542b41d3a8068ac4ec0f8e0",
"score": "0.6375856",
"text": "def compiled?\n (@template && @template.is_a?(Template)) || self.class.compiled?\n end",
"title": ""
},
{
"docid": "56b6fbdd4a683968706c09bebc3dde0e",
"score": "0.63314414",
"text": "def valid_page?\n File.exist?(Pathname.new(Rails.root + \"app/views/pages/#{params[:page]}.html.erb\"))\n end",
"title": ""
},
{
"docid": "6e4ad8f8ff057fd1fdd37c0c076d834a",
"score": "0.6331015",
"text": "def template_available?(path)\n !path.nil? && run_context.has_template_in_cookbook?(new_resource.cookbook, path)\n end",
"title": ""
},
{
"docid": "ff1449e7ca0955bf5a961a41d126edc0",
"score": "0.6317155",
"text": "def will_render?(path)\n Tilt.templates_for(path.to_s).any?\n end",
"title": ""
},
{
"docid": "bfbeed90e236435ba449b90f7d2841c5",
"score": "0.6299679",
"text": "def template?\n if proxy?\n store.find_resource_by_path(proxied_to).template?\n else\n super\n end\n end",
"title": ""
},
{
"docid": "8785f51357be737b09d1519b816a3741",
"score": "0.6282248",
"text": "def is_template_directly_usable\n super\n end",
"title": ""
},
{
"docid": "dad428045d8010de72845710130de903",
"score": "0.62757134",
"text": "def custom_template_path_valid?\n Vanity.playground.custom_templates_path &&\n File.exist?(Vanity.playground.custom_templates_path) &&\n !Dir[File.join(Vanity.playground.custom_templates_path, '*')].empty?\n end",
"title": ""
},
{
"docid": "63718cb1874bd7cb5e1dfb19e75cfda4",
"score": "0.6264542",
"text": "def remove_page_template(name)\n if is_a_template?(name)\n @pages[name] = nil\n else\n puts \"Warning: can't remove template #{name} because it's not a template.\"\n end\n # TODO: decide about checking and/or warning about broken template strings\n # possibly even repairing by pointing children of removed at removed's\n # parent\n end",
"title": ""
},
{
"docid": "f668c46d4599673b3a28d1f72d6caf65",
"score": "0.62644225",
"text": "def content_by_name?(name)\n @current_page.nil? || @current_page.cms_contentitems.where(container: name).count == 0 ? false : true\n end",
"title": ""
},
{
"docid": "11a3db39867832c7e1b93903e7fb7a88",
"score": "0.6260102",
"text": "def has_template?(templates, klass, sym)\n templates.include? \"#{klass}##{sym}\"\n end",
"title": ""
},
{
"docid": "2378daed700e3ddf8748d94360bdd45f",
"score": "0.6246044",
"text": "def enable_template(name)\n name = name.to_sym\n\n return false if @enabled_templates.include?(name)\n\n unless (template_dir = Template.templates[name])\n say \"Unknown template #{name}\", :red\n exit -1\n end\n\n new_template = Template::Directory.new(template_dir)\n\n # mark the template as enabled\n @enabled_templates << name\n\n # enable any other templates\n new_template.enable.each do |sub_template|\n enable_template(sub_template)\n end\n\n # append the new template to the end of the list,\n # to override previously loaded templates\n @templates << new_template\n\n # add the template directory to the source-paths\n self.source_paths << new_template.path\n return true\n end",
"title": ""
},
{
"docid": "f7da6098d8159ba64ac03b4816310512",
"score": "0.6223635",
"text": "def template_exists?(path, renderer=nil)\n template_path = path.dup\n template_path << \".#{renderer}\" if renderer\n File.readable? File.join(settings.views, template_path)\n end",
"title": ""
},
{
"docid": "64e4967bb8cd966d77794bbb1c0ad12f",
"score": "0.6221997",
"text": "def has_template_in_cookbook?(cookbook, template_name)\n cookbook = cookbook_collection[cookbook]\n cookbook.has_template_for_node?(node, template_name)\n end",
"title": ""
},
{
"docid": "530a8fc5c81c6e128b4f45f473bb5e07",
"score": "0.62216353",
"text": "def can_render?(template)\n @template.template_format = determine_format_for(template)\n template = strip_extension(template)\n @template.finder.class.reload!\n @template.finder.file_exists?(full_template_path(template))\n end",
"title": ""
},
{
"docid": "f05c3b0f0fcbdf69d021c499ece06319",
"score": "0.6217487",
"text": "def template?(action, format)\n # Allow for template override using the :template annotation\n #\n # class MyController\n # def myaction\n # end\n # ann :myaction, :template => :another_template\n # end\n\n template = ann(action, :template) || action\n\n template = template.to_s.gsub(/__/, \"/\")\n\n for dir in ann(:self, :template_dir_stack)\n name = \"#{dir}/#{template}\".squeeze(\"/\")\n\n # attempt to find a template of the form:\n # dir/action.xhtml\n\n path = \"#{name}.#{format.template_extension}\"\n return path if File.exist?(path)\n\n # attempt to find a template of the form:\n # dir/action/index.xhtml\n\n path = \"#{name}/index.#{format.template_extension}\"\n return path if File.exist?(path)\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "8137cb12c964f06e0673ddf93d31f2d2",
"score": "0.62167245",
"text": "def content_for?(name)\n @view_flow.get(name).present?\n end",
"title": ""
},
{
"docid": "ade54982b00315dc2a45575b607371ef",
"score": "0.62099373",
"text": "def validate_template( dir )\n # Parse and validate the template's nutella.json file\n begin\n template_nutella_file_json = JSON.parse(IO.read(\"#{dir}/nutella.json\"))\n rescue\n return false\n end\n return false unless validate_nutella_file_json template_nutella_file_json\n # If template is a bot, perform the appropriate checks\n if template_nutella_file_json['type']=='bot'\n # Is there a mandatory 'startup' script and is it executable\n return false unless File.executable? \"#{dir}/startup\"\n end\n # If template is an interface, perform the appropriate checks\n if template_nutella_file_json['type']=='interface'\n # Is there the mandatory index.html file\n return false unless File.exist? \"#{dir}/index.html\"\n end\n true\n end",
"title": ""
},
{
"docid": "290b9b271b3d9ed90422e46e0945694b",
"score": "0.6204911",
"text": "def html_tempalte_exists?(filename)\n exist?(\"#{filename}.erb\") || exist?(\"#{filename}.haml\") || exist?(\"#{filename}.slim\")\n end",
"title": ""
},
{
"docid": "a00a9e5de8488af3cf189cf3c97c3e4f",
"score": "0.61948293",
"text": "def block_is_template?(_)\n false\n end",
"title": ""
},
{
"docid": "a0e1e0e7999d063bdfcbe71b19baeb38",
"score": "0.6183368",
"text": "def exist_for_types?(template, types)\n return false unless exist?(template)\n types.each do |type|\n return has_template?(template, type)\n end\n false\n end",
"title": ""
},
{
"docid": "00420c7f91eb7a5c2cc1439c66bd9061",
"score": "0.6182479",
"text": "def valid_page?\n File.exist?(Pathname.new(Rails.root + \"app/views/general/#{params[:page]}.html.erb\"))\n end",
"title": ""
},
{
"docid": "60e627ed09ced0dc9183b901c8baf4e3",
"score": "0.6148929",
"text": "def imported?\n !@template\n end",
"title": ""
},
{
"docid": "ab5da17fc87e8b4db3b6296a82b1dc91",
"score": "0.6146477",
"text": "def validate template\n\t\t\t t = template.new\n\n\t\t\t\treturn false if t == nil\n\t\t\t return t.respond_to?(:render)\n\t\t\tend",
"title": ""
},
{
"docid": "4362b42e7d78449c0f283f6a1847ff38",
"score": "0.6135318",
"text": "def is_recovery_request_submission_template?(template_name)\n GlobalConstant::PepoCampaigns.recovery_request_submission_template == template_name\n end",
"title": ""
},
{
"docid": "dc6901950c8bf9086776ee9f625d679e",
"score": "0.6115786",
"text": "def find_template_by_name(name)\n\t\t\t\t@registered_templates.each do |template|\n\t\t\t\t\tt = template.new\n\t\t\t\t\tif t.template_info[:name] == name\n\t\t\t\t\t\treturn t\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\treturn nil\n\t\t\tend",
"title": ""
},
{
"docid": "34e930f167f81d5d15d9f49feb132d2e",
"score": "0.61092806",
"text": "def template_exists?(template_path, extension)\n file_path = full_template_path(template_path, extension)\n !file_path.blank? && @@method_names.has_key?(file_path) || File.exist?(file_path)\n end",
"title": ""
},
{
"docid": "9a6cb3214e098e63d5814fb702effe55",
"score": "0.61006474",
"text": "def template?\n !pipeline.empty?\n end",
"title": ""
},
{
"docid": "17fbe1eb02c0a6192a96ea86dea5cf82",
"score": "0.6092669",
"text": "def validate template\n\t\t\t\tt = template.new\n\n\t\t\t\treturn false if t == nil\n\t\t\t\treturn t.instance_variable_defined?(\"@info\")\n\t\t\tend",
"title": ""
},
{
"docid": "dbc02abdb00f464bb1b254e31f46db44",
"score": "0.60857904",
"text": "def is_forgot_password_template?(template_name)\n [\n GlobalConstant::PepoCampaigns.forgot_password_template\n ].include?(template_name)\n end",
"title": ""
},
{
"docid": "8ab7c4bca35ff76b579959c97e2d96fc",
"score": "0.60825163",
"text": "def templated?\n !!@link['templated']\n end",
"title": ""
},
{
"docid": "583685c9651b50e8d673bb4b2813cf3e",
"score": "0.60742635",
"text": "def enabled?(name)\n @enabled_templates.include?(name.to_sym)\n end",
"title": ""
},
{
"docid": "a8873261d77f76c6b3de6ed1dcdcfcf5",
"score": "0.60513276",
"text": "def block_is_template?(block)\n handler = find_proper_handler\n block && handler && handler.engine_matches?(block)\n end",
"title": ""
},
{
"docid": "c4b2e5b5bc621ac05755984648293a3b",
"score": "0.6049105",
"text": "def is_cfn_template?\n local_data.is_a?(Hash) && local_data.key?('Resources')\n end",
"title": ""
},
{
"docid": "3946941b356fa075c79c5fb0280bbb68",
"score": "0.60427576",
"text": "def tmpl name\n if t = cache[:tmpl][name]\n DOM.new t[:html]\n else\n false\n end\n end",
"title": ""
},
{
"docid": "d04263b177cdde43f9fdde84a5db4aed",
"score": "0.60365695",
"text": "def in_use?\n Page.all.each do |page|\n return true if page.page_template_id == self.id\n page.page_components.each do |component|\n return true if component.page_template_id == self.id\n end\n end\n false\n end",
"title": ""
},
{
"docid": "2d8f780e46e77688aa220ce2bf513b8b",
"score": "0.60273516",
"text": "def template?\n template && template['AWSTemplateFormatVersion']\n end",
"title": ""
},
{
"docid": "87ea37b1843e1ca125ac6454c5533278",
"score": "0.6008066",
"text": "def valid_page?\n File.exist?(Pathname.new(Rails.root + \"app/views/pages/#{params[:page]}\"))\n end",
"title": ""
},
{
"docid": "5a15a95e146187be5b43b7169d403cac",
"score": "0.6006461",
"text": "def template_path_exist(path)\n File.exist?(expanded_path(path))\n end",
"title": ""
},
{
"docid": "a1f115092346786db9382c15dbedf88c",
"score": "0.5999434",
"text": "def template(name)\n raise \"template(#{name})\"\n end",
"title": ""
},
{
"docid": "3b2ecf20341f3ed64bdfe5189f81f928",
"score": "0.59911627",
"text": "def rails3_canonical_mailer_views?(name)\n (exist?(\"#{name}.html.erb\") && !html_tempalte_exists?(\"#{name}.text\")) ||\n (exist?(\"#{name}.html.haml\") && !html_tempalte_exists?(\"#{name}.text\")) ||\n (exist?(\"#{name}.html.slim\") && !html_tempalte_exists?(\"#{name}.text\"))\n end",
"title": ""
},
{
"docid": "d957b59ac05d1d5ca71e3a878250b33f",
"score": "0.5981745",
"text": "def find_template_by_name name\n\t\t\t\t@registered_templates.each do |template|\n\t\t\t\t\tt = template.new\n\t\t\t\t\tif t.template_info[:name] == name\n\t\t\t\t\t\treturn t\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\treturn nil\n\t\t\tend",
"title": ""
},
{
"docid": "51793606632253854b4807b5cbc75487",
"score": "0.59679574",
"text": "def is_forgot_password_template?(template_name)\n GlobalConstant::PepoCampaigns.platform_forgot_password_template == template_name\n end",
"title": ""
},
{
"docid": "55d179b5d13d294fad9cd77bc7577d25",
"score": "0.59494954",
"text": "def has_content_for? name\n ivar = \"@content_for_#{name}\"\n !instance_variable_get(ivar).blank?\n end",
"title": ""
},
{
"docid": "24be429a8ba69585911b678c82e021b7",
"score": "0.59452033",
"text": "def template(name)\n templates.get(name)\n end",
"title": ""
},
{
"docid": "4684d21241888b05d8207114fd7be25a",
"score": "0.5927853",
"text": "def template_modifiable?(template)\n template.latest? &&\n template.customization_of.blank? &&\n template.id.present? &&\n template.org_id = current_user.org.id\n end",
"title": ""
},
{
"docid": "4684d21241888b05d8207114fd7be25a",
"score": "0.5927853",
"text": "def template_modifiable?(template)\n template.latest? &&\n template.customization_of.blank? &&\n template.id.present? &&\n template.org_id = current_user.org.id\n end",
"title": ""
},
{
"docid": "df1e3652af58ddd355fe2ce7280c6486",
"score": "0.5919981",
"text": "def exists?(params = {})\n response = client.head \"/_template/{template}\", update_params(params, action: \"template.exists\", rest_api: \"indices.exists_template\")\n response.success?\n end",
"title": ""
},
{
"docid": "0b8c4c811288a1eee38fc110e27733b2",
"score": "0.59118825",
"text": "def is_double_opt_in_related_template?(template_name)\n GlobalConstant::PepoCampaigns.platform_double_optin_template == template_name\n end",
"title": ""
},
{
"docid": "e99fa3cfc1519392f94199a95cbd545a",
"score": "0.5897085",
"text": "def template_should_be_generated?(template, options = {})\n template_type = template.to_s.pluralize.to_sym\n \n\t\t\t# See if the caller wants to include or exclude certain files\n files_to_include = options[:files_to_include].try(:map, &:to_sym) || []\n files_to_exclude = options[:files_to_exclude].try(:map, &:to_sym) || []\n\n if files_to_exclude.map(&:pluralize).include? template_type # File is defined to be excluded in the model template, return false\n return false\n \n elsif @files_to_create.include?(template_type)\n \n if template_types[template_type][:exclude_by_default] # File is exclude by default so it depends on the model definition?, return value \n return files_to_include.map(&:pluralize).include?(template_type)\n else\n return true\n end\n else\n # The template wasn't requested so\n return false\n end\n end",
"title": ""
},
{
"docid": "efeefac0e7dc5942255ba416ee83f3fd",
"score": "0.58885485",
"text": "def template_is_url?(path)\n normalise_file_path_to_url(path)\n true\n rescue ArgumentError, URI::InvalidURIError\n false\n end",
"title": ""
},
{
"docid": "74044c1592161faadadc34e7f4c9331b",
"score": "0.58729494",
"text": "def is_double_opt_in_related_template?(template_name)\n [\n GlobalConstant::PepoCampaigns.double_opt_in_template\n ].include?(template_name)\n end",
"title": ""
},
{
"docid": "74d1510f539491a3dbf1eb2df93f84e1",
"score": "0.5863591",
"text": "def templated?\n @options.fetch(:templated)\n end",
"title": ""
},
{
"docid": "6c4884ebd593fb44cf5b38bd18ff4074",
"score": "0.5860572",
"text": "def check_code_name(code_name)\n [code_name.pluralize, code_name.singularize].each {|name|\n %w{self_and_ancestors descendants}.each {|m|\n return false if template.send(m).map(&:code_name).include?(name)}}\n true\n end",
"title": ""
}
] |
dc211ac48fa59735baac7955457be367
|
Linkable grab what will be used when organizing
|
[
{
"docid": "efa8ceda3d271c66a0155fc29930d89b",
"score": "0.57902014",
"text": "def linkable\n\t\tself\n\tend",
"title": ""
}
] |
[
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.7137149",
"text": "def links; end",
"title": ""
},
{
"docid": "0391c000ff3726d23543fb86ee65b8bc",
"score": "0.6637462",
"text": "def links_to(l); @link = l; end",
"title": ""
},
{
"docid": "0391c000ff3726d23543fb86ee65b8bc",
"score": "0.6637462",
"text": "def links_to(l); @link = l; end",
"title": ""
},
{
"docid": "8d9ceb5ffed81a985828387362e5211f",
"score": "0.6426684",
"text": "def get_link_data( *types )\n all_links = []\n # We'll include a sort by number of path components in this chain so\n # that we can improve the chances of higher-level items not having\n # naming conflicts. For example, the topmost index.html file should\n # not require a prefix!\n app.sitemap.resources\n .select { |r| r.content_type && r.content_type.start_with?( *types ) }\n .sort { |a, b| Pathname(a.destination_path).each_filename.to_a.count <=> Pathname(b.destination_path).each_filename.to_a.count }\n .each do |r|\n reference_path = Pathname(r.destination_path).each_filename.to_a.reverse\n reference_path.shift\n reference = File.basename(r.destination_path, '.*').gsub(%r{ }, '_')\n link = r.url\n hb_link = defined?(r.hb_NavId) ? \"#/#{r.hb_NavId}\" : nil\n title = r.data.title ? r.data.title.gsub(%r{</?[^>]+?>}, '') : nil\n\n i = 0\n while all_links.find { |link| link[:reference] == reference }\n next_piece = reference_path[i].gsub(%r{ }, '_')\n reference = \"#{next_piece}-#{reference}\"\n i += 1\n end\n\n all_links << {:reference => reference, :link => link, :title => title, :hb_link => hb_link}\n end # .each\n\n all_links\n end",
"title": ""
},
{
"docid": "192f2803d8f68ca13b9b6114bc569131",
"score": "0.6386871",
"text": "def link\n end",
"title": ""
},
{
"docid": "4969f12173d56065f8713f54aad05e62",
"score": "0.63214695",
"text": "def item_link(clusterable_presenter)\n if cluster.group_type? && clusterable != clusterable_presenter.subject\n contracted_group_name(cluster.group) + ' / ' + link_to_cluster\n else\n link_to_cluster\n end\n end",
"title": ""
},
{
"docid": "9631de9e4bcb8c5ce580c6179c06a10d",
"score": "0.6315438",
"text": "def links\n @order.inject([]) do |set, key|\n if(key == \"Dashboard\")\n [link_for(key)] + set\n else\n set << link_for(key)\n end\n end\n end",
"title": ""
},
{
"docid": "0efc22c62351da7afbd484ed0aff4d1c",
"score": "0.63092184",
"text": "def link_name\n name\n end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.6298762",
"text": "def link?; end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.6298762",
"text": "def link?; end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.6298762",
"text": "def link?; end",
"title": ""
},
{
"docid": "746815dc155edc99650ceb1b571705be",
"score": "0.62829506",
"text": "def links=(_arg0); end",
"title": ""
},
{
"docid": "746815dc155edc99650ceb1b571705be",
"score": "0.62829506",
"text": "def links=(_arg0); end",
"title": ""
},
{
"docid": "3265482de744823766f8a62adb9711b5",
"score": "0.6265436",
"text": "def hyperlinks; end",
"title": ""
},
{
"docid": "3265482de744823766f8a62adb9711b5",
"score": "0.6265436",
"text": "def hyperlinks; end",
"title": ""
},
{
"docid": "26a4867c30665d8f6861a7e627c46b48",
"score": "0.6259973",
"text": "def links; @links; end",
"title": ""
},
{
"docid": "2edcf26c4c0b442a908da04bc1200b4e",
"score": "0.6254534",
"text": "def link_name\n self.name\n end",
"title": ""
},
{
"docid": "2edcf26c4c0b442a908da04bc1200b4e",
"score": "0.6254534",
"text": "def link_name\n self.name\n end",
"title": ""
},
{
"docid": "2edcf26c4c0b442a908da04bc1200b4e",
"score": "0.6254534",
"text": "def link_name\n self.name\n end",
"title": ""
},
{
"docid": "d7d67ba0228c2889c01acb4e7d5dacec",
"score": "0.6226115",
"text": "def links_parser; end",
"title": ""
},
{
"docid": "ba6db1e2d01a3acc00c1cb88275ed943",
"score": "0.6198361",
"text": "def href_template; end",
"title": ""
},
{
"docid": "623fe703fb09b8058bf2eef1732ab64b",
"score": "0.61814386",
"text": "def hyperlink; end",
"title": ""
},
{
"docid": "d7e36662197888bce42956a8b7d7b065",
"score": "0.61637956",
"text": "def getlinks\n @shortlinks = [\"in\", \"br\"] #, \"up\"]\n @shortlinks_special = [\"in\", \"br\", \"up\"]\n @links = [\"index\", \"browse\", \"update\"]\n @link_names = [\"Description\", \"Browse Database\", \"Update Database\"]\n @link_text = [\"Description\", \"Browse the database\", \"Update the database\"]\n end",
"title": ""
},
{
"docid": "f2e9cf48c0a38257ddd7f5e9987a41e4",
"score": "0.6124088",
"text": "def link_to_identifier; end",
"title": ""
},
{
"docid": "4a0eb40928165c1dfd41a666fbbdc287",
"score": "0.61111856",
"text": "def link_name\n self.formatted_name\n end",
"title": ""
},
{
"docid": "4a0eb40928165c1dfd41a666fbbdc287",
"score": "0.61111856",
"text": "def link_name\n self.formatted_name\n end",
"title": ""
},
{
"docid": "3e6a102b1a3550d5f44ae38a296641ec",
"score": "0.6110437",
"text": "def href; end",
"title": ""
},
{
"docid": "3e6a102b1a3550d5f44ae38a296641ec",
"score": "0.6110437",
"text": "def href; end",
"title": ""
},
{
"docid": "e376b4d2dc1916dfc7df6ca040fc07de",
"score": "0.6097394",
"text": "def itemLink\n @header = \"Smithsonian Collections\"\n @body = item_link()\n end",
"title": ""
},
{
"docid": "1a867ff08ce0432685a7c858cc3d3979",
"score": "0.60928494",
"text": "def homelink\n object\n end",
"title": ""
},
{
"docid": "03e80fd9013712d26f9543fb41f97996",
"score": "0.60571903",
"text": "def get_link_data( resource, *types )\n all_links = []\n # We'll include a sort by number of path components in this chain so\n # that we can improve the chances of higher-level items not having\n # naming conflicts. For example, the topmost index.html file should\n # not require a prefix!\n app.sitemap.resources\n .select { |r| r.content_type && r.content_type.start_with?( *types ) }\n .select { |r| [:locale, :global, :convention].include?(r.asset_path_type) }\n .select { |r| r.hb_Section? != true}\n .select { |r| r.hb_locale == resource.hb_locale || r.hb_locale == nil }\n .sort { |a, b| Pathname(a.destination_path).each_filename.to_a.count <=> Pathname(b.destination_path).each_filename.to_a.count }\n .each do |r|\n reference_path = Pathname(r.destination_path).each_filename.to_a.reverse\n reference_path.shift\n reference = r.page_name\n link = r.url\n hb_link = defined?(r.hb_NavId) ? \"#/#{r.hb_NavId}\" : nil\n title = r.data.title ? r.data.title.gsub(%r{</?[^>]+?>}, '') : nil\n\n i = 0\n while all_links.find { |link| link[:reference] == reference }\n next_piece = reference_path[i].gsub(%r{ }, '_')\n reference = \"#{next_piece}-#{reference}\"\n i += 1\n end\n\n all_links << {:reference => reference, :link => link, :title => title, :hb_link => hb_link}\n end # .each\n\n all_links\n end",
"title": ""
},
{
"docid": "fea33128071275c665aa911203c16f99",
"score": "0.6030577",
"text": "def link() url; end",
"title": ""
},
{
"docid": "b397684fac5f517cd81f47d55e6b8d68",
"score": "0.6023387",
"text": "def get_Link()\n \t return @outputs[\"Link\"]\n \tend",
"title": ""
},
{
"docid": "b87893e6d492e25180dfadef409e241c",
"score": "0.60232687",
"text": "def to_link\n [@bucket.name, @name]\n end",
"title": ""
},
{
"docid": "6af3a35754b5e56a955b1c36272aa0f4",
"score": "0.6019868",
"text": "def link_name\n self.title\n end",
"title": ""
},
{
"docid": "6af3a35754b5e56a955b1c36272aa0f4",
"score": "0.6019868",
"text": "def link_name\n self.title\n end",
"title": ""
},
{
"docid": "6af3a35754b5e56a955b1c36272aa0f4",
"score": "0.6019868",
"text": "def link_name\n self.title\n end",
"title": ""
},
{
"docid": "6af3a35754b5e56a955b1c36272aa0f4",
"score": "0.6019868",
"text": "def link_name\n self.title\n end",
"title": ""
},
{
"docid": "4d1ee627b16b1bad499d48e7a3cbb8fb",
"score": "0.5984453",
"text": "def href()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "4d1ee627b16b1bad499d48e7a3cbb8fb",
"score": "0.5984453",
"text": "def href()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "075e0cdd456a5b0cb3a7e227d8fe8b17",
"score": "0.59837097",
"text": "def link_location\n return @link_location\n end",
"title": ""
},
{
"docid": "104ffbe79158eb042babb16e0d202439",
"score": "0.5975561",
"text": "def get_links(group, key, main_id)\n\t\titems = Menu.where(group: group, key: key).includes(:link)\n\t\tlinks = items.map{ |m|\n\t\t\turl = m.link.url \n\t\t\tif m.link.substitue\n\t\t\t\turl.gsub!('##current_user_id##',current_user.id.to_s) if m.link.substitue > 1 # 2, 3\n\t\t\t\turl.gsub!('##main_id##',main_id.to_s) if m.link.substitue%2 == 1 # 1,3\n\t\t\tend\n\t\t\t{name: m.link.display, url: url, method: m.link.method}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "234e3446a9cca013dea70dcbfb26120a",
"score": "0.5969208",
"text": "def link_support; end",
"title": ""
},
{
"docid": "234e3446a9cca013dea70dcbfb26120a",
"score": "0.5969208",
"text": "def link_support; end",
"title": ""
},
{
"docid": "234e3446a9cca013dea70dcbfb26120a",
"score": "0.5969208",
"text": "def link_support; end",
"title": ""
},
{
"docid": "234e3446a9cca013dea70dcbfb26120a",
"score": "0.5969208",
"text": "def link_support; end",
"title": ""
},
{
"docid": "594f406cad087b1bb05db84187f1f216",
"score": "0.59654915",
"text": "def link\n link_name || class_name\n end",
"title": ""
},
{
"docid": "ead77b2a66fecd406e01484950abbd88",
"score": "0.595485",
"text": "def links\n @links ||= {}\n end",
"title": ""
},
{
"docid": "792c5747253fc960fd04ff6efc18db5c",
"score": "0.5951761",
"text": "def link\n object[\"link\"]\n end",
"title": ""
},
{
"docid": "7117b8e3b36e88ca500ba549195c3ede",
"score": "0.594595",
"text": "def link_bylines(bylines, links)\n bylines.map do |byline|\n if !!links && byline.user.try(:is_public)\n link_to byline.display_name, byline.user.public_path\n else\n byline.display_name\n end\n end\n end",
"title": ""
},
{
"docid": "7487752e1b3257a9c91235ed58b43e5d",
"score": "0.59102225",
"text": "def link\n return @link\n end",
"title": ""
},
{
"docid": "e15f194083b1c1d0e7fe449e40322886",
"score": "0.5907591",
"text": "def link_pattern\n end",
"title": ""
},
{
"docid": "3bef0edbec04346da83554f1a4f97573",
"score": "0.59067076",
"text": "def find_link\r\n @linkable.link if @linkable.present?\r\n end",
"title": ""
},
{
"docid": "7763ce0eb331eda8b212cf1b577e82ce",
"score": "0.5902289",
"text": "def extended_links!\n l = (links | links_of_repos).uniq\n l.sort_by(&:published_at).reverse\n end",
"title": ""
},
{
"docid": "666004de9ca086e09dd95ca190657ba6",
"score": "0.5902138",
"text": "def links\n each_link.to_a\n end",
"title": ""
},
{
"docid": "3dd49887637dd23b2647e769c9ddc4e1",
"score": "0.5896704",
"text": "def prepare_links!\n links_def = self.class.find_links_definition or return\n links_def.rel2block.each do |link|\n links << links_def.sought_type.from_attributes({ # create Hyperlink representer.\n \"rel\" => link[:rel],\n \"href\" => run_link_block(link[:block])})\n end\n end",
"title": ""
},
{
"docid": "10da8672b8fc0dd45d07480e8702ce60",
"score": "0.58717394",
"text": "def prepare_links\n links = []\n\n @dependencies.each do |dependency|\n link_name = @attributes[:links][dependency.attributes[:label]]\n links << \"#{dependency.stats['Id']}:#{link_name}\"\n end\n\n links\n end",
"title": ""
},
{
"docid": "7e2f68bb428ffb78ffddf0d1e073915d",
"score": "0.5867124",
"text": "def record_for(link_def); end",
"title": ""
},
{
"docid": "d4476c3a46ce116fdc849e731bdd73e2",
"score": "0.5849582",
"text": "def links\n nil\n end",
"title": ""
},
{
"docid": "4f5e4a0ed32991d52b240faec94a2890",
"score": "0.58468086",
"text": "def link\n self.class.fetch_link(@resource.value(:name))\n end",
"title": ""
},
{
"docid": "11b26f3e112dad481e18b06f9817461b",
"score": "0.5841268",
"text": "def links\n attribute_hash '//ald:links/ald:link', %w[name description href]\n end",
"title": ""
},
{
"docid": "6ed478ad7e7687aa4330e6c2f1ea5147",
"score": "0.5832595",
"text": "def meta_links(object)\n return {} unless current_user\n\n {}.tap do |links|\n links[:comments] = pathify_comments(object)\n links[:edit_tags] = api_set_tags_path if\n (object.editable_by?(@context) && object.owned_by?(@context)) ||\n @context.can_administer_site?\n end\n end",
"title": ""
},
{
"docid": "e3d220082fab4900cf79dcb540a456d4",
"score": "0.58195",
"text": "def links\n links = []\n\n # 1. Related_URL\n if dif.Related_URL?\n\n dif.Related_URL.each do | link |\n\n if link.URL_Content_Type? and link.URL_Content_Type.Type?\n dif_type = link.URL_Content_Type.Type\n else\n dif_type = nil\n end\n\n rel = case dif_type\n when \"GET DATA\" then \"data\"\n when \"VIEW PROJECT HOME PAGE\" then \"project\"\n when \"VIEW EXTENDED METADATA\" then \"metadata\"\n when \"GET SERVICE\" then \"service\"\n when \"VIEW RELATED INFORMATION\", \"\", nil then \"related\"\n else dif_type\n end\n\n link.URL.each do | url |\n\n links << {\n \"rel\" => rel,\n \"href\" => url,\n \"title\" => link.Description,\n \"type\" => \"text/html\",\n }\n end\n end\n end\n\n # 2. Link to parent metadata\n unless object.Parent_DIF.nil?\n dif.Parent_DIF.each do | parent |\n\n links << {\n \"rel\" => \"parent\",\n \"href\" => base+uuid(self.class.uri(parent))+\".json\",\n \"type\" => \"application/json\"\n }\n\n end\n end\n\n # 3. Links to DOI and \"Online Resource\" (metadata)\n # @todo\n\n if dif.Entry_ID =~ /^(org[.|-]polarresearch\\-)/\n links << {\n \"rel\" => \"via\",\n \"href\" => \"http://risapi.data.npolar.no/oai?verb=GetRecord&metadataPrefix=dif&identifier=oai:ris.npolar.no:#{dif.Entry_ID}\",\n \"type\" => \"application/json\"\n }\n end\n\n # Links to GCMD project on api.npolar.no\n #unless dif.Project.nil?\n # projects = Gcmd::Concepts.new.tuples(\"projects\")\n #\n # links += dif.Project.map {|p|\n # id, label = projects.select { |tup | tup[1] == p[\"Short_Name\"]}[0]\n # unless id.nil?\n # link(\"/gcmd/concept/#{id}.json\", \"project\", label, \"application/json\")\n # else\n # [] #link(\"/gcmd/concept/?q=#{label}&title=false&fields=*&format=json\", \"project\", label, \"application/json\")\n # end\n #\n # }\n #end\n\n links\n end",
"title": ""
},
{
"docid": "4a7e96abc0dc56d6eaa7979249e0b236",
"score": "0.5804972",
"text": "def link_to\n h.link_to object.name, h.user_path(object)\n end",
"title": ""
},
{
"docid": "a79fb81c5ce92082775480fbffbfe1f2",
"score": "0.57990843",
"text": "def additional_link_for(object)\n end",
"title": ""
},
{
"docid": "867ca3e638adfccf89a3c36c322aa128",
"score": "0.579694",
"text": "def link\n super\n end",
"title": ""
},
{
"docid": "40a339bfcb4b782c2bd10be9e3a15a4b",
"score": "0.5794727",
"text": "def game_link\n h.link_to object.title, object\n end",
"title": ""
},
{
"docid": "68c05b72c2777ddd8b0e75b5b3eef5a1",
"score": "0.57909",
"text": "def links\n collection.map(&:link).join(', ')\n end",
"title": ""
},
{
"docid": "45f88fb807f68716a26e845737f4eaf5",
"score": "0.5789255",
"text": "def link_name\n if ( current_ability.admin? || current_ability.can?(:read, id) )\n first_title\n else\n 'File'\n end\n end",
"title": ""
},
{
"docid": "93ef3f38acf1bc5eb4923edf6ca28596",
"score": "0.5788925",
"text": "def link\n @attributes[:link]\n end",
"title": ""
},
{
"docid": "cef471cb4574105aca3fd0c964a96e5b",
"score": "0.5787212",
"text": "def autogen_link(node, name, local_attr, remote_attr); end",
"title": ""
},
{
"docid": "66e09f00dd74f19dd20f8e2523fe403c",
"score": "0.57795423",
"text": "def create_links\n end",
"title": ""
},
{
"docid": "66e09f00dd74f19dd20f8e2523fe403c",
"score": "0.57795423",
"text": "def create_links\n end",
"title": ""
},
{
"docid": "66ce3514a03061f186c70d8d61fcc1d2",
"score": "0.577595",
"text": "def my_code\n links = ActiveSupport::OrderedHash.new\n links[\"Beer for Textbooks\"] = {:url => \"http://www.beerfortextbooks.com\", :description => \"A website I built during a Startup Weekend. The title says it all.\"}\n links[\"Easy Unfriend\"] = {:url => \"https://chrome.google.com/webstore/detail/gghpnhoakonhhpjbalfjgmfkejaiidih?ct=author\", :github => \"https://github.com/djhopper01/Easy-Unfriend\", :description => \"A Chrome extension that helps you unfriend people on Facebook.\"}\n links[\"Shoutfire\"] = {:github => \"https://github.com/djhopper01/shoutfire\", :description => \"An Android application with a MySQL/PHP backend. Users chat with each other, but only see the last 100 messages.\"}\n links\n end",
"title": ""
},
{
"docid": "96c339c16a0e64345747fde593d83864",
"score": "0.57713073",
"text": "def handleLink(result)\n link = nil\n if !result['sakai:pooled-content-url'].nil?\n link = result['sakai:pooled-content-url']\n else\n $LOG.error(\"no URL found in link: #{result}\")\n return\n end\n\n # figure out if this is a link to OAE content\n link.scan(/#{@host}\\/content#p=(.*)/) do |contentId|\n\n # obtain the content item and process it as if it had been included in the collection instead of linked\n $LOG.info \"link has content id: #{contentId[0]}\"\n uri = URI(@host + \"/p/#{contentId[0]}.infinity.json\");\n\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n request = Net::HTTP::Get.new uri.request_uri\n request.basic_auth('admin', @password)\n response = http.request request\n end\n\n handleLibraryItem(JSON.parse(response.body))\n\n return\n end\n\n # if this is not OAE content, simply include the link in index file\n currentIndexFile().write(\"<li>Link: <a href=\\\"#{link}\\\">#{result['sakai:pooled-content-file-name']}</a></li>\")\n end",
"title": ""
},
{
"docid": "5b5127454d47f8c978136d7aa3c07f78",
"score": "0.5761044",
"text": "def links\n @links\n end",
"title": ""
},
{
"docid": "714fdc68ec485e4034ba45b3f9dd7312",
"score": "0.57554525",
"text": "def document_link_provider; end",
"title": ""
},
{
"docid": "a5c4e1207f4f2437a8d9c94e56ab7401",
"score": "0.5754972",
"text": "def convert_path_to_link(path)\n name_list = get_name_list(path)\n urls = create_sets_url(name_list)\n return urls, name_list\nend",
"title": ""
},
{
"docid": "14c618bbee34859df73934b125423b29",
"score": "0.5748456",
"text": "def file_link\n \th.link_to model.title , model.attached_doc.url if model.attached_doc && h.can?(:read , model)\n end",
"title": ""
},
{
"docid": "5120ba55d52278cd6b18bfe19b415b20",
"score": "0.57418436",
"text": "def get_links(group, key)\n\t\titems = Menu.where(group: group, key: key).includes(:link)\n\t\titems.map(&:link_h)\n\tend",
"title": ""
},
{
"docid": "592c12a4b8268b968cb330b79f3d7ac7",
"score": "0.5740161",
"text": "def linked\n @linked\n end",
"title": ""
},
{
"docid": "89c76bab60320a011d95f0d1daa202fa",
"score": "0.57387245",
"text": "def used_to_make_permalink\n name\n end",
"title": ""
},
{
"docid": "bd5a688892cc461817f3d7b9c3c427f4",
"score": "0.5732019",
"text": "def opendap_link(granule)\n result = nil\n if @template\n result = @template.expand(decorate(granule)).to_s\n Rails.logger.info(\"Using template: #{result}, #{@template.inspect}\")\n else\n result = self.class.opendap_link(@collection_id, granule)\n Rails.logger.info(\"Using metadata: #{result}\")\n end\n result\n end",
"title": ""
},
{
"docid": "0be02e784c419055fa820e5eb3cc05f3",
"score": "0.5730661",
"text": "def rels; end",
"title": ""
},
{
"docid": "0be02e784c419055fa820e5eb3cc05f3",
"score": "0.5730661",
"text": "def rels; end",
"title": ""
},
{
"docid": "b14d763ff87336f3c31f9e99f39cfdf9",
"score": "0.5722684",
"text": "def links # this is _not_ called by rendering as we go via ::links_config.\n tuples = (@links||[]).collect { |link| [link.rel, link] }\n # tuples.to_h\n ::Hash[tuples] # TODO: tuples.to_h when dropping < 2.1.\n end",
"title": ""
},
{
"docid": "d0d862c3c3bcd039843e12f6498bee87",
"score": "0.5719428",
"text": "def links\n return {} unless current_user\n\n # rubocop:disable Metrics/BlockLength\n {}.tap do |links|\n links[:show] = file_path(object)\n links[:user] = user_path(object.user.dxuser)\n links[:space] = space_path if object.in_space?\n # track single object\n links[:track] = track_object\n\n # GET download single file\n links[:download] = download_api_file_path(object)\n # POST download_list files\n links[:download_list] = download_list_api_files_path\n # POST Authorize URL - to move to api\n links[:link] = link_file_path(object)\n\n # publish single file if it is not public already\n links[:publish] = publish_object unless object.public?\n # POST /api/files/copy copy_api_files\n links[:copy] = copy_api_files_path\n\n # POST: Add file\n links[:add_file] = api_create_file_path\n # POST: Add folder\n links[:add_folder] = create_folder_api_files_path\n\n # GET: File origin object data { type, uid }\n links[:origin_object] = origin_object\n\n # link to license page if exists\n links[:show_license] = license_path(object.license.id) if object.license\n\n if object.owned_by_user?(current_user)\n unless object.in_space? && member_viewer?\n links[:rename] = rename_file_path(object)\n # POST: /api/files/remove - Delete file(s) & folder(s), being selected\n links[:remove] = remove_api_files_path\n # POST associate item to a license\n links[:license] = \"/api/licenses/:id/license_item/:item_uid\" if licenseable\n if object.license\n # GET UserFile license object if exists\n links[:object_license] = api_license_path(object.license&.id)\n # POST detach license from item\n links[:detach_license] = \"/api/licenses/:id/remove_item/:item_uid\"\n end\n # POST: Move file(s) and folder()s) to other folder\n links[:organize] = move_api_files_path\n end\n # PUT edit a single file\n links[:update] = api_files_path(object)\n\n # POST /api/attach_to: api_attach_to_notes, discussions, answers\n links[:attach_to] = api_attach_to_notes_path\n end\n\n if current_user.can_administer_site?\n # PUT /api/files/feature\n links[:feature] = feature_api_files_path\n end\n end\n # rubocop:enable Metrics/BlockLength\n end",
"title": ""
},
{
"docid": "a461cf7d65a0012829c2b655317d339b",
"score": "0.57114786",
"text": "def self_link; end",
"title": ""
},
{
"docid": "b753bde949708e4d5bd60259a665dddf",
"score": "0.5707547",
"text": "def title_link\n h.link_to object.title, [article.group, article], title: object.title, rel: 'bookmark'\n end",
"title": ""
},
{
"docid": "623280fdd9074687d39d827d160e6086",
"score": "0.57060033",
"text": "def sorts_with_links\n [\n [summon_search_cmd('setSortByRelevancy()'), 'Relevance'],\n [summon_search_cmd('setSort(PublicationDate:desc)'), 'Published Latest'],\n [summon_search_cmd('setSort(PublicationDate:asc)'), 'Published Earliest']\n ]\n end",
"title": ""
},
{
"docid": "e38f0e3e47f401d7a27d2f7077c0f783",
"score": "0.57013917",
"text": "def dts_linkbases\n end",
"title": ""
},
{
"docid": "1c4aaa179b47781ce144e3eeb54156c6",
"score": "0.5700762",
"text": "def links\r\n @links.keys\r\n end",
"title": ""
}
] |
a91a78cabf28d1e294cae77267b69bca
|
Ask for a password Check password length for looping Check for letter 'z' edge case Loop through password using index, getting index in alphabet string corresponding to password letter if letter 'z' change letter at index to 'a' Change password by advancing each letter one letter forward using index Return encryped password
|
[
{
"docid": "155de068151f52bee7e8b04ad1079850",
"score": "0.7897026",
"text": "def encrypt(password)\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\nindex = 0\nwhile index < password.length\n\t#get letter of password at index\n\tletter = password[index]\n\t#get index number of same letter in alphabet string.\n\ta = alphabet.index(letter)\n\t#check for edge case, then replaces letter at index \n\t#with letter one forward.\n\tif a == 25\n\t\t#Edge case, if it's an 'z', make it go \"forward\" to 'a'\n\t\tpassword[index] = alphabet[0]\n\telse\n\t\t#assign letter at index the letter + 1 in alphabet index\n\t password[index] = alphabet[a + 1]\n\tend \n\tindex += 1\n\tpassword\nend\n#'p' returns the value\np password\nend",
"title": ""
}
] |
[
{
"docid": "fefd2ee4c35b568d575b2df49e3b4265",
"score": "0.8017606",
"text": "def encrypt(password)\nindex = 0\nwhile index < password.length\n str = \"zabcdefghijklmnopqrstuvwxyza\"\n current_letter = password[index]\n # For password \"hello\", expect first current2_letter to be \"h\"\n # Find the index of the current letter in the string. Store in variable current_letter_position.\n # Advance the current letter position by 1. Store in variable encrypted_letter_position.\n # Find the letter that corresponds to encrypted_letter_position. Store in variable encrypted_letter_position.\n current_letter_position = str.index(current_letter)\n encrypted_letter_position = current_letter_position+1\n encrypted_letter = str[encrypted_letter_position]\n password[index] = encrypted_letter\n index +=1\nend\nreturn password\nend",
"title": ""
},
{
"docid": "0cd60fffca6c511e9601676fffb92785",
"score": "0.79880387",
"text": "def encrypter(password)\n index = 0\n\n while index < password.length\n str = \"abcdefghijklmnopqrstuvwxyza\" #added 'a' to end of alphabet in case password contains a 'z'. Otherwise, Ruby would return TypeError message - no implicit conversion of nil into string\"#\n current_letter = password[index]\n current_letter_position = str.index(current_letter)\n encrypted_letter_position = current_letter_position+1\n encrypted_letter = str[encrypted_letter_position]\n password[index] = encrypted_letter\n index +=1\n end\n return password\nend",
"title": ""
},
{
"docid": "81b5a2a1fc1b9434351e56386dfa99bd",
"score": "0.78955925",
"text": "def encrypt(password)\r\n\tdef ascend (letter)\r\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\t\tvalue=alphabet.index(letter)+1\r\n\t\treturn alphabet[value]\r\n\tend\r\n\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] == \"z\"\r\n\t\t\tpassword[index] = \"a\"\r\n\t\telse\r\n\t\t\tpassword[index]=ascend(password[index])\r\n\t\tend\r\n\tindex += 1\r\n\tend\r\npassword\r\nend",
"title": ""
},
{
"docid": "dfe2261b225634a2035042b7a5f9c89a",
"score": "0.7883186",
"text": "def encrypt(password)\n index = 0\n new_password = \"\"\n letters = \"abcdefghijklmnopqrstuvwxyz\"\n\n while index < password.length\n integers = letters.index(password[index]) #convert letters to integers\n if integers == 25\n restart_index = 0\n else\n restart_index = integers + 1\n end\n new_password += letters[restart_index]\n index += 1\n end\n new_password\nend",
"title": ""
},
{
"docid": "669548569b42bddee94cb161f32d797e",
"score": "0.78485674",
"text": "def encrypt(password)\n index = 0\n until index == password.to_s.length #The .to_s was helpful in overcoming nil-related errors\n if password[index] == \"z\" #Handles edge case\n password[index] = \"a\"\n elsif password[index] == \" \" #Handles blank spaces\n password[index] = \" \"\n else\n password[index] = password[index].next #Primary encryption rule\n end\n index += 1 #Progresses encryption to the character in the next index position\n end\nend",
"title": ""
},
{
"docid": "d0a83573aeadd1ae1e317bf471251e49",
"score": "0.7837735",
"text": "def encrypt(password)\r\n index = 0\r\n # Loop over string letters\r\n while index < password.length\r\n # Accounting for spaces\r\n if password[index] == \" \"\r\n index += 1\r\n end\r\n # Account for Z edge case\r\n if password[index] == \"z\"\r\n password[index] = \"a\"\r\n end\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n letterofpassword = password[index]\r\n position = alphabet.index(letterofpassword)\r\n position += 1\r\n password[index] = alphabet[position]\r\n index += 1\r\n end\r\n p password\r\nend",
"title": ""
},
{
"docid": "d5cadd15d1a7691ed776c039d4e0deb2",
"score": "0.78274035",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n #if passord[index] is equal to a \"z\" ... return an \"a\"\n \tif password[index] == \"z\"\n \t\tpassword[index] = \"a\"\n #else\n else\n password[index] = password[index].next!\n end\n index += 1\n end\n return password\nend",
"title": ""
},
{
"docid": "7428ce0f2f4ee2003b9c182e85577a03",
"score": "0.77860785",
"text": "def encrypt(password)\n enrypted = \"\"\n i = 0\n while i < password.length do\n # password.length.downto(0) do |i|\n if password[i] == \"z\"\n enrypted += \"a\"\n else\n enrypted += password[i].next\n end\n i += 1\n end\n return enrypted\nend",
"title": ""
},
{
"docid": "2ca055ccec76751cde1047e532e70daf",
"score": "0.77790755",
"text": "def encrypt(password)\n\tdef ascend (letter)\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\t\tvalue=alphabet.index(letter)+1\n\t\treturn alphabet[value]\n\tend\n\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] == \"z\"\n\t\t\tpassword[index] = \"a\"\n\t\telse\n\t\t\tpassword[index]=ascend(password[index])\n\t\tend\n\tindex += 1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "032e10d06baf6fefcbe16491a44fa710",
"score": "0.77711",
"text": "def encrypt(password)\n #e_pw is intended to store encrypted password string\n e_pw = password\n #i is for iteration\n i = password.length\n while i > 0\n if e_pw[i-1] == \"z\"\n e_pw[i-1] = \"a\"\n else \n e_pw[i-1] = password[i-1].next\n end\n i-=1\n end\n puts(\"encrypted: \"+e_pw.to_s)\n e_pw.to_s\nend",
"title": ""
},
{
"docid": "584cb375b0651c18037fa231385add00",
"score": "0.7766994",
"text": "def decrypt(password)\n index = 0 \n alphabet = \" abcdefghijklmnopqrstuvwxyz \"\n\n while index < password.length\n \tif password[index] != \"a\"\n \tpassword[index] = alphabet[(alphabet.index(password[index]) -1 )]\n \tindex += 1\n elsif password[index] == \"a\"\n \tpassword[index] = \"z\"\n \tindex += 1\n end\n \n \n end\n\n p password\n\n #puts encrypt\nend",
"title": ""
},
{
"docid": "dcb2b923acb03e066a4e383929d27072",
"score": "0.7758822",
"text": "def encrypt(password)\n index = 0\n encrypted = \"\"\n while index < password.length\n if password[index] == \"z\"\n encrypted += \"a\"\n index += 1\n else\n encrypted += password[index].next\n index += 1\n end\n end\n return encrypted\nend",
"title": ""
},
{
"docid": "714ce05e904f2090582f492355441e85",
"score": "0.77463984",
"text": "def encrypt(password)\n a = 0\n while a < password.length\n if password[a] != \"z\"\n password[a] = password[a].next\n else\n password[a] = \"a\"\n end\n a += 1\n end\n # puts password\n return password\nend",
"title": ""
},
{
"docid": "4ae06a0e7ca9a5aa32eeb7ce72dfad6d",
"score": "0.7714558",
"text": "def encryptor(password)\r\n\r\n index = 0\r\n while index < password.length\r\n \t\tif password[index] != \"z\"\r\n \t\t password[index] = password[index].next\r\n\r\n \t\telsif\tpassword[index] == \" \"\r\n\r\n \t\telse\r\n \t\t\tpassword[index] = \"a\"\r\n\r\n \tend\r\n\r\n \tindex += 1\r\n end\r\n puts \"#{password}\"\r\n return password\r\nend",
"title": ""
},
{
"docid": "1ed53710b1e2fb3c9700daee10da7350",
"score": "0.7703406",
"text": "def encrypt(password)\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n i = 0\n new_password = \"\"\n while i < password.length\n alpha_index = alpha.index(password[i]).next\n if alpha[alpha_index] == nil\n alpha[alpha_index] = \"a\"\n end\n new_password += alpha[alpha_index]\n i += 1\n end\n p new_password\nend",
"title": ""
},
{
"docid": "0170a82105821b7bc2be535119295c28",
"score": "0.76202106",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n if\n password[index] == \"z\"\n password[index] = \"a\"\n else\n password[index] = password[index].next!\n end\n if\n password[index] == \"!\"\n password[index] = \" \"\n end\n index +=1\n end\np password\nend",
"title": ""
},
{
"docid": "5ea53cbbd73a248eda8feaa772f4e7ae",
"score": "0.7600516",
"text": "def encrypt(password)\r\n index = 0\r\n while index < password.length\r\n #shift the letter at the position to next one, then advances the loop\r\n password[index] = password[index].next!\r\n index += 1\r\n end\r\n password = password.gsub(/ab/ , \"a\")\r\nend",
"title": ""
},
{
"docid": "3b7cb1db687ccaf037c781ad134b4348",
"score": "0.75978154",
"text": "def decrypt(password)\n index = 0\n new_password = \"\"\n letters = \"abcdefghijklmnopqrstuvwxyz\"\n\n while index < password.length\n integers = letters.index(password[index]) #convert letters to integers\n if integers == 0\n restart_index = 25\n else\n restart_index = integers - 1\n end\n new_password += letters[restart_index]\n index += 1\n end\n new_password\nend",
"title": ""
},
{
"docid": "82af38578b809daf45beea89e2134fbf",
"score": "0.75975883",
"text": "def decrypter(encrypted_password)\n index = 0\n\n while index < encrypted_password.length\n str = \"abcdefghijklmnopqrstuvwxyz\"\n current_letter = encrypted_password[index]\n\n #For password of \"hello\", expect first current_letter to be \"h\"\n #Find the index of current letter in string. And store in variable current_letter_position\n #Reduce current_letter_position by 1. Store in variable decrypted_letter_position\n #Find the letter that corresponds to decrypted_letter_position from str variable. Store in variable decrypted_letter\n #Replace characters in encrypted password with decrypted_letter.\n current_letter_position = str.index(current_letter)\n decrypted_letter_position = current_letter_position-1\n decrypted_letter = str[decrypted_letter_position]\n if current_letter == \"a\"\n decrypted_letter = \"z\"\n end\n encrypted_password[index] = decrypted_letter\n index +=1\n end\n return encrypted_password\nend",
"title": ""
},
{
"docid": "4977f54e08ef01b4c81add09edc0384e",
"score": "0.7596431",
"text": "def encrypt(string)\n counter = 0\n password = \"\"\n until counter == string.length\n if string[counter] == 'z'\n password = 'a'\n else\n password = string[counter].next + password\n end \n counter +=1\n end\n password.reverse\n\nend",
"title": ""
},
{
"docid": "6fc41013b79e4bdb55e9df3a11a31e55",
"score": "0.7582666",
"text": "def encrypt(pwd)\nencrypted = \"\"\nletters = \"abcdefghijklmnopqrstuvwxyz\"\npwd_counter = 0\nwhile pwd_counter < pwd.length\n letter_counter = 0\n while letter_counter < letters.length\n if pwd[pwd_counter] == letters[letter_counter]\n encrypted += letters[letter_counter - 25]\n end\n # p pwd[index]\n letter_counter += 1\n end\n pwd_counter += 1\nend\nencrypted\nend",
"title": ""
},
{
"docid": "959b37261a7f7a7c784b9b7304583bb7",
"score": "0.75766116",
"text": "def encrypt(password)\r\n\tindex = 0\r\n\tencrypted_pass=\"\"\r\n\r\n\twhile index < password.length\r\n\t\tif password[index] == \"z\"\r\n\t\t\tencrypted_pass += \"a\"\r\n\t\telse\r\n\t\t\tencrypted_pass+= password[index].next\r\n\t\tend\r\n\t\tindex+=1\r\n\tend\r\n\r\n\tencrypted_pass\r\nend",
"title": ""
},
{
"docid": "6eb6cb158b1180e00c56909d27b92a76",
"score": "0.7563171",
"text": "def encrypt(password)\n# initialize index (=0)\nindex = 0\n\n# variable = string (and set up a variable = length of string.)\n# puts \"Please enter your password.\"\n# password = gets.chomp.downcase\n\n# write a while loop\n\n# while the index is less than the variable length the loop will repeat\nwhile index < password.length\n password[index] = password[index].next\n # add strings together\n index+=1\n # pass_array_2 = password.split(\"\")\n # for i in pass_array = \"z\"\n # print \"a\"\n # end\nend\nputs password\nend",
"title": ""
},
{
"docid": "7950c29b8a687430e30e0615461703d6",
"score": "0.7554218",
"text": "def decrypter_program(password)\n index = 0\n #used for getting a letter's position within the alphabet:\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n #empty variable for newly decrypted string:\n decrypted = \"\"\n #empty variable to calculate new index number to change the letter:\n new_index_num = \"\"\n #loop through all letters in the string:\n while index < password.length\n if password[index] == \"a\"\n decrypted += \"z\"\n elsif password[index] == \" \"\n decrypted += \" \"\n else\n new_index_num = alphabet.index(password[index]) - 1\n decrypted += alphabet[new_index_num]\n end\n index += 1\n end\n p decrypted\nend",
"title": ""
},
{
"docid": "b414f69a8cf36615ca617a4ac4ca20ea",
"score": "0.7550767",
"text": "def encrypt(sample)\n index = 0\n password = sample\n while index < password.length\n unless password[index] == \" \"\n if password[index] == \"z\"\n password[index] = \"a\"\n else\n password[index] = password[index].next!\n end\n end\n index += 1\n end\n return password\nend",
"title": ""
},
{
"docid": "6039ca817db7cb3bd2b557c6a2aac234",
"score": "0.7537198",
"text": "def encrypt(secret_password)\n index = 0\n \n while index < secret_password.length\n if secret_password[index] == \"z\"\n secret_password[index] = \"a\"\n elsif secret_password[index] != \" \"\n secret_password[index] = secret_password[index].next\n end\n \n index += 1\n end\n \n secret_password\n \nend",
"title": ""
},
{
"docid": "717ae18f9e9326b6dcfd85905bfa9842",
"score": "0.75228673",
"text": "def decrypt(password)\n decrypter = \"abcdefghijklmnopqrstuvwxyz\"\n a = 0\n b = 0\n while a < password.length\n b = decrypter.index(password[a])\n #if b == 0\n # password[a] = \"z\"\n #else\n #Edge case is provided above. But on testing by commenting out the Edge case codes;we found that the Edge case provision is not necessary.\n password[a] = decrypter[b-1]\n #end\n a += 1\n end\n # puts password\n return password\nend",
"title": ""
},
{
"docid": "827cf8493ee885d127b42c511d42f658",
"score": "0.7522349",
"text": "def encrypt(input)\r\n new_value = 0\r\n new_password = \"\"\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n times_run = 0\r\n\r\n until times_run == input.length\r\n new_value = alphabet.index(input[times_run]) + 1\r\n if new_value > 25\r\n new_value = new_value - 26\r\n end\r\n new_password += alphabet[new_value]\r\n times_run += 1\r\n\r\n end\r\n puts \"Your encrypted password is #{new_password}.\"\r\nend",
"title": ""
},
{
"docid": "24fbac1fac82dffa24c3de04cff77097",
"score": "0.7511927",
"text": "def encrypter_program(password)\n index = 0\n #declare empty variable for encrypted string\n encrypted = \"\"\n #loop through all the string's letters\n while index < password.length\n if password[index] == \"z\"\n encrypted += \"a\"\n elsif password[index] == \" \"\n encrypted += \" \"\n else\n password[index] = password[index].next!\n encrypted += password[index]\n end\n index += 1\n end\n p encrypted\nend",
"title": ""
},
{
"docid": "6ce31776e68f18a863f5b2286c43581e",
"score": "0.7504295",
"text": "def encrypt_password(secret_password)\n\ti = 0\nwhile i < secret_password.length\n\tif secret_password[i] == \"z\"\n\t\tsecret_password[i] = \"a\"\n\telse\n\t\tsecret_password[i] = secret_password[i].next\n\tend\n\ti += 1\nend\np secret_password\nend",
"title": ""
},
{
"docid": "e222a33c48919fc582e69fd71936ad55",
"score": "0.7488345",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n next if password[index] == \" \"\n \n if password[index] == \"z\"\n password[index] = \"a\"\n else\n password[index] = password[index].next\n end\n \n index += 1\n end\n p password\nend",
"title": ""
},
{
"docid": "bd6ac5fe0f8e1c379593db60afeaf751",
"score": "0.74704623",
"text": "def encrypt(password)\r\n\r\n# Store starting point index, alphabet, and blank encrypted variable\r\n\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n encrypted = \"\"\r\n\r\n# Loop through each letter of the password starting at index.\r\n\r\n while index < password.length\r\n\r\n# If the character is not a space\r\n if password[index] != \" \"\r\n \r\n# Store newindex as the alphabetical index of the current password letter\r\n\r\n newindex = alphabet.index(password[index])\r\n\r\n# If the newindex + 1 equals the alphabet length reset index back to -1\r\n# so 'z' will become 'a'\r\n\r\n if newindex + 1 == alphabet.length\r\n newindex = -1\r\n end\r\n\r\n# Set encrypted[index] to the next letter of the alphabet\r\n\r\n encrypted[index] = alphabet[newindex + 1]\r\n \r\n# If character is a space, set encrypted[index] to a space as well\r\n\r\n else \r\n encrypted[index] = \" \"\r\n end\r\n\r\n# Raise index by 1 and start next iteration\r\n\r\n index += 1\r\n end\r\n\r\n# After all letters have been adjusted, return encrypted\r\n \r\n return encrypted\r\nend",
"title": ""
},
{
"docid": "9676183b2a6b1970ef3924e0b9c6e0a8",
"score": "0.74673927",
"text": "def encrypt(password)\r\n# Loop through each letter of the password by index.\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n encrypted = \"\"\r\n while index < password.length\r\n# If the character is a space, skip it\r\n\r\n# Otherwise advance that letter via index + 1\r\n\t letter = password[index]\r\n\t newindex = alphabet.index(letter)\r\n# If the index + 1 is greater than 25 reset it back to 0\r\nif newindex + 1 == alphabet.length\r\n\t newindex = -1\r\n\t end\r\n\t newletter = alphabet[newindex + 1]\r\n encrypted[index] = newletter\r\n\t index += 1\r\n# Store the next letter in the variable\r\n end\r\n return encrypted\r\nend",
"title": ""
},
{
"docid": "792c2edba38b228b22a94af73c7b17d7",
"score": "0.7454179",
"text": "def decryptor(password)\r\n\r\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\r\n index = 0\r\n while index < password.length\r\n\r\n \t\tif password[index] == \" \"\r\n\r\n\t\t\telse\r\n \t\t temp = alphabet.index(password[index])\r\n \t\t temp -=1\r\n \t\t password[index] = alphabet[temp]\r\n\r\n \tend\r\n\r\n \tindex += 1\r\n end\r\n\r\n puts \"#{password}\"\r\nend",
"title": ""
},
{
"docid": "3242d12c0125a2d8a2cddd1056578fa1",
"score": "0.7452899",
"text": "def encrypt(password)\n\tindex = 0\n\tencrypted_pass=\"\"\n\n\twhile index < password.length\n\t\tif password[index] == \"z\"\n\t\t\tencrypted_pass += \"a\"\n\t\telse\n\t\t\tencrypted_pass+= password[index].next\n\t\tend\n\t\tindex+=1\n\tend\n\n\tencrypted_pass\nend",
"title": ""
},
{
"docid": "a9e9b469f2159b22a232d5c58f26308f",
"score": "0.7438216",
"text": "def decrypt(encrypted_password)\nindex = 0\nwhile index < encrypted_password.length\n str = \"zabcdefghijklmnopqrstuvwxyza\"\n current_letter = encrypted_password[index]\n #For password of \"hello\", expect first current_letter to be \"h\"\n #Find the index of current letter in string. And store in variable current_letter_position\n #Reduce current_letter_position by 1. Store in variable decrypted_letter_position\n #Find the letter that corresponds to decrypted_letter_position from str variable. Store in variable decrypted_letter\n #Replace characters in encrypted password with decrypted_letter.\n current_letter_position = str.index(current_letter)\n decrypted_letter_position = current_letter_position-1\n decrypted_letter = str[decrypted_letter_position]\n encrypted_password[index] = decrypted_letter\n index +=1\nend\nreturn encrypted_password\nend",
"title": ""
},
{
"docid": "cfa23d3101387b13e12db9e540fba398",
"score": "0.74293524",
"text": "def decrypt(password)\n index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while index < password.length\n letters = password[index]\n number = alphabet.index(letters)\n new_number = number - 1\n password[index] = alphabet[new_number]\n index += 1\n end\n p password\n end",
"title": ""
},
{
"docid": "459b1015238e12cc037b96aeae60b802",
"score": "0.7413161",
"text": "def encrypt(password)\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] == \" \" \r\n\t\t\tpassword[index] \r\n\t\telsif password[index] == \"z\"\r\n\t\t\tpassword[index] = \"a\"\r\n \t else\r\n\t\t\tpassword[index] = password[index].next!\r\n\t\tend\r\n\t index += 1\r\n\tend \r\n\treturn password \r\nend",
"title": ""
},
{
"docid": "2375ae86138b03c0b320b099e531722e",
"score": "0.74072474",
"text": "def encrypt(password)\n counter = 0\n #declare emty string to add to\n result = \"\"\n #loop over the string letters\n while counter < password.length\n\t letter = password[counter]\n #eliminate edge cases\n if letter == \" \"\n result << \" \"\n elsif letter == \"z\"\n result << \"a\"\n else\n result << letter.next\n end\n counter += 1\n end\n result\nend",
"title": ""
},
{
"docid": "a3e8dcfc6d6eff24419f2bb6e920fc57",
"score": "0.7392048",
"text": "def encrypt(str) \r\n count = 0 # start at 0 since the first letter will be in index 0. \r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\" # create a string to have a reference to look for the indicies of each letter. \r\n \r\n while count < str.length # create a loop that will search each letter of the string and covert it into an index then back into a letter. \r\n if str.index(\"z\") == nil # so if z is not there, do the following steps: \r\n \r\n # create a variable that will store the indicies that Ruby has found by taking each letter of the string and converting them into indicies.\r\n make_char_a_number = alphabet.index(str[count]) \r\n \r\n # create a variable that will store the indicies and add it to 1. \r\n #(where the letters will be placed on higher indicies ex: 'a' will have an index of 1 instead of 0)\t\t \r\n str[count]= alphabet[make_char_a_number +=1] \r\n \r\n \t#create a variable that will store the indicies and convert it back to letters.\r\n back_to_char = alphabet[make_char_a_number] \r\n \r\n #create a variable that will store the converted letters.\r\n str[count] = back_to_char \r\n elsif\r\n \t# if the string contains input letter z, set variable to have output letter always be letter a\r\n str[count] == alphabet[25]\r\n str[count] = alphabet[0]\r\n else\r\n \t# otherwise, set variable to output the next letter if the string does not contain letter z\r\n str[count] = str[count].next\r\n end \r\n \r\n count += 1 # create a variable to avoid having an infinite loop\r\n end \r\n \r\n puts str # displays the new converted string\r\n str\r\nend",
"title": ""
},
{
"docid": "48dbe6253d2b6c0671683c4b2267b02b",
"score": "0.7388178",
"text": "def decrypt(password)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n index = 0\n while index < password.length\n letter = password[index]\n a = alphabet.index(letter)\n if a == 25\n password[index] = alphabet[0]\n else\n password[index] = alphabet [a - 1]\n end\n index += 1\n end\n p password\nend",
"title": ""
},
{
"docid": "61fe7b97c751c748a02c8fa65590cf48",
"score": "0.7362394",
"text": "def encrypt (password)\n\tindex = 0 \n\tlength = password.length\n\twhile index < length\n\t\tif (password[index] == \" \")\n\t\t\t\n\t\t\tpassword[index] = password[index]\n\n\t\telsif (password[index] == \"z\")\n\t\t\tpassword[index] = \"a\"\n\t\telse\n\t\t\tpassword[index] = password[index].next!\n\t\tend\n\n\t\tindex+=1\n\tend\n\tpassword\n\t \nend",
"title": ""
},
{
"docid": "3cb0d7f47cf4a898327284f9f026d410",
"score": "0.73490304",
"text": "def decrypt (password)\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\nindex = 0\nwhile index < password.length\n\t#get letter of password at index\n\tletter = password[index]\n \t#get index number of same letter in alphabet string.\n\ta = alphabet.index(letter)\n\t#check for edge case, then replaces letter at index\n\t#with letter one back.\n\tif a == 0\n\t\t#Edge case, if it's an 'a', make it go \"back\" to 'z'\n\t\tpassword[index] = alphabet[25]\n\telse\n\t\t#assign letter at index the letter - 1 in alphabet index\n\t password[index] = alphabet[a - 1]\n\tend \n\tindex += 1\nend\n#'p' returns the value\np password\nend",
"title": ""
},
{
"docid": "bfbd3859f21c2b8a3d164b05bfc21740",
"score": "0.73402876",
"text": "def encrypt(password)\n\ti = 0\n\twhile i < password.length\n\t\tif password[i] != \" \"\n\t\t\tif password[i] == \"z\"\n\t\t\t\tpassword[i] = \"a\"\t\t\t\n\t\t\telse\n\t\t\t\tpassword[i] = password[i].next\n\t\t\tend\n\t\tend\n\t\ti += 1\n\tend\n\treturn password\nend",
"title": ""
},
{
"docid": "e9cbcc55139ea4f15104333696c34291",
"score": "0.73288846",
"text": "def decrypt(encryptedpassword)\n encryptindex = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\n while encryptindex < encryptedpassword.length\n \n if encryptedpassword[encryptindex] == alphabet[0]\n encryptedpassword[encryptindex] = alphabet[25]\n else\n alphabetindex = 0\n until encryptedpassword[encryptindex] == alphabet[alphabetindex]\n alphabetindex+=1\n end\n adjustedindex = alphabetindex - 1\n encryptedpassword[encryptindex] = alphabet[adjustedindex]\n end\n\n encryptindex+=1\n end\n\np encryptedpassword\nend",
"title": ""
},
{
"docid": "b622c22b0696deaaa97016631bbc302e",
"score": "0.731737",
"text": "def encrypt(x)\n #Assign counter variable.\n counter = 0\n #Print password to be encrypted.\nputs \"Ok, so the password you wish to encrypt is:\n [#{x}]\nEasy peasy... Your password will be encrypted...\"\n #Write loop to rewrite each letter as next letter in alphabet\n while counter < x.length\n if x[counter] == \"z\"\n x[counter] = \"a\"\n else x[counter] =\n x[counter].next!\n end\n #advance the counter\n counter += 1\n end\n #Print encrypted password\n puts \"Your password is now encrypted as:\n [#{x}]\"\n #Return (now encrypted) password\n return x\nend",
"title": ""
},
{
"docid": "7fcbf27574fca7b448bccb7961643c3e",
"score": "0.73062253",
"text": "def decrypt (password)\r\n\tdef reverse (letter)\r\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\t\tvalue = alphabet.index(letter)-1\r\n\t\treturn alphabet[value]\r\n\tend\r\n\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] ==\"a\"\r\n\t\t\tpassword[index] = \"z\"\r\n\t\telse\r\n\t\t\tpassword[index] = reverse(password[index])\r\n\t\tend\r\n\t\tindex +=1\r\n\tend\r\npassword\r\nend",
"title": ""
},
{
"docid": "5a10565a2731f000f3536ae45e5bca29",
"score": "0.7279097",
"text": "def decrypt(password)\r\n index = 0\r\n # Loop over string letter\r\n while index < password.length\r\n # Accounting for spaces\r\n if password[index] == \" \"\r\n index += 1\r\n end\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n letterofpassword = password[index]\r\n position = alphabet.index(letterofpassword)\r\n position -= 1\r\n password[index] = alphabet[position]\r\n index += 1\r\n end\r\n p password\r\nend",
"title": ""
},
{
"docid": "8706c86c77c56b4c1b244ccc3ea3fadb",
"score": "0.7265152",
"text": "def decrypt(str)\r\n password = str\r\n something = 0\r\n alpha_index = 0\r\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\r\n\r\n while something < password.length do\r\n if (password[something] =~ /\\s/)\r\n str[something] = \" \"\r\n else\r\n alpha_index = alpha.index(password[something])\r\n alpha_index -= 1\r\n password[something] = alpha[alpha_index]\r\n end\r\n something += 1\r\n end\r\n puts password\r\nend",
"title": ""
},
{
"docid": "56f44c7c4b1467024c9b31451bd66106",
"score": "0.72625196",
"text": "def encrypt(word)\n index = 0\n result = \"\"\n # Iterate through each letter in the word\n while index < word.length\n # If that letter happens to be an edge case\n if word[index] == \"z\"\n result += \"a\"\n # For each letter go forward one character\n else\n result += word[index].next\n end\n index += 1\n end\n # Print the encrypted word\n puts \"Encryption completed, encrypted password is: #{result}\"\nend",
"title": ""
},
{
"docid": "392fbdadb99407097d2e2f1a2568f2f9",
"score": "0.7234013",
"text": "def encrypt(secret_password)\n\tindex = 0\n\twhile index < secret_password.length\n\t\tif secret_password[index] == \"z\"\n\t\t\tsecret_password[index] = \"a\"\n\t\telse\n\t\t\tsecret_password[index] = secret_password[index].next\n\t\tend\n\t\tindex += 1\n\tend\n\tsecret_password\nend",
"title": ""
},
{
"docid": "cd864ddbfd36984dd24417b00dbfadf6",
"score": "0.72306144",
"text": "def encrypt(password)\n next_string = \"\" #adds space to beginning of message\n i = 0\n while i < password.length\n if password[i] == \"z\"\n next_string << \"a\"\n elsif password[i] == \" \"\n next_string << \" \"\n else\n next_string << password[i].next\n end\n i += 1\n end\n next_string\nend",
"title": ""
},
{
"docid": "d1a56ee8f110ab92ba6bf64cacf6f817",
"score": "0.72030246",
"text": "def decrypt(password)\n counter = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n #declare emty string to add to\n result = \"\"\n #loop over the string letters\n while counter < password.length\n\t letter = password[counter]\n #eliminate edge cases\n if letter == \" \"\n result << \" \"\n elsif letter == \"a\"\n result << \"z\"\n else\n #Use index built in method to get the index from the alphabet minus one\t\n alph_index = alphabet.index(letter) - 1\n #add the alphabet letter coresponding to the index and add it to result string\n result << alphabet[alph_index]\n end\n counter += 1\n end\n result\nend",
"title": ""
},
{
"docid": "d528368634c2dd6aa49ff7e0bf3886ca",
"score": "0.7192705",
"text": "def encrypt(input)\n\tnew_value = 0\n\tnew_password = \"\"\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\ttimes_run = 0\n\n\tuntil times_run == input.length\n\t\tnew_value = alphabet.index(input[times_run]) + 1\n\t\t\tif new_value > 25\n\t\t\t\tnew_value = new_value - 26\n\t\t\tend\n\t\tnew_password += alphabet[new_value]\n\t\ttimes_run += 1\n\n\tend\n\tputs \"Your encrypted password is #{new_password}.\"\nend",
"title": ""
},
{
"docid": "5f4906aa5a72eec05ecc81bbf3315325",
"score": "0.71688724",
"text": "def encrypt(string)\r\n\r\n index = 0\r\n\r\n while index < string.length\r\n if string[index] == \" \"\r\n index +=1 \r\n elsif string[index] == \"z\"\r\n string[index] = \"a\"\r\n index +=1\r\n else\r\n\t string[index] = string[index].next!\r\n \tindex +=1 \r\n end\r\n end\r\n puts \"the encrypted password is #{string}\"\r\nend",
"title": ""
},
{
"docid": "d2ec84248ff5e467f91e573ecd3d35c2",
"score": "0.71596235",
"text": "def decrypt(password)\r\nindex = 0\r\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\tuntil index == password.length \r\n\tif password[index] == \" \"\r\n\t\t\tpassword[index] = \" \"\r\n\telse \r\n\t\tpassword[index] = alphabet[alphabet.index(password[index])-1]\r\n\tend\r\n\tindex = index + 1\r\n\tend\r\n\treturn password \r\nend",
"title": ""
},
{
"docid": "8bdf18c453be30bafdb7089e47c5d64c",
"score": "0.71544605",
"text": "def method_encryption (string) \r\nindex = 0\r\n\r\n while index < string.length\r\n if string[index] == \"z\"\r\n string[index] = \"a\"\r\n else\r\n string[index] = string[index].next!\r\n end\r\n index += 1\r\nend\r\nstring\r\nend",
"title": ""
},
{
"docid": "e635327fa62fe3f672750c40e0315a7f",
"score": "0.71542776",
"text": "def encrypt_method (test_string)\n index=0\n while index < test_string.length\n if test_string[index] == \"z\"\n test_string[index] = \"a\"\n else\n test_string[index] = test_string[index].next\n end\n index+=1\n end\n puts \"Encrypted password is #{test_string}\"\n return test_string\nend",
"title": ""
},
{
"docid": "21d34941987ed601e17dd4e0f8e40333",
"score": "0.71519583",
"text": "def encrypt(str)\n alpha=\"abcdefghijklmnopqrstuvwxyza\"\n index=0\n while index < str.length\n letter= str[index]\n place =\"abcdefghijklmnopqrstuvwxyz\".index(letter)\n str[index]=alpha[place+1]\n index += 1\n end\n p str\nend",
"title": ""
},
{
"docid": "a860d468befe3a46ef1dc55640155a9c",
"score": "0.7145552",
"text": "def encrypt(password)\n\tindex = 0\n\twhile index < password.length \n\t\tif password[index] != \" \" && password[index] != \"z\"\n\t\t\tpassword[index] = password[index].next\n\t\t\tindex += 1\n\t\telsif password[index] == \"z\"\n\t\t\tpassword[index] = \"z\"\n\t\t\tindex +=1\t\t\n\t\telse \n\t\t\tpassword[index] = \" \"\n\t\t\tindex +=1\n\t\tend\n\tend\n\t#puts password\n\treturn password\nend",
"title": ""
},
{
"docid": "e97a3e27e57864e61a94a38d3a91c228",
"score": "0.71408635",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n password[index] = password[index].next!\n index += 1\n end\n password.gsub!(\"!\", \" \")\n password.gsub!(\"ab\", \"a\")\n p password\nend",
"title": ""
},
{
"docid": "729cf980f4ecadfdfec063c1073fc922",
"score": "0.7134948",
"text": "def encrypt(secret_password)\n counter = 0\n\n while counter < secret_password.length\n if secret_password[counter] == \" \"\n secret_password[counter] = secret_password[counter]\n elsif secret_password[counter] == \"z\"\n secret_password[counter] = \"a\"\n else\n secret_password[counter] = secret_password[counter].next\n end\n\n counter += 1\n end\n\n return secret_password\n\nend",
"title": ""
},
{
"docid": "4db6fc330e00ffd94e98babbd2720c23",
"score": "0.71342313",
"text": "def encrypt(pass)\r\n\ti = 0\r\n\twhile i < pass.length\r\n\t\t# .ord gives you the ASCII Char code, and 122 is the char code for \"z\"\r\n\t\tif pass[i].ord == 122 #This is for in case of End case problem (\"z\".next = \"aa\")\r\n\t\t\tpass[i] = \"a\"\r\n\t\telsif pass[i].ord == 32\r\n\t\t\tcontinue #this command jumps out of the if statement without doing anything\r\n\t\telse\r\n\t\t\tpass[i] = pass[i].next\r\n\t\tend\r\n\t\ti += 1\r\n\tend\r\n\t#puts pass #for testing\r\n\treturn pass #Increases the scope of the Pass var for the decrypt(encrypt(\"swordfish\")) case\r\nend",
"title": ""
},
{
"docid": "58b7cae80c54c713d0e1c11e56560638",
"score": "0.71327895",
"text": "def decrypt (password)\n\tdef reverse (letter)\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\t\tvalue = alphabet.index(letter)-1\n\t\treturn alphabet[value]\n\tend\n\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] ==\"a\"\n\t\t\tpassword[index] = \"z\"\n\t\telse\n\t\t\tpassword[index] = reverse(password[index])\n\t\tend\n\t\tindex +=1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "1b1c3a7af350ce8e09e1847cd82c82af",
"score": "0.7131796",
"text": "def decrypt(password)\r\n# Store letter at index - 1 from the alphabet\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n decrypted = \"\"\r\n while index < password.length\r\n letter = password[index]\r\n newindex = alphabet.index(letter)\r\n if newindex - 1 == -1\r\n newindex = alphabet.length\r\n end\r\n newletter = alphabet[newindex -1]\r\n decrypted[index] = newletter\r\n index += 1\r\n end\r\n return decrypted\r\nend",
"title": ""
},
{
"docid": "d637efb7c86d12ec66c82e3f426c2336",
"score": "0.7129791",
"text": "def encrypt(password)\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] == \" \"\n\t\t\tpassword[index] = \" \"\n\t\t\telsif password[index] == \"z\"\n\t\t\t\tpassword[index] = \"a\"\n\t\t\telse\n\t\t\t\tpassword[index] = password[index].next\n\t\tend\n\t\tindex += 1\n\tend\n\tpassword\nend",
"title": ""
},
{
"docid": "87dbb0e2609dc11e9ce61ea369309266",
"score": "0.7102722",
"text": "def encrypt string\r\n var = 0\r\n x = ''\r\n while var < string.length\r\n new_letter = string[var]\r\n if new_letter == 'z'\r\n \tx = x + 'a'\r\n else\r\n \tx = x + (new_letter.next)\r\n end\r\n var += 1\r\n end\r\n return x\r\nend",
"title": ""
},
{
"docid": "193341d45887acf50bb4f7cbd8c41736",
"score": "0.7102186",
"text": "def encrypt(str)\r\n password = str.to_s\r\n n = password.length\r\n count=0\r\n secretpassword=\"\"\r\n until count == n \r\n secret = password[count]\r\n if secret ==\"z\"\r\n secret =\"a\"\r\n elsif secret ==\" \"\r\n secret = \" \"\r\n else secret =secret.next\r\n end\r\n secretpassword += secret\r\n count +=1\r\n end\r\n p secretpassword\r\nend",
"title": ""
},
{
"docid": "8ed14c9277a44a4a79f65dd734645e27",
"score": "0.71012026",
"text": "def encrypt(string1)\r\n number = 0\r\n encrypted_password = \"\"\r\n until number == string1.length\r\n if string1[number] == \" \"\r\n encrypted_password += \" \"\r\n number += 1\r\n elsif string1[number] == \"z\"\r\n encrypted_password += \"a\"\r\n number += 1\r\n end\r\n encrypted_password += string1[number].next\r\n number += 1\r\n end\r\n puts encrypted_password\r\n encrypted_password\r\nend",
"title": ""
},
{
"docid": "6ffe0a1ecc8fab472fbd2ae2e944dac3",
"score": "0.708952",
"text": "def decrypt(userPassword)\r\n index = 0\r\n #counter set at 0\r\n decryptedArray = []\r\n #empty array to hold processed password\r\n alphabet = ('a'..'z').to_a.join\r\n #creates single word string of the alphabet\r\n until index == userPassword.length\r\n #loop repeats until it is same length as input\r\n letterIndex = alphabet.index(userPassword[index])\r\n #finding letter index in alphabet\r\n prevLetter = letterIndex - 1\r\n #identifies letter before\r\n decryptedArray << alphabet[prevLetter]\r\n #places previous letter in the alphabet (for a given character) in array\r\n index += 1\r\n #starts counting so loop isn't infinite\r\n end\r\n #ends 'until' loop'\r\n p \"#{decryptedArray.join}\"\r\nend",
"title": ""
},
{
"docid": "5cffefc3c3b93bb9534dff5f32f87f49",
"score": "0.70730454",
"text": "def encrypt (unencripted_string)\n #find the lenght of the string\n string_lenght = unencripted_string.length\n\n encripted_string = \"\"\n index = 0\n #for each letter on the string\n while index < string_lenght\n #find the position of the letter\n letter = unencripted_string[index]\n if letter == \"z\"\n #add \"a\" to the result\n encripted_string += 'a'\n else\n #add the next letter to the result\n encripted_string += letter.next\n end\n index+=1\n end\n encripted_string\nend",
"title": ""
},
{
"docid": "a7b85997eada10892c6a5e56f636ad2f",
"score": "0.70728",
"text": "def encrypt(str)\n #define loop variables \n times = 0\n encrypted = \"\"\n #loop \"string length\" number of times\n until times == str.length\n current_letter = str[times]\n #conditional edge cases and space\n if current_letter == \"z\"\n current_letter = \"a\"\n elsif current_letter == \" \"\n current_letter = \" \"\n elsif current_letter == \"9\"\n current_letter = \"0\"\n else\n #find next letter\n current_letter = str[times].next\n end\n #add letters to string one by one\n encrypted += current_letter\n \n times += 1\n end\n return encrypted\n\nend",
"title": ""
},
{
"docid": "d745a4f06c07788046e2050a169f656d",
"score": "0.70685804",
"text": "def encrypt (secret_string)\n# loop over the string\n# for every index take that character and move forward one\n\tcounter = 0\n\twhile counter < secret_string.length\n\t\tif secret_string[counter] == \"z\"\n\t\t\tsecret_string[counter] = \"a\"\n\t\telsif secret_string[counter] == \" \"\n\t\t\tsecret_string[counter] == \" \"\n\t\telse\n\t\t\tsecret_string[counter] = secret_string[counter].next\n\t\t# anytime the program z delete the letter that follows the letter, because z becomes aa which becomes ab\n\t\t# index z, once it is encrypted you have delete the index next to it. \n\t\tend\n\t\tcounter += 1\n\tend\t\n\tp secret_string\nend",
"title": ""
},
{
"docid": "913ceabda114dff177c4cdfbf23fbbd0",
"score": "0.7060347",
"text": "def decrypt(userPassword)\n index = 0\n #counter set at 0\n decryptedArray = []\n #empty array to hold processed password\n alphabet = ('a'..'z').to_a.join\n #creates single word string of the alphabet\n until index == userPassword.length\n #loop repeats until it is same length as input\n letterIndex = alphabet.index(userPassword[index])\n #finding letter index in alphabet\n prevLetter = letterIndex - 1\n #identifies letter before\n decryptedArray << alphabet[prevLetter]\n #places previous letter in the alphabet (for a given character) in array\n index += 1\n #starts counting so loop isn't infinite\n end\n #ends 'until' loop'\n p \"#{decryptedArray.join}\"\nend",
"title": ""
},
{
"docid": "e1b2ca48bfce2d53e7c88b140fc3eb2a",
"score": "0.7057043",
"text": "def encrypt(password)\r\n\ti = 0\r\n\tdeck = \"\"\r\n\tlen = password.length\r\n\r\n\tfor i in 0...len\r\n\t\tdeck += password[i].next\r\n\t\tif password[i] == \"z\"\r\n\t\tdeck = deck.chomp(\"a\")\r\n\t\tend\r\n\t\tif password[i] == \"Z\"\r\n\t\tdeck = deck.chomp(\"A\")\r\n\t\tend\r\n\tend\r\n\treturn deck\r\nend",
"title": ""
},
{
"docid": "411f96c8740469e7a311725570296465",
"score": "0.7054546",
"text": "def encrypt(user_string)\r\n\tindex = 0\r\n\twhile index < user_string.length\r\n\tif user_string[index] == \"z\"\r\n\t\tuser_string[index] = \"a\"\r\n\telse\r\n \tuser_string[index] = user_string[index].next\r\n end\r\n \tindex += 1\r\n\tend\r\n\tuser_string\r\nend",
"title": ""
},
{
"docid": "babea2e3c2bba43024d0b2960ad07873",
"score": "0.7051061",
"text": "def encrypt(input,shift)\n\n\t# determine the amount of times we need to index and \n\t# increment output string by finding length of pass\n\tinput_length = input.length \n\n\t# define the variable that will be the integer intermediary between output\n\t# and input that's incremented by the shift of 1\n\tinput_number = 0\n\n\t# set the variable for current index/count of the method \n\t# so that it runs only as long as the input length determines \n\tcurrent_index = 0 \n\n\t# define the variable that's the second intermediary after input_number\n\t# between input and just before output that has already been incremented\n\t# by the shift \n\toutput_number = 0\n\n\t# output is the result of the method after input, input_number, and \n\t# out_put number. It also gets added itself by itself in an interpolation \n\t# at the end of the until loop \n\toutput = \"\"\n\n\t# the alphabet variable so we don't have to put the lowercase alphabet string \n\t# within the until loop\n\talphabet = \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\"\n\t# need to double it because z or latter letters will go to first\n\t# anyway in the indexing process. \n\n\n\tshift = shift.to_i\n\t# we want the input to be only indexed and incremented \n\t# as much as it needs to be. That way it will only run\n\t# for the length of any password\n\tuntil input_length == current_index\n\n\t\t# breaking apart without map the first character \n\t\t# of the input and figuring to figure out its number to increment\n\t\tinput_letter = input[current_index]\n\n\t\t# since we can't increment reliably with next \n\t\t# even the input string needs to be incremented as an\n\t\t# integer. could also setup incrementing by more than 1 shift\n\t\tinput_number = alphabet.index(input_letter)\n\n\t\t# transforming input number on alphabet to output number\n\t\t# by adding 1 shift to input number character \n\t\toutput_number = input_number + shift\n\n\t\t# use that output number to become a string again\n\t\t# by indexing it on as an output letter \n\t\toutput_letter = alphabet[output_number] \n\n\t\t# iterating the index one forward for only \n\t\t# as long as the input length dictates \n\t\tcurrent_index += 1\n\n\t\t# interpolating the output one output letter forward \n\t\t# each time the input length indexes and increments \n\t\t# one letter. Like the Enigma almost \n\t\toutput = output + output_letter\n\tend \n\n# printing the incremented output string \n# outside of the loop so we don't see the \n# typewriter incrementing in action \n# though that could be cool \nputs output\n\nend",
"title": ""
},
{
"docid": "d20659c554b7d160e3b659c6e5e236d2",
"score": "0.704903",
"text": "def decrypt(string)\r\n\r\n current_index = 0\r\n \r\n while current_index < string.length\r\n\t if string[current_index] == \" \"\r\n\t\t current_index += 1\r\n\t else\r\n\t letter = string[current_index].downcase\r\n\t \tindex_current_number = \"abcdefghijklmnopqrstuvwxyz\".index(letter)\r\n\t \tindex_prior_number = index_current_number - 1\r\n\t decrypted_letter = \"abcdefghijklmnopqrstuvwxyz\"[index_prior_number]\r\n string[current_index] = decrypted_letter\r\n\t \tcurrent_index +=1\r\n\t end\r\n\tend\r\n\tputs \"the decrypted password is #{string}\"\r\nend",
"title": ""
},
{
"docid": "d21f0438ee0e0dc4e2daec6b610b02dc",
"score": "0.70475334",
"text": "def encrypt(input)\n input.downcase!\n length = input.length\n coded_string = \"\"\n for i in 0..(length-1)\n letter = input[i]\n if letter == \"z\" #edge case\n \tcoded_string += \"a\"\n else\n coded_string += letter.next\n end\n end\n coded_string\nend",
"title": ""
},
{
"docid": "b053e02c2ef3ff7e60535cc55b6b76b5",
"score": "0.7042116",
"text": "def decryptor(input)\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n while index < input.length\r\n if input[index] == \"a\"\r\n input[index] = \"z\"\r\n print input[index]\r\n elsif\r\n alphabet.include? input[index]\r\n input[index] = alphabet[alphabet.index(input[index]) - 1]\r\n print input[index]\r\n else\r\n print \" \"\r\n end\r\n index += 1\r\nend\r\nend",
"title": ""
},
{
"docid": "410e3cfc362d8cf758c94497c23cd8e4",
"score": "0.70335895",
"text": "def decrypt(pwd)\ndecrypted = \"\"\nletters = \"abcdefghijklmnopqrstuvwxyz\"\npwd_counter = 0\n# p letters.index(pwd)\nwhile pwd_counter < pwd.length\n letter_counter = 0\n while letter_counter < letters.length\n if pwd[pwd_counter] == letters[letter_counter]\n decrypted += letters[letter_counter - 1]\n end\n # p pwd[index]\n letter_counter += 1\n end\n pwd_counter += 1\nend\ndecrypted\nend",
"title": ""
},
{
"docid": "206446b44775b710695845f9c72ceaa6",
"score": "0.70304614",
"text": "def encrypt (string)\n index = 0\n while index < string.length\n if string[index]==\"z\"\n puts \"a\"\n else puts string[index].next\n end\n index += 1\n end\nend",
"title": ""
},
{
"docid": "fc9864615d4325d016982cad98bdc79e",
"score": "0.7027527",
"text": "def decrypt(password)\n next_string = \"\" #This is our beginning string\n i = 0\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n while i < password.length\n if password[i] == \" \"\n next_string << \" \"\n else\n number = alpha.index(password[i])\n new_letter = alpha[number-1]\n next_string << new_letter\n end\n i += 1\n end\n next_string\nend",
"title": ""
},
{
"docid": "fa6e00ede38a188a7f46fe4f2759ad49",
"score": "0.7023378",
"text": "def decrypt(encryption)\n index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n alphabet_index=0\n\n if encryption.length < alphabet.length\n while index < encryption.length\n alphabet_index = 0\n while alphabet_index < alphabet.length\n if encryption[index] == \"a\"\n encryption[index] = \"z\"\n break\n elsif encryption[index] == \"A\"\n encryption[index] = \"Z\"\n break\n elsif encryption[index] == alphabet[alphabet_index]\n encryption[index] = alphabet[alphabet_index-1]\n break\n else\n alphabet_index = alphabet_index+1\n end\n end\n index = index+1\n end\n puts encryption\n return encryption\n else\n puts \"Encryption too long to decrypt\"\n end\nend",
"title": ""
},
{
"docid": "5fc5d5e092621edbf05e099614f856cd",
"score": "0.7023332",
"text": "def encrypt(password)\n\tpassword_var = password\n\tindex_counter = 0\n\n\twhile index_counter < password_var.length\n\n\t\tif password_var[index_counter] == \"z\"\n\t\t\tpassword_var[index_counter] = \"a\"\n\t\telsif password_var[index_counter] == \" \"\n\t\t\tpassword_var[index_counter] = \" \"\n\t\telse\n\t\t\tpassword_var[index_counter] = password_var[index_counter].next\n\t\tend\n\n\t\tindex_counter += 1\n\tend\n\n\tp password_var\n#\tpassword_var\n\nend",
"title": ""
},
{
"docid": "bac78cb90df3bff75e57763e18db09ac",
"score": "0.7022847",
"text": "def decrypt(word)\n counter = 0 \n password = \"\"\n until counter == word.length\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n letter = alphabet.index(word[counter]) - 1\n counter += 1 \n password = alphabet[letter] + password\n end \n password.reverse\n \n end",
"title": ""
},
{
"docid": "90d9c5c9e698ff4a883c974a25d237e6",
"score": "0.70197034",
"text": "def decrypt(new_str)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n index = 0\n while index < new_str.length\n letter_index = alphabet.index(new_str[index])\n new_str[index] = alphabet[letter_index - 1]\n index +=1\n end\n puts \"Congrats!!! Your password has been decrypted: #{new_str}\"\n new_str\nend",
"title": ""
},
{
"docid": "ac5b119f128d8c47e62a1230a2b9b70f",
"score": "0.7011384",
"text": "def encrypt(string)\n index= 0\n new_word = \"\"\n while index < string.length\n if string[index] == \"z\"\n char = \"a\"\n new_word += char\n elsif\n char = string[index]\n char = char.next\n new_word += char\n end \n index += 1\n end\nputs new_word\nend",
"title": ""
},
{
"docid": "cfc986375662ccaaa8ba0e13ed99bc91",
"score": "0.7002056",
"text": "def decrypt(password)\nindex = 0\n#sets condition that loops if password is greater than zero\n\twhile password.length > index\n\t#sets all letters in the given input equal to the previous letter\n\t#.ord is a set system of string values that evaluates string characters\n\t#as an integer\n\t#.chr uses the same system to evaluate integers as strings\n\t#in the paranthesis we are setting each letter in the user input to an integer value\n\t#subtracting one (thus moving backwards)\n\t#then converting back into a string\n\t#note - we would not be able to use this method if we weren't instructed to assume lowercase\n\t#input and out (without accounting for more edge cases). \n\tpassword[index] = (password[index].ord - 1).chr\n\t#removes edge case issues with z\n\tpassword.sub!(\"`\", \"z\")\n\tindex += 1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "87676eac2dc23664ee6ea3dbe3081969",
"score": "0.70013946",
"text": "def encrypt(string_input) #define the method and ask for an argument\n # index = 0 #initialize the loop / start the index at 0\n \n # while index < string_input.length # while loop will run while the length of the input is greater than the index that is incremented by 1 each loop\n # if string_input[index] == \"z\" #edge case\n # string_input[index] = \"a\" #edge case\n # elsif string_input[index] != \" \" #if the char is not equal to \" \",\n # string_input[index] = string_input[index].next! # it will go to the next letter in the alphabet by .next and will stay that way because of !. this new value is assigned to the index at which we are currently at in the loop\n # end\n # index += 1\n # end \n\n new_string = string_input.chars\n\n new_string.map! do |char|\n if char == \"z\" #edge case\n char = \"a\" #edge case\n elsif char != \" \" #if the char is not equal to \" \",\n char = char.next # it will go to the next letter in the alphabet by .next and will stay that way because of !. this new value is assigned to the index at which we are currently at in the loop\n end\n end\n \n puts new_string.join('')\n return new_string.join('') #return is requesting the output so we can potentially use it\nend",
"title": ""
},
{
"docid": "9bae6edbb91d3c2518e0475a5df9c79b",
"score": "0.69921404",
"text": "def encrypt(string)\n current_index = 0\n while current_index <= (string.length - 1)\n if string[current_index] == \"z\"\n string[current_index] = \"a\" #for edge cases\n else string[current_index] = string[current_index].next\n end\n current_index += 1\n end\n return string\nend",
"title": ""
},
{
"docid": "18804cd3aa11e17f9130526c9039e0c4",
"score": "0.69790214",
"text": "def decrypt(secret_password)\r\n\ti = 0 # index to loop through string\r\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\tdecrypted_pass=\"\"\r\n\tnew_letter_index = 0\r\n\r\n\twhile i < secret_password.length\r\n\t\tnew_letter_index = alphabet.index(secret_password[i]) - 1\r\n\t\tdecrypted_pass += alphabet[new_letter_index]\r\n\t\ti+=1\r\n\tend\r\n\r\n\tdecrypted_pass\r\nend",
"title": ""
},
{
"docid": "927f5e55e7b74aca9c9da8204ebfb447",
"score": "0.69662666",
"text": "def encryption(str)\nalf = \"abcdefghijklmnopqrstuvwxyz\"\ni = 0\nanswer = []\n\twhile i < str.length\n\t\tif str[i] == \"z\"\n\t\tanswer.push(\"a\")\n\t\tend\n\tchar = alf.index(str[i])\n\tanswer.push(alf[char+1])\n\ti+=1\n\tend\n\tanswer.join\nend",
"title": ""
},
{
"docid": "d53d449f644dbadf6e762ab82640b239",
"score": "0.69634825",
"text": "def decrypt(encrypted_password)\r\n\te_index=0\r\n\twhile e_index < encrypted_password.length\r\n\t\tdecrypter=\" abcdefghijklmnopqrstuvwxyz\"\r\n\t\td_index=0\r\n\t\twhile d_index < decrypter.length\r\n\t\t\tif encrypted_password[e_index]==decrypter[d_index]\r\n\t\t\t\tif encrypted_password[e_index]==\" \"\r\n\t\t\t\t\tprint \" \"\r\n\t\t\t\t\te_index+=1\r\n\t\t\t\telsif encrypted_password[e_index]==\"a\"\r\n\t\t\t\t\tprint \"z\"\r\n\t\t\t\t\te_index+=1\r\n\t\t\t\telse\r\n\t\t\t\t\tprint decrypter[d_index-1]\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\td_index+=1\r\n\t\tend\r\n\t\te_index+=1\r\n\tend\r\nend",
"title": ""
},
{
"docid": "195ff80738deac0b95edba4ff363156b",
"score": "0.69634205",
"text": "def encrypt(str)\n index = 0\n #loop over the strings letters and advance each letter to the next\n while index < str.length\n if str[index] == \"z\"\n str[index] = \"a\"\n else\n str[index] = str[index].next\n end\n index += 1\n end\n puts str\nend",
"title": ""
},
{
"docid": "e221d4b0f04500501d5a4cbe9bd19d29",
"score": "0.6960223",
"text": "def encrypt(secretCode)\n # Create a counter = 0\n counter = 0\n # Begin loop set the condition iterate secret-code.length times\n while counter < secretCode.length\n # Call .next on each character of secret-code\n if secretCode[counter] == \"z\"\n secretCode[counter] = \"a\"\n else\n secretCode[counter] = secretCode[counter].next\n end\n counter += 1\n end\n secretCode\nend",
"title": ""
},
{
"docid": "0cf70068b227d82f2e3a061332229640",
"score": "0.69486445",
"text": "def decrypt(pass)\r\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\ti = 0\r\n\twhile i < pass.length\r\n\t\t#Gets the index number of the letter we want\r\n\t\tdecryptNum = alphabet.index(pass[i]) - 1\r\n\t\t#Decrypts the password\r\n\t\tpass[i] = alphabet[decryptNum]\r\n\t\ti += 1\r\n\tend\r\n\t#puts pass #for testing\r\n\treturn pass\r\nend",
"title": ""
},
{
"docid": "cfb38f6d17c9fc294c7c49048521da63",
"score": "0.69471055",
"text": "def encrypt (input)\n\tindex = 0\n\tstring = \"\"\n\twhile index < input.length\n\t\n\t\tif input[index] == \"z\"\n\t\t\tstring += \"a\"\n\t\telse\t\t\n\t\t\teach_letter = input[index].next\n\t\t\tstring += each_letter\n\t\tend\n\t\tindex += 1\n\tend\n\tp string\nend",
"title": ""
},
{
"docid": "cfb38f6d17c9fc294c7c49048521da63",
"score": "0.69471055",
"text": "def encrypt (input)\n\tindex = 0\n\tstring = \"\"\n\twhile index < input.length\n\t\n\t\tif input[index] == \"z\"\n\t\t\tstring += \"a\"\n\t\telse\t\t\n\t\t\teach_letter = input[index].next\n\t\t\tstring += each_letter\n\t\tend\n\t\tindex += 1\n\tend\n\tp string\nend",
"title": ""
},
{
"docid": "67cdfcbec7494b4f90e1fe5cc5d2bb78",
"score": "0.6942168",
"text": "def password_encrypt\n puts \"Do you want to decrypt or encrypt a password?\"\n encryption_pattern = gets.chomp\n \n \n def encrypt_method(string)\n \n index = 0\n while index < string.length\n string[index] = string[index].next\n index +=1\n end\n #puts string\n string\n\n end\n \n def decrypt_method(string)\n \n index = 0\n alpha = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n while index < string.length\n current_letter = string[index]\n current_index = alpha.index(current_letter)\n new_letter = alpha[current_index-1]\n string[index] = new_letter\n index +=1\n end\n #puts string\n string\n \n end\n \n if encryption_pattern == \"encrypt\"\n puts \"What is your password?\"\n password_input = gets.chomp\n puts encrypt_method(password_input)\n elsif encryption_pattern == \"decrypt\"\n puts \"What is your password?\"\n password_input = gets.chomp\n puts decrypt_method(password_input)\n else \"Im sorry I didn't get that.\"\n end\n \n\nend",
"title": ""
}
] |
0fc6a85722ea59061c6a2f0b15f7ea05
|
GET /post184s/new GET /post184s/new.xml
|
[
{
"docid": "f5bd47aef312de0ecbacb3ae3b599086",
"score": "0.74480474",
"text": "def new\n @post184 = Post184.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post184 }\n end\n end",
"title": ""
}
] |
[
{
"docid": "3955ab2d0300694b27c7bd5052db9318",
"score": "0.74024093",
"text": "def new\n @post181 = Post181.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post181 }\n end\n end",
"title": ""
},
{
"docid": "76d96b42e1cda75c5cf729e058b3111e",
"score": "0.7340942",
"text": "def new\n @post182 = Post182.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post182 }\n end\n end",
"title": ""
},
{
"docid": "66aa05b144e3febe40a1a0a4da1e629d",
"score": "0.7338696",
"text": "def new\n @post168 = Post168.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post168 }\n end\n end",
"title": ""
},
{
"docid": "9f7d3496b1000b3aa6e790297cd420dd",
"score": "0.7331527",
"text": "def new\n @post183 = Post183.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post183 }\n end\n end",
"title": ""
},
{
"docid": "06f01c482515f0a0a3e723849f8f6719",
"score": "0.73018473",
"text": "def new\n @post78 = Post78.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post78 }\n end\n end",
"title": ""
},
{
"docid": "dc0736e80804b3acaf061149c90208ec",
"score": "0.7291356",
"text": "def new\n @post306 = Post306.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post306 }\n end\n end",
"title": ""
},
{
"docid": "a47341627373c28754ce87edae8d586e",
"score": "0.7272826",
"text": "def new\n @post74 = Post74.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post74 }\n end\n end",
"title": ""
},
{
"docid": "3dddf4f156cbe7ecfe69efa8b8cdd835",
"score": "0.7260077",
"text": "def new\n @post150 = Post150.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post150 }\n end\n end",
"title": ""
},
{
"docid": "87736905e41d95a27dd9316fc3ca5c70",
"score": "0.7258047",
"text": "def new\n @post55 = Post55.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post55 }\n end\n end",
"title": ""
},
{
"docid": "343c5545dccb98b17ecf920afda7bb1e",
"score": "0.72558385",
"text": "def new\n @post154 = Post154.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post154 }\n end\n end",
"title": ""
},
{
"docid": "a76247c141b2bb70d83b8e310d5ef604",
"score": "0.7252793",
"text": "def new\n @post156 = Post156.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post156 }\n end\n end",
"title": ""
},
{
"docid": "f5d2c9f2e642e68e0efd8cba80b14c79",
"score": "0.72525615",
"text": "def new\n @post109 = Post109.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post109 }\n end\n end",
"title": ""
},
{
"docid": "674f54c6e8faf399d0178a8f1c4069f4",
"score": "0.72519195",
"text": "def new\n @post197 = Post197.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post197 }\n end\n end",
"title": ""
},
{
"docid": "efc7a1f3b0ee83a8e72c531d39e5649e",
"score": "0.7242707",
"text": "def new\n @post57 = Post57.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post57 }\n end\n end",
"title": ""
},
{
"docid": "e62bc68ab06a9acae0a40532873ee65c",
"score": "0.7238659",
"text": "def new\n @post101 = Post101.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post101 }\n end\n end",
"title": ""
},
{
"docid": "9cbdb66f7bae89c88455c467cc7f1d26",
"score": "0.7237623",
"text": "def new\n @post105 = Post105.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post105 }\n end\n end",
"title": ""
},
{
"docid": "5ac7a21f71677b6316841b052d38f924",
"score": "0.7231181",
"text": "def new\n @post227 = Post227.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post227 }\n end\n end",
"title": ""
},
{
"docid": "e73ae7b29de03450cb8f85bc1025754a",
"score": "0.72307193",
"text": "def new\n @post246 = Post246.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post246 }\n end\n end",
"title": ""
},
{
"docid": "dcc594ad2f345cf602666dfdb21c1ffa",
"score": "0.7229796",
"text": "def new\n @post125 = Post125.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post125 }\n end\n end",
"title": ""
},
{
"docid": "77cbb2a906165e479166501f2458073f",
"score": "0.72242695",
"text": "def new\n @post445 = Post445.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post445 }\n end\n end",
"title": ""
},
{
"docid": "626819e62342d38a8ac56c9e3a3792d3",
"score": "0.72126883",
"text": "def new\n @post130 = Post130.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post130 }\n end\n end",
"title": ""
},
{
"docid": "8c0cfb5050ca917e0ec70c01dc7963a8",
"score": "0.72125965",
"text": "def new\n @post110 = Post110.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post110 }\n end\n end",
"title": ""
},
{
"docid": "7053e24d255578a46fe2be27fa47f701",
"score": "0.72119653",
"text": "def new\n @post139 = Post139.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post139 }\n end\n end",
"title": ""
},
{
"docid": "0b8c7474012e4c995c35a68662c7dd72",
"score": "0.72119105",
"text": "def new\n @post54 = Post54.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post54 }\n end\n end",
"title": ""
},
{
"docid": "44305ea32fd1d666f546d048e73fc130",
"score": "0.7210169",
"text": "def new\n @post342 = Post342.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post342 }\n end\n end",
"title": ""
},
{
"docid": "2eedf3e51b7dbee415432342614f3cda",
"score": "0.72074056",
"text": "def new\n @post75 = Post75.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post75 }\n end\n end",
"title": ""
},
{
"docid": "9674a26f4c2aa2554130ee5a83517247",
"score": "0.7206641",
"text": "def new\n @post253 = Post253.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post253 }\n end\n end",
"title": ""
},
{
"docid": "ba3ce0d4aab6657bb241ee5d4bf6f8ac",
"score": "0.720528",
"text": "def new\n @post196 = Post196.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post196 }\n end\n end",
"title": ""
},
{
"docid": "5183b2091c4fd74c60fdac07443dbcaa",
"score": "0.7202079",
"text": "def new\n @post350 = Post350.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post350 }\n end\n end",
"title": ""
},
{
"docid": "fbb0a80b7f26aa6e7dc8a3a843d2ecc4",
"score": "0.7199673",
"text": "def new\n @post50 = Post50.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post50 }\n end\n end",
"title": ""
},
{
"docid": "725f7d746e2a6315ea6c842c23359a91",
"score": "0.71965426",
"text": "def new\n @post149 = Post149.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post149 }\n end\n end",
"title": ""
},
{
"docid": "e8969d768adb243d5313d8d5a12aa138",
"score": "0.7195457",
"text": "def new\n @post120 = Post120.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post120 }\n end\n end",
"title": ""
},
{
"docid": "850b9b1ecb72d16ce9d6459d00a509f6",
"score": "0.7188825",
"text": "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end",
"title": ""
},
{
"docid": "faa3b2133a0361c2b62832692d8a5249",
"score": "0.7184457",
"text": "def new\n @post134 = Post134.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post134 }\n end\n end",
"title": ""
},
{
"docid": "15430ea7f5a97365a2caa2c3361d919c",
"score": "0.7178287",
"text": "def new\n @post328 = Post328.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post328 }\n end\n end",
"title": ""
},
{
"docid": "fe2bd2801d5076da06562302b7a179fc",
"score": "0.7174043",
"text": "def new\n @post99 = Post99.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post99 }\n end\n end",
"title": ""
},
{
"docid": "8128f429c68e10ba3fe953d14a55a0d5",
"score": "0.7172646",
"text": "def new\n @post193 = Post193.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post193 }\n end\n end",
"title": ""
},
{
"docid": "9175ecc3838feb88fc164b64f2d4d784",
"score": "0.7169775",
"text": "def new\n @post260 = Post260.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post260 }\n end\n end",
"title": ""
},
{
"docid": "6c5662968680b46c4cb6a72705698bd3",
"score": "0.7158909",
"text": "def new\n @post174 = Post174.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post174 }\n end\n end",
"title": ""
},
{
"docid": "2032024c90ace7d480732042e402fbfa",
"score": "0.71554613",
"text": "def new\n @post58 = Post58.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post58 }\n end\n end",
"title": ""
},
{
"docid": "1e28d77990b7b49636898eb516c6b35f",
"score": "0.71538836",
"text": "def new\n @post217 = Post217.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post217 }\n end\n end",
"title": ""
},
{
"docid": "575d2b069f1511b58d2ab69230e08d88",
"score": "0.7151596",
"text": "def new\n @post77 = Post77.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post77 }\n end\n end",
"title": ""
},
{
"docid": "4869c896d823a1bab4529d45b3f964a0",
"score": "0.7150835",
"text": "def new\n @post85 = Post85.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post85 }\n end\n end",
"title": ""
},
{
"docid": "9bb8c7fbda6e32237381d8f330c62046",
"score": "0.71499467",
"text": "def new\n @post295 = Post295.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post295 }\n end\n end",
"title": ""
},
{
"docid": "ee394669be79df65be45f69b397d69fd",
"score": "0.71427584",
"text": "def new\n @post284 = Post284.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post284 }\n end\n end",
"title": ""
},
{
"docid": "469171886c7600e45e0a8b379c14db4a",
"score": "0.7136697",
"text": "def new\n @post106 = Post106.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post106 }\n end\n end",
"title": ""
},
{
"docid": "c935c0d083119d31a77e4b602e7be373",
"score": "0.7135357",
"text": "def new\n @post275 = Post275.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post275 }\n end\n end",
"title": ""
},
{
"docid": "656592ac70d46b080d2220a3f3147492",
"score": "0.71350217",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "28e2b92f23a02ca2d406564c65d0a7e3",
"score": "0.71318054",
"text": "def new\n @post65 = Post65.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post65 }\n end\n end",
"title": ""
},
{
"docid": "bb7b77409b7aedcbac5fabf83ab41b55",
"score": "0.71305996",
"text": "def new\n @post245 = Post245.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post245 }\n end\n end",
"title": ""
},
{
"docid": "3fca8c422632fd62c047899431374771",
"score": "0.7130025",
"text": "def new\n @post117 = Post117.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post117 }\n end\n end",
"title": ""
},
{
"docid": "a4cf965d2d0c35988249e4b88836aa9f",
"score": "0.7129254",
"text": "def new\n @post273 = Post273.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post273 }\n end\n end",
"title": ""
},
{
"docid": "581f3a864eef08010945958793bab587",
"score": "0.71288925",
"text": "def new\n @post483 = Post483.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post483 }\n end\n end",
"title": ""
},
{
"docid": "83ead00f1f0fd3b6e84c3e0a37cb5f32",
"score": "0.71275806",
"text": "def new\n @post133 = Post133.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post133 }\n end\n end",
"title": ""
},
{
"docid": "04f3dfb8f1798042b58b22b99067bc45",
"score": "0.7125574",
"text": "def new\n @post129 = Post129.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post129 }\n end\n end",
"title": ""
},
{
"docid": "03c1c98d1ba56003aa5ba8854713ae1c",
"score": "0.7117762",
"text": "def new\n @post310 = Post310.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post310 }\n end\n end",
"title": ""
},
{
"docid": "467932b6685f77b6db301a4a7856dc15",
"score": "0.71174103",
"text": "def new\n @post143 = Post143.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post143 }\n end\n end",
"title": ""
},
{
"docid": "5e05d1ae2335e3243a64e75cd24d89d9",
"score": "0.71159166",
"text": "def new\n @post107 = Post107.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post107 }\n end\n end",
"title": ""
},
{
"docid": "e79892debbef6dd528d5a9ea45bafc82",
"score": "0.711311",
"text": "def new\n @post191 = Post191.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post191 }\n end\n end",
"title": ""
},
{
"docid": "c14444e17f5b95ca00ed365ab0e06b53",
"score": "0.7108121",
"text": "def new\n @post267 = Post267.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post267 }\n end\n end",
"title": ""
},
{
"docid": "2db535ba86493bfcb7cd2ddc8c61faf3",
"score": "0.71013564",
"text": "def new\n @post221 = Post221.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post221 }\n end\n end",
"title": ""
},
{
"docid": "b52df056a32863bf7af1c1e3cb019277",
"score": "0.7100039",
"text": "def new\n @post68 = Post68.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post68 }\n end\n end",
"title": ""
},
{
"docid": "6d40bc9dbe15600b3f42aa0b7cd6c93d",
"score": "0.70961523",
"text": "def new\n @post10 = Post10.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post10 }\n end\n end",
"title": ""
},
{
"docid": "05fd6d53be5cf774e66f7da3488acc36",
"score": "0.70956457",
"text": "def new\n @post157 = Post157.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post157 }\n end\n end",
"title": ""
},
{
"docid": "60bdabb96bedc36c80857a35e6447471",
"score": "0.7094133",
"text": "def new\n @post335 = Post335.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post335 }\n end\n end",
"title": ""
},
{
"docid": "b36052e4587e242346d37de20d8b65d2",
"score": "0.7090911",
"text": "def new\n @post358 = Post358.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post358 }\n end\n end",
"title": ""
},
{
"docid": "fcc3f33b1cd1e98792220d3ea9c7f8cc",
"score": "0.70898634",
"text": "def new\n @post194 = Post194.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post194 }\n end\n end",
"title": ""
},
{
"docid": "62bf70e71a2dbe969d6d1aae861739c3",
"score": "0.70866984",
"text": "def new\n @post290 = Post290.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post290 }\n end\n end",
"title": ""
},
{
"docid": "c0ee8fac2725dd842c3ad782e13303b9",
"score": "0.7083894",
"text": "def new\n @post59 = Post59.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post59 }\n end\n end",
"title": ""
},
{
"docid": "a4942325b78762839dbcd1ddf2ce4ed6",
"score": "0.7081481",
"text": "def new\n @post230 = Post230.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post230 }\n end\n end",
"title": ""
},
{
"docid": "b839e86a3bc8711db79c1064783595e2",
"score": "0.70812625",
"text": "def new\n @post231 = Post231.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post231 }\n end\n end",
"title": ""
},
{
"docid": "ca95fbf02048694e2a06828eb0dd752d",
"score": "0.70799524",
"text": "def new\n @post122 = Post122.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post122 }\n end\n end",
"title": ""
},
{
"docid": "59d51b77b7f5c91b6d7cc989a1170d5d",
"score": "0.70796835",
"text": "def new\n @post453 = Post453.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post453 }\n end\n end",
"title": ""
},
{
"docid": "56c3ee10593f15921fdeeefdd4e3a7b3",
"score": "0.7079102",
"text": "def new\n @post489 = Post489.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post489 }\n end\n end",
"title": ""
},
{
"docid": "e75fbefc2b87d00701d142e3f2492d01",
"score": "0.7077706",
"text": "def new\n @post349 = Post349.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post349 }\n end\n end",
"title": ""
},
{
"docid": "b945c53fa16ecb22ddebc2a7d6760421",
"score": "0.7077038",
"text": "def new\n @post81 = Post81.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post81 }\n end\n end",
"title": ""
},
{
"docid": "5869bc60ee0cbbc5c013bde1f977bbd3",
"score": "0.70761895",
"text": "def new\n @post176 = Post176.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post176 }\n end\n end",
"title": ""
},
{
"docid": "0f9c54147e600b2dcfe2f7611aeeeb3f",
"score": "0.707068",
"text": "def new\n @post436 = Post436.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post436 }\n end\n end",
"title": ""
},
{
"docid": "c3d316c44d5ac678e3d68a5c0c98f537",
"score": "0.70672727",
"text": "def new\n @post215 = Post215.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post215 }\n end\n end",
"title": ""
},
{
"docid": "9823be306354179ad3142cacf7b40963",
"score": "0.7064741",
"text": "def new\n @post459 = Post459.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post459 }\n end\n end",
"title": ""
},
{
"docid": "1935d6047654b66e25b17da67d79c4a9",
"score": "0.7062466",
"text": "def new\n @post321 = Post321.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post321 }\n end\n end",
"title": ""
},
{
"docid": "00cc4817c01befc9b4af3a241749789c",
"score": "0.7061926",
"text": "def new\n @post248 = Post248.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post248 }\n end\n end",
"title": ""
},
{
"docid": "471ef9dd4bd24bc10334ac7bc5b2c5ec",
"score": "0.7056121",
"text": "def new\n @post464 = Post464.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post464 }\n end\n end",
"title": ""
},
{
"docid": "39816c56211cd9f022633e142cea7134",
"score": "0.70557356",
"text": "def new\n @post297 = Post297.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post297 }\n end\n end",
"title": ""
},
{
"docid": "0c12869f250fc6cc2542966c9d9a8580",
"score": "0.7052688",
"text": "def new\n @post228 = Post228.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post228 }\n end\n end",
"title": ""
},
{
"docid": "54e2298ab9f0fd18ff6182b979b7802a",
"score": "0.705117",
"text": "def new\n @post41 = Post41.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post41 }\n end\n end",
"title": ""
},
{
"docid": "4256be3ea24f5980408e047c0ad46571",
"score": "0.7049028",
"text": "def new\n @post257 = Post257.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post257 }\n end\n end",
"title": ""
},
{
"docid": "2bb5e508d05ef5722f5696de57d79688",
"score": "0.70484537",
"text": "def new\n @post339 = Post339.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post339 }\n end\n end",
"title": ""
},
{
"docid": "e8fbb1ff9bfdc67a6eec0656e8a11f0a",
"score": "0.70471793",
"text": "def new\n @post446 = Post446.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post446 }\n end\n end",
"title": ""
},
{
"docid": "12b181a23954e2026185a044b62ea54e",
"score": "0.70433426",
"text": "def new\n @post33 = Post33.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post33 }\n end\n end",
"title": ""
},
{
"docid": "ec0ef4cc8845f44c5229ba7feb8a23af",
"score": "0.70409274",
"text": "def new\n @post238 = Post238.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post238 }\n end\n end",
"title": ""
},
{
"docid": "426c737ce3859e5fae31b133fd389627",
"score": "0.70348275",
"text": "def new\n @post409 = Post409.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post409 }\n end\n end",
"title": ""
},
{
"docid": "9c592f646d802ea2cc7d5d1ef8bb0b86",
"score": "0.70322776",
"text": "def new\n @post423 = Post423.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post423 }\n end\n end",
"title": ""
},
{
"docid": "89fe3593fe398569b3361c8f8272187c",
"score": "0.70245737",
"text": "def new\n @post251 = Post251.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post251 }\n end\n end",
"title": ""
},
{
"docid": "656b30b27e0e55310004e35f7bc395a0",
"score": "0.70187914",
"text": "def new\n @post470 = Post470.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post470 }\n end\n end",
"title": ""
},
{
"docid": "512c11173f4d71749fb303a520db97b8",
"score": "0.7017827",
"text": "def new\n @post425 = Post425.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post425 }\n end\n end",
"title": ""
},
{
"docid": "db0ce99ff42c481c2588f95713108f32",
"score": "0.7016429",
"text": "def new\n @post276 = Post276.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post276 }\n end\n end",
"title": ""
},
{
"docid": "d6bc3371b79afe9881a34b06eadf0df4",
"score": "0.7009859",
"text": "def new\n @post288 = Post288.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post288 }\n end\n end",
"title": ""
},
{
"docid": "26dfda9165f60ea95bac688eee9eeeb4",
"score": "0.70091826",
"text": "def new\n @post377 = Post377.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post377 }\n end\n end",
"title": ""
},
{
"docid": "dbd5bd304ea0ac3724321b132c2bbb2a",
"score": "0.7007984",
"text": "def new\n @post272 = Post272.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post272 }\n end\n end",
"title": ""
}
] |
28f1881ed4e4182119bfa69804e2b850
|
DELETE /sp_resources/1 DELETE /sp_resources/1.json
|
[
{
"docid": "dd28d3e1a88c9bb835fba6d92785ccca",
"score": "0.7924454",
"text": "def destroy\n @sp_resource = SpResource.find(params[:id])\n @sp_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to sp_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.73459846",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "f0e82ff26734819737f904269816e3ca",
"score": "0.72216505",
"text": "def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "003826bcac3e5f66a0c6bd310e60ba7e",
"score": "0.71368337",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.delete()\n render json: {status: 200}\n end",
"title": ""
},
{
"docid": "cf80dbdec1ac2b7c14dcd4f5954f33b6",
"score": "0.7086959",
"text": "def destroy\n @resource = @client.resources.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n flash[:notice] = 'Resource was successfully removed.' \n format.html { redirect_to client_resources_url(@client) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "12b055f187606b2813628811c2cc93ea",
"score": "0.70851386",
"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": "bf7d08a55a42656abd37fcd3e761a44e",
"score": "0.7050318",
"text": "def destroy\n onevnet \"delete\", resource[:name]\n end",
"title": ""
},
{
"docid": "dcd408f0f4899b20f560f555b2a54852",
"score": "0.70133156",
"text": "def destroy\n @item_sp_resource_inv = ItemSpResourceInv.find(params[:id])\n @item_sp_resource_inv.destroy\n\n respond_to do |format|\n format.html { redirect_to item_sp_resource_invs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c22b94cc5bcb75f793225f3e8daad1a4",
"score": "0.69768804",
"text": "def destroy\n onehost('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "d546cde85f43565884ccba0916d3b5f3",
"score": "0.69480115",
"text": "def destroy\n @resourceset = Resourceset.find(params[:id])\n @resourceset.destroy\n\n respond_to do |format|\n format.html { redirect_to resourcesets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85a86b6c3495aa603de0161c86705ffe",
"score": "0.69399583",
"text": "def destroy\n saml = client(resource).saml\n result = call_with_readiness_check(saml, 'delete', [], resource)\n\n handle(result)\n end",
"title": ""
},
{
"docid": "fe5edb82c0d9ce3f3f172af2d501cce8",
"score": "0.69384104",
"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.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9de367d426fde8154a18a0fa2af00ab4",
"score": "0.6937958",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.69296205",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.69296205",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "c9ec6c9a6cd087d7c6f23ed42685e98a",
"score": "0.6928744",
"text": "def delete_resource\n nil\n end",
"title": ""
},
{
"docid": "94ad1c119637632b6ee9fa38a4a14321",
"score": "0.6874664",
"text": "def destroy\n @dummy_resource = DummyResource.find(params[:id])\n @dummy_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45fd0cb56fb90c39082cc1c6cbf834e7",
"score": "0.6832652",
"text": "def destroy\n oneimage('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "45fd0cb56fb90c39082cc1c6cbf834e7",
"score": "0.6832652",
"text": "def destroy\n oneimage('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "c267d44eee753c4389d7521cf0c0d6ff",
"score": "0.68274176",
"text": "def delete(resource_type_identifier); end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d04ef81a47b06f5f92006171284a66d9",
"score": "0.68194056",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08c57e26fdd390d1f962812bcf05bc46",
"score": "0.68180233",
"text": "def destroy\n puts \"got here\"\n @admin_resource = Resource.find(params[:id])\n @admin_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": "df0066c0f43d265701f4776d791e418a",
"score": "0.67991924",
"text": "def destroy\n resource.destroy\n end",
"title": ""
},
{
"docid": "ac15c32c1fa6a910c298192a2135b9a5",
"score": "0.6796388",
"text": "def destroy\n @resource_item = ResourceItem.find(params[:id])\n @resource_item.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6db3ef64b577821d976acbc3d33549a",
"score": "0.6790657",
"text": "def destroy\n @admin_resource = Imodec::Resource.find(params[:id])\n @admin_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20035851fd5107f0fb7189d298ea22a7",
"score": "0.67903954",
"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.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "245c4affdd8f190f770b23d0fd7ed988",
"score": "0.6785526",
"text": "def destroy\n @appresource = Appresource.find(params[:id])\n @appresource.destroy\n\n respond_to do |format|\n format.html { redirect_to appresources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31fe290ec9036156b091f8532426ab37",
"score": "0.6782784",
"text": "def destroy\n onevm('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "31fe290ec9036156b091f8532426ab37",
"score": "0.6782784",
"text": "def destroy\n onevm('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "1179905cbfc569ab7a869cf9b297e9b1",
"score": "0.6760759",
"text": "def delete\n res = ODPS.conn.delete \"projects/#{ODPS.current_project}/resources/#{@name}\"\n res.status == 204\n end",
"title": ""
},
{
"docid": "b776f0b44e29e76c4ee21fadd7bb0c4e",
"score": "0.6759694",
"text": "def destroy\n @resource_list = ResourceList.find(params[:id])\n @resource_list.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d759ecec11431ebc10b1a4446233f80",
"score": "0.67571163",
"text": "def destroy\n @postresource = Postresource.find(params[:id])\n @postresource.destroy\n\n respond_to do |format|\n format.html { redirect_to postresources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac6ce581a27e69d0fc21ae3d9c02ce26",
"score": "0.6747383",
"text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end",
"title": ""
},
{
"docid": "85552fb3ad2653405279bc4bb559aef9",
"score": "0.67405844",
"text": "def destroy\n output = \"onevnet delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"title": ""
},
{
"docid": "888b1d690878bd4aae59acc514a146d8",
"score": "0.6735492",
"text": "def destroy\n resource_id = params[:id]\n head :no_content\n end",
"title": ""
},
{
"docid": "43b81c86cda2a31f2653fb05a00f6230",
"score": "0.6721945",
"text": "def destroy\n @resource.clear\n @resource.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": "7f72acc5210cc6e05ee4e84d4dfad91a",
"score": "0.67180896",
"text": "def destroy\n @sp.destroy\n respond_to do |format|\n format.html { redirect_to sps_url, notice: 'Sp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "91dc412c6c0e12d31317840862f5688b",
"score": "0.67139703",
"text": "def destroy\n res = RESOURCE.find(params)\n\n if res.destroy\n render jsonapi: { meta: {} }, status: 200\n else\n render jsonapi_errors: res\n end\n end",
"title": ""
},
{
"docid": "f1040ad4ec84c67ecb94170d79aafd1d",
"score": "0.6699595",
"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.6699595",
"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.6699595",
"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": "2ebaf584b38af6ac39a5774a85580bfe",
"score": "0.66862214",
"text": "def destroy\n onetemplate('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "2ebaf584b38af6ac39a5774a85580bfe",
"score": "0.66862214",
"text": "def destroy\n onetemplate('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "2ebaf584b38af6ac39a5774a85580bfe",
"score": "0.66862214",
"text": "def destroy\n onetemplate('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "ea27f1083b04b431128a1f34992c402d",
"score": "0.66832924",
"text": "def destroy\n #alberich global permissions check\n require_privilege(Alberich::Privilege::MODIFY, GlobalResource)\n @global_resource = GlobalResource.find(params[:id])\n @global_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to global_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a195a8056b1cf6e2a6dc1252f4e63343",
"score": "0.6676311",
"text": "def destroy\n output = \"onetemplate delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"title": ""
},
{
"docid": "ba0a52568db192dd42ea614ddeff1cff",
"score": "0.6669964",
"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": "153e58976fdbfa7383392757fbb2a4ab",
"score": "0.666769",
"text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end",
"title": ""
},
{
"docid": "a41be49f6458790d5a2d38db09348203",
"score": "0.6658966",
"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": ""
},
{
"docid": "e2f718b3f0a58a495b3eab0c8300eca4",
"score": "0.6657837",
"text": "def destroy\n debug 'Call: destroy'\n File.unlink resource[:path] if File.exists? resource[:path]\n end",
"title": ""
},
{
"docid": "1fc1a69a820ea97cba154b342a614d43",
"score": "0.6647619",
"text": "def destroy\n @plan_resource = PlanResource.find(params[:id])\n @plan_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to plan_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b85d98479e7bd44cc2faf0461b778d3b",
"score": "0.6636151",
"text": "def delete\n connection.delete_by_id resources.map { |resource| resource.id.to_s }, params: COMMIT_PARAMS\n resources\n end",
"title": ""
},
{
"docid": "1031d5f31a6472b6ecff066226a72347",
"score": "0.6628045",
"text": "def destroy\n resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: \"#{resource_class.to_s} was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3641e0e00e7aa9ceb72ab1b9a966b1db",
"score": "0.6621311",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n render :nothing => true\n # respond_to do |format|\n # format.html { redirect_to resources_url }\n # format.json { head :ok }\n # end\n end",
"title": ""
},
{
"docid": "b7601c3ceebfc1460906fda5053e7a4c",
"score": "0.6620003",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to incident_resources_path(@resource.incident) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8363fbc243ad1727fa0ea9525aaddf38",
"score": "0.6615699",
"text": "def destroy\n @rest.destroy\n end",
"title": ""
},
{
"docid": "db6e7558ade9cfa48153aab34464daf0",
"score": "0.66111857",
"text": "def destroy\n @resource.delete\n end",
"title": ""
},
{
"docid": "4f588a203de0254579994f89344ee0e8",
"score": "0.66074634",
"text": "def domainResourceDelete args\n \tif not args.has_key(:ResourceID)\n \t\traise \"ResourceID argument missing from argument list\"\n \tend\n \t\n \tmake_request this_method, args\n end",
"title": ""
},
{
"docid": "4b2d46d5041158a2e0eb88043ef668fe",
"score": "0.66060525",
"text": "def destroy\n @catalogs_resource = Catalogs::Resource.find(params[:id])\n @catalogs_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to(catalogs_resources_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d5ac81807f57e86763d020cc16bdfbc",
"score": "0.6604436",
"text": "def delete_resource(resource)\n resource.destroy\n end",
"title": ""
},
{
"docid": "354e22dd4ad84f27ec29e986390479c3",
"score": "0.6601536",
"text": "def destroy\n @spl = Spl.find(params[:id])\n @spl.destroy\n\n respond_to do |format|\n format.html { redirect_to spls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57c523140da2a4fc2d0a94b58eddcdb5",
"score": "0.66003925",
"text": "def destroy\n @spt.destroy\n respond_to do |format|\n format.html { redirect_to spts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08e054df3643a5cc58ab34396ab102e5",
"score": "0.6589535",
"text": "def destroy\n @ressource = Ressource.find(params[:id])\n @ressource.destroy\n\n respond_to do |format|\n format.html { redirect_to ressources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08e054df3643a5cc58ab34396ab102e5",
"score": "0.6589535",
"text": "def destroy\n @ressource = Ressource.find(params[:id])\n @ressource.destroy\n\n respond_to do |format|\n format.html { redirect_to ressources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f05a34f7bc268856ca12eaf5ddcd5bc3",
"score": "0.65885997",
"text": "def destroy\n resource.destroy\n respond_with(resource) do |format|\n format.json { render :json => resource_as_json }\n end\n end",
"title": ""
},
{
"docid": "5656c42ea5899e1095a6ffdd837bee37",
"score": "0.6578234",
"text": "def destroy\n @resource = RDFS::Resource.find(params[:id])\n type = @resource ? @resource.classes.first.uri : nil\n @resource.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "403c0b9c427c9653e16081e99d788d4a",
"score": "0.65751386",
"text": "def destroy\n @spc.destroy\n respond_to do |format|\n format.html { redirect_to spcs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "29333579a8affc99f28879527fa5c915",
"score": "0.6572327",
"text": "def destroy\n output = \"onevm delete #{resource[:name]} \", self.class.login\n `#{output}`\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "7d709088f0e3412c19aecfac13976bd0",
"score": "0.6564065",
"text": "def destroy\n @standalone_resource = StandaloneResource.find(params[:id])\n # require modify permissions for this object\n require_privilege(Alberich::Privilege::MODIFY, @standalone_resource)\n\n @standalone_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to standalone_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0552a643ac74cebeba95819fd60ce980",
"score": "0.6557825",
"text": "def destroy\n @lab_scene_resource = LabSceneResource.find(params[:id])\n @lab_scene_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_scene_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd8b8458191edf0b5a4c6e1fa426afeb",
"score": "0.65526575",
"text": "def destroy\n @vegresource = Vegresource.find(params[:id])\n @vegresource.destroy\n\n respond_to do |format|\n format.html { redirect_to vegresources_url }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "108041bc77bf172cd96a4d4effa0512d",
"score": "0.65516424",
"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": "4a0a0dff5cf18a4399a1fa21c0535a31",
"score": "0.6543955",
"text": "def destroy\n @object_resource = ObjectResource.find(params[:id])\n @object_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to object_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7918fabc3e87bcaed45b214276540658",
"score": "0.6534147",
"text": "def destroy\n FileUtils.rm_rf resource[:path]\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "598f0daf41a73af97114fb0ae43f1573",
"score": "0.6532055",
"text": "def destroy\n @resource.destroy\n respond_to do |format|\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "309f5fb4b66ed99fd14def50d206f41d",
"score": "0.6530846",
"text": "def destroy\r\n @resource.destroy\r\n respond_to do |format|\r\n format.html { redirect_to resources_url, notice: 'Resource was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "31e5a51b98ea334a62b796835e31f04b",
"score": "0.65294987",
"text": "def destroy\n response = RestClient.delete $api_service+\"/claim_issues/\"+params['id']\n redirect_to :action => \"index\"\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.65288806",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "146046b65fb7792301822793b378513a",
"score": "0.6523877",
"text": "def destroy\n @common_resource = CommonResource.find(params[:id])\n @common_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to(common_resources_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1600899f6793b0438225c2baed9ba504",
"score": "0.6518474",
"text": "def destroy\n rmfs\n @property_hash[:ensure] = :absent\n @property_hash[:uuid] = nil\n resource\n end",
"title": ""
}
] |
d3d80be1db8912fae8af69c29441fa23
|
native checked? only works with checkboxes/radio. sometimes we have input as checkbox
|
[
{
"docid": "3c1c1c1d3413cba2b1ce67e0a995ed98",
"score": "0.6604164",
"text": "def checked?\n element_state = @driver.execute_script(\"return $('#{@locator[:css]}').is(':checked');\")\n if element_state\n true\n else\n false\n end\n end",
"title": ""
}
] |
[
{
"docid": "ec3eaa840cf48bd09ba34290ab2df5c9",
"score": "0.8130945",
"text": "def checked\n\n end",
"title": ""
},
{
"docid": "a334f9bf38bee4f633402a6473e50ebe",
"score": "0.7968479",
"text": "def checked?\n `return #{self}.__element__.checked ? #{true} : #{false};`\n end",
"title": ""
},
{
"docid": "6148293657b32d881bf1fc90806bd72e",
"score": "0.7907849",
"text": "def checked\n return check_box.selected?\nend",
"title": ""
},
{
"docid": "bfe2151da3c3aaf66f7368159758b189",
"score": "0.7821551",
"text": "def checked?\n @value\n end",
"title": ""
},
{
"docid": "71974ca605fb3c9ecf1c5d3446fc3331",
"score": "0.7789329",
"text": "def field_value\n checked?\n end",
"title": ""
},
{
"docid": "476b9e1d1bd1247c14def8d48d71d719",
"score": "0.76413",
"text": "def checked?; end",
"title": ""
},
{
"docid": "476b9e1d1bd1247c14def8d48d71d719",
"score": "0.76413",
"text": "def checked?; end",
"title": ""
},
{
"docid": "f5b0da25b58ab4b75088ac597f43228b",
"score": "0.7626305",
"text": "def checked\n return @radio_button.is_selected\nend",
"title": ""
},
{
"docid": "b16c5b7d2b737cc1ed6545cc3753f83e",
"score": "0.76070243",
"text": "def is_checked\n return @is_checked\n end",
"title": ""
},
{
"docid": "9f1b25dced6abea0d637af6870ddc32f",
"score": "0.75450957",
"text": "def checked\n with_attribute(:checked => true)\n self\n end",
"title": ""
},
{
"docid": "cbf0935d869a831c40283ccb7d7d183d",
"score": "0.7539638",
"text": "def checked?()\n return fetch(\"checked\") == \"true\";\n end",
"title": ""
},
{
"docid": "cbf0935d869a831c40283ccb7d7d183d",
"score": "0.7539638",
"text": "def checked?()\n return fetch(\"checked\") == \"true\";\n end",
"title": ""
},
{
"docid": "ffe62fa02d1f7cff7369addaa341962d",
"score": "0.75087863",
"text": "def is_checked?\n !options[:checked].nil? || reader_value == attributes[:value]\n end",
"title": ""
},
{
"docid": "0f640c8058630d1fef4886468eac91a1",
"score": "0.7472113",
"text": "def checked?\n `#{@element}.checked`\n end",
"title": ""
},
{
"docid": "e8e45b3f8c749790239c3e88c69bce2a",
"score": "0.74283504",
"text": "def checked?\n element.isSelected\n end",
"title": ""
},
{
"docid": "0c40a68b30dbdfe86eb7d6da6ba53034",
"score": "0.7409578",
"text": "def active_check_box\n active?\n end",
"title": ""
},
{
"docid": "875cfd1264a91fd2ea1c5295c9877e59",
"score": "0.733837",
"text": "def checked_box(note)\n 'checked' if note == 'X'\n end",
"title": ""
},
{
"docid": "b77f7474f938b27e3c1e8e25f6506c34",
"score": "0.7337569",
"text": "def checked?\n element.set?\n end",
"title": ""
},
{
"docid": "1bff8c2244795ab8801e692b88a0620b",
"score": "0.72341585",
"text": "def checked_value\n opts.fetch(:checked_value, '1')\n end",
"title": ""
},
{
"docid": "383fa943770169549eb99629b912440d",
"score": "0.72338855",
"text": "def check\n get_checkbox.check\n end",
"title": ""
},
{
"docid": "8ca0e45a2818b053a8ea2ccab8a081c5",
"score": "0.71060014",
"text": "def check\r\n self.click unless checked?\r\n end",
"title": ""
},
{
"docid": "e5b7351653a8a1b1533a2f1e6da974ca",
"score": "0.70743173",
"text": "def is_checked(locator)\n return get_boolean(\"isChecked\", [locator,])\n end",
"title": ""
},
{
"docid": "eff73b37321b6ed29de8661dc4a2a148",
"score": "0.70461404",
"text": "def is_checked=(value)\n @is_checked = value\n end",
"title": ""
},
{
"docid": "bb5b4c55c9ab60120a2ae5c334f0cff9",
"score": "0.69936496",
"text": "def checked?\n synchronize { base.checked? }\n end",
"title": ""
},
{
"docid": "5852d3afce37bf50353cd2daed4151e4",
"score": "0.69596994",
"text": "def value\n is_selected\n end",
"title": ""
},
{
"docid": "5a074028acd3395abb766cc4f5387a97",
"score": "0.6920845",
"text": "def check_box?\n element_type == 'check_boxes'\n end",
"title": ""
},
{
"docid": "617b378f1ec4c1bce75d64a8a2006635",
"score": "0.69055957",
"text": "def checked?\n return nil if self[:value].nil?\n\n boolean? && self[:value] == 'true'\n end",
"title": ""
},
{
"docid": "fbd68bdfbdae04ba0d9b8ab4254bb1ef",
"score": "0.6868879",
"text": "def checked=(bool)\n `#@native.checked = bool`\n end",
"title": ""
},
{
"docid": "e034a2168c64800bb43d8cd46630a0e7",
"score": "0.6858114",
"text": "def checked?(data)\n ActiveRecord::Type::Boolean.new.cast(data)\n end",
"title": ""
},
{
"docid": "e69ada1f63d68e9782adc71844253109",
"score": "0.6842125",
"text": "def is_selected?\n self.selected \n end",
"title": ""
},
{
"docid": "decb7dc6da9278a84282637e3a010999",
"score": "0.68379724",
"text": "def set_checked_true\n self.checked = true\n self.save\n end",
"title": ""
},
{
"docid": "bdc194e0d9b5ff03331ed59f91ad141a",
"score": "0.6800327",
"text": "def checked?(locator)\n boolean_command \"isChecked\", [locator,]\n end",
"title": ""
},
{
"docid": "7b767d2d897e16333b4b882af6ec29f6",
"score": "0.67991436",
"text": "def input_boolean(sch)\n unless opts.has_key?(:as)\n opts[:as] = (sch[:allow_null] || opts[:required] == false) ? :select : :checkbox\n end\n\n v = opts.has_key?(:value) ? opts[:value] : obj.send(field)\n\n case opts[:as]\n when :radio\n true_value = opts[:true_value]||'t'\n false_value = opts[:false_value]||'f'\n opts[:options] = [[opts[:true_label]||'Yes', {:value=>true_value, :key_id=>'yes'}], [opts[:false_label]||'No', {:value=>false_value, :key_id=>'no'}]]\n unless v.nil?\n opts[:value] = v ? true_value : false_value\n end\n _input(:radioset, opts)\n when :select\n opts[:value] = (v ? 't' : 'f') unless v.nil?\n opts[:add_blank] = true unless opts.has_key?(:add_blank)\n opts[:options] = [[opts[:true_label]||'True', opts[:true_value]||'t'], [opts[:false_label]||'False', opts[:false_value]||'f']]\n _input(:select, opts)\n else\n opts[:checked] = v\n opts[:value] = 't'\n _input(:checkbox, opts)\n end\n end",
"title": ""
},
{
"docid": "e33e13c99f398b90e33a74d9f36647a8",
"score": "0.67692566",
"text": "def checked=(bool)\n `#@native.checked = bool`\n end",
"title": ""
},
{
"docid": "d9e7af298ffa21cb04832d4b48ca249b",
"score": "0.67574733",
"text": "def radio_check(table)\n table.radios.each{|x| if x.checked? then return x.value end }\n end",
"title": ""
},
{
"docid": "5ec4fa9d0b20618cf3903f54da7db399",
"score": "0.67569053",
"text": "def value\n if boolean?\n checked?\n else\n self[:value]\n end\n end",
"title": ""
},
{
"docid": "3963d652373550954e7be10443e9f086",
"score": "0.6710947",
"text": "def type_checked?\n 0 != @flags & TYPE_CHECKED\n end",
"title": ""
},
{
"docid": "f329cd96af355988e382c74d6a816492",
"score": "0.67076534",
"text": "def changed?\n !checked? || super\n end",
"title": ""
},
{
"docid": "4f0c23614e5523e965aa7bc58cf8aca2",
"score": "0.67004776",
"text": "def checked=(value)\n check_box.selected = value\nend",
"title": ""
},
{
"docid": "a4aa08547dcccf93e84ccbf3bc15959b",
"score": "0.6681593",
"text": "def checked=(value)\n @action.call(value, @params) if @action && value != @checked\n @checked = value\n end",
"title": ""
},
{
"docid": "4b14bea55ee19dc0fe7cc970cb52e276",
"score": "0.666793",
"text": "def checked?(name)\n @checked ||= []\n\n if @checked.include?(name)\n true\n else\n @checked << name\n false\n end\n end",
"title": ""
},
{
"docid": "8e3a237e92b2e52a350b6c87e0b971d4",
"score": "0.66344595",
"text": "def checked=(value)\n @radio_button.selected = value\nend",
"title": ""
},
{
"docid": "692a849fbad79001761487069dd149f7",
"score": "0.6622492",
"text": "def checked?\n @scripter.checkbox_is_checked?(self)\n end",
"title": ""
},
{
"docid": "692a849fbad79001761487069dd149f7",
"score": "0.6622492",
"text": "def checked?\n @scripter.checkbox_is_checked?(self)\n end",
"title": ""
},
{
"docid": "7c75a1740879cd77bf722f35bc2d9131",
"score": "0.65818393",
"text": "def value\n return @selenium.is_checked(@locator)\n end",
"title": ""
},
{
"docid": "847722d0d4d64e6e9644ea536d6db2c9",
"score": "0.6574122",
"text": "def ok?\n @checked = true\n ok_unchecked?\n end",
"title": ""
},
{
"docid": "dfd3ae4084be8c54278587d600e5bbe3",
"score": "0.65540856",
"text": "def checkbox_for(param, checked_if, attributes = {})\n attributes = {\n :type => 'checkbox',\n :value => 'true'\n }.merge(attributes)\n \n if checked_if || params[param.to_sym] == 'true'\n attributes.merge!({ :checked => nil })\n end\n \n input_for param, attributes\n end",
"title": ""
},
{
"docid": "197845c3d13c20fb0f1c2a0ad8497f5b",
"score": "0.65493834",
"text": "def checkbox(box)\n if box.checked?\n 'set'\n else\n 'clear'\n end\n end",
"title": ""
},
{
"docid": "fd732753cac744b741cf3c95b0de1ad3",
"score": "0.65484893",
"text": "def checkbox_by_value_is_set(checkbox_value)\n return checkbox_by_value(checkbox_value).set?\nend",
"title": ""
},
{
"docid": "6a5cdb05feb539f9bdce1de006991788",
"score": "0.65264755",
"text": "def boolean_update(object, attribute)\n\t\tfake_record(object, attribute, :value => 'checked') do |name,action|\n\t\t\tcheck_box name, attribute, :onchange => action\n\t\tend\n\tend",
"title": ""
},
{
"docid": "27cfb034f322eb5ceebf48b89c9a9f7e",
"score": "0.65259314",
"text": "def add_monogram_checked?\n add_mg_section.has_selector?(:span_class, 'checked', :visible => FALSE) ? TRUE : FALSE ### FALSE???\n end",
"title": ""
},
{
"docid": "21b68999781916d405af4e7de5849a51",
"score": "0.64983857",
"text": "def bool_checkbox_0(value)\n value ? 0 : nil\n end",
"title": ""
},
{
"docid": "d78bc45ca93428f205709ce1125614f3",
"score": "0.6494225",
"text": "def checkbox_by_class_is_set(checkbox_class)\n return checkbox_by_class(checkbox_class).set?\nend",
"title": ""
},
{
"docid": "7796d3271ab2b52699704b2767772ad4",
"score": "0.648194",
"text": "def extra_input_attributes\n attributes = { :value => html_value }\n\n if selected?\n attributes[:checked]='checked'\n end\n\n attributes\n end",
"title": ""
},
{
"docid": "ee497818e8624ae236817f876b2d1db3",
"score": "0.6479196",
"text": "def bool_checked(field)\n filename = field ? \"check.png\" : \"blank.gif\"\n image_tag(filename, :alt => \"yes\", :size => \"16x16\")\n end",
"title": ""
},
{
"docid": "baa3fe2b5efa3494d0bfa289555393a7",
"score": "0.6453294",
"text": "def have_check_box(options)\n have_form_field(options.merge(:tag => :input, :type => :checkbox))\n end",
"title": ""
},
{
"docid": "7881590a67f7b09f17eda0915b530e05",
"score": "0.6436602",
"text": "def boolean_field(attr, html_options = {})\n check_box(attr, html_options)\n end",
"title": ""
},
{
"docid": "7881590a67f7b09f17eda0915b530e05",
"score": "0.6436602",
"text": "def boolean_field(attr, html_options = {})\n check_box(attr, html_options)\n end",
"title": ""
},
{
"docid": "8b7500ee79028428e3e67eb9452356a1",
"score": "0.6415914",
"text": "def is_radio_button_checked?(browser_handle, property, property_value)\n browser_handle.radio(property.intern, /#{property_value}/).checked?\nend",
"title": ""
},
{
"docid": "db73ebc31eda5367c9333420d6fbd9db",
"score": "0.63883996",
"text": "def checked_button\n copy = self.dup\n if copy.how.is_a? Symbol\n copy.how = {copy.how => copy.what}\n copy.what = nil\n end\n copy.how.merge!(:checked => true)\n copy\n end",
"title": ""
},
{
"docid": "419ee7651b746147c9e8e230304b85bc",
"score": "0.6388108",
"text": "def is_checkbox_checked?(browser_handle, property, property_value)\n browser_handle.checkbox(property.intern, /#{property_value}/).checked?\nend",
"title": ""
},
{
"docid": "f610902a251dc6e29b9609842a8dfa07",
"score": "0.63874006",
"text": "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end",
"title": ""
},
{
"docid": "f610902a251dc6e29b9609842a8dfa07",
"score": "0.63874006",
"text": "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end",
"title": ""
},
{
"docid": "f610902a251dc6e29b9609842a8dfa07",
"score": "0.63874006",
"text": "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end",
"title": ""
},
{
"docid": "f610902a251dc6e29b9609842a8dfa07",
"score": "0.63874006",
"text": "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end",
"title": ""
},
{
"docid": "f610902a251dc6e29b9609842a8dfa07",
"score": "0.63874006",
"text": "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end",
"title": ""
},
{
"docid": "34203e5f0df17a305cac3520d72e83a1",
"score": "0.636873",
"text": "def check_box_tag(name, value = \"1\", checked = false, options = {})\n id = \"#{name}#{value}\".gsub(/\\[\\]/,'').gsub(/[\\[\\]\\ ]/, '_').downcase\n label = options[:label] ? label_tag(id, options.delete(:label), :class => 'choice') : \"\"\n options[:class] = 'field checkbox'\n options[:id] = id\n super + label\n end",
"title": ""
},
{
"docid": "d59fb8a7a9a4f8dd974687f5f2c138b6",
"score": "0.6366477",
"text": "def is_cbox_checked(aid)\r\n if (params[\"cbox_\" + aid.to_s] == \"1\")\r\n ret = true\r\n else\r\n ret = false\r\n end\r\n ret\r\nend",
"title": ""
},
{
"docid": "c5582212d9a7f8f574907f627754f8d5",
"score": "0.63573074",
"text": "def check_box_tag(name, value = \"1\", checked = false, options = {}) \n options = check_options(options)\n options[:class] << 'check_box'\n super(name, value, checked, options)\n end",
"title": ""
},
{
"docid": "c803f298aa6666fd48dbfe5168e62b8e",
"score": "0.6356105",
"text": "def check_box(field, options = {}, checked_value = '1', unchecked_value = '0')\n new_options, options = remove_uniform_options(options)\n new_options[:label] ? super + label_wrapper(field, new_options) : super\n end",
"title": ""
},
{
"docid": "1029d0ba4f8fb3c695f13ce263c27641",
"score": "0.6350267",
"text": "def not_checked\n with_attribute(:checked => false)\n self\n end",
"title": ""
},
{
"docid": "f7d080b404ca6322ae740d66f79b8df6",
"score": "0.6349937",
"text": "def checkbox(name, attrs)\n field_id = input_id(name, attrs[:id], attrs[:value])\n field_name = input_name(name)\n\n # TODO: not inline\n if attrs[:inline]\n html.tag('div', class: 'form-check form-check-inline') do\n html.stag('input', {\n name: field_name,\n type: 'checkbox',\n class: 'form-check-input',\n id: field_id,\n value: attrs[:value],\n checked: attrs[:checked],\n })\n\n if attrs[:label]\n html.tag('label', attrs[:label], {\n class: 'form-check-label',\n for: field_id\n })\n end\n end\n end\n end",
"title": ""
},
{
"docid": "56fd1ffc6513a97c888ec970d7806d32",
"score": "0.6338574",
"text": "def evaluate_checkbox(attributeValue)\n (attributeValue.nil? || attributeValue == 0) ? 'NO' : 'YES'\n end",
"title": ""
},
{
"docid": "8daba2427522c1da64abcadd6a3df99a",
"score": "0.6328449",
"text": "def fe_checkbox(name, attribs = {})\n checker_name = \"#{name}_checker\"\n newval = !!(request_parameters[name] || query_parameters[name])\n posted = (request_parameters[checker_name] || query_parameters[checker_name])\n \n # checkbox html element isn't sent to cgi if not selected\n # so cuca's page variables won't work - this fixes it for most cases.\n if (session.page && (posted && !newval)) then\n session.page[name] = 'off' \n end\n \n checked = v[name] && (v[name].to_s != 'off')\n checked = attribs[:default_value] == 'on' if (!posted and !v[name]) \n \n checkedval = checked ? ' CHECKED' : ''\n \"<input type='checkbox' name='#{name}' #{a2p(attribs)}#{checkedval}>\"+\n \"<input type='hidden' name='#{checker_name}' value='1'>\\n\"\t\t# Needed to detect if element was submitted\n end",
"title": ""
},
{
"docid": "73645c9c19b8b093f263c54fb8f0c91b",
"score": "0.6326293",
"text": "def check_box_tag(name, value = \"1\", checked = false, options = {}) \n\t\toptions = check_options(options)\n\t\toptions[:class] << 'check_box'\n\t\tsuper(name, value, checked, options)\n\tend",
"title": ""
},
{
"docid": "d8cdb6adbd95a4429733acfbcd85ca08",
"score": "0.6312603",
"text": "def radio_button(*args)\n opts = args.last\n opts[:checked] = \"checked\" if opts.is_a?(Hash) && opts.delete(:checked)\n super\n end",
"title": ""
},
{
"docid": "b738e2e5c99273944bdef5ea8e98115d",
"score": "0.6307669",
"text": "def wizard_check_box(field, options = {}, checked_value = \"1\", unchecked_value = \"0\") \n # return a check box\n return check_box(self.wizard_model, field, options, checked_value, unchecked_value)\n end",
"title": ""
},
{
"docid": "ef20005755bdecf10164fa3b90a12926",
"score": "0.63039386",
"text": "def selected?\n perform(:isSelected)\n end",
"title": ""
},
{
"docid": "8ff3d7b963e1ef5668c85c05d399a27a",
"score": "0.63020873",
"text": "def selected?\n element.isSelected\n end",
"title": ""
},
{
"docid": "3cd3aa00a998fe6040790ac3ba34daf5",
"score": "0.62904894",
"text": "def check_box_tag(name, value = \"1\", checked = false, options = {}) \n\t\toptions = check_options(options)\n\t\toptions[:class] << 'check_box'\n\t\told_check_box_tag(name, value, checked, options)\n\tend",
"title": ""
},
{
"docid": "f688c2f1246f3900b00fa008e3b66ff2",
"score": "0.6277905",
"text": "def checkbox(hash = {})\n hash[:type] = :checkbox\n input(hash)\n end",
"title": ""
},
{
"docid": "ec4d7cdd1d08f596be0f694bbea7f7b2",
"score": "0.627297",
"text": "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless is_checkbox(field_type)\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n \n \n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end",
"title": ""
},
{
"docid": "d7ef1fcdb01e285be2b0e94cebac7272",
"score": "0.62724143",
"text": "def check_box (method, options = {}, checked_value = \"1\", unchecked_value = \"0\")\n\t\t\t\[email protected](:labelled_check_box, @object_name, method, options.merge(:object => @object), checked_value, unchecked_value)\n\t\t\tend",
"title": ""
},
{
"docid": "4f6e86591ee1e3f58831ebbd17ebdaab",
"score": "0.62720734",
"text": "def checkbox(how, what = nil , value = nil) # BUG default logic?\n return CheckBox.new(self, how, what, [\"checkbox\"], value) # BUG\n end",
"title": ""
},
{
"docid": "4d22ba5891c2fd4bbcabf0a8ed6394ad",
"score": "0.62689215",
"text": "def set_checked_false\n self.checked = false\n self.save\n end",
"title": ""
},
{
"docid": "503cfd2610566315ef5c07086a643994",
"score": "0.62622154",
"text": "def check?\n return @checkbutton.active?\n end",
"title": ""
},
{
"docid": "177751c417813c1cd1883019fa387d8b",
"score": "0.6254644",
"text": "def checkbox_is_checked?(element = @element)\n execute(element.operate { %|return element.checked;| }, element)\n end",
"title": ""
},
{
"docid": "177751c417813c1cd1883019fa387d8b",
"score": "0.6254644",
"text": "def checkbox_is_checked?(element = @element)\n execute(element.operate { %|return element.checked;| }, element)\n end",
"title": ""
},
{
"docid": "5a2ddf49f807f2cf42b53a9c938f8155",
"score": "0.62536114",
"text": "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless is_checkbox(field_type)\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n\n\n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end",
"title": ""
},
{
"docid": "9d7ca679fda9cba13fc51c4459b5c0a4",
"score": "0.6244672",
"text": "def selected?; @selected end",
"title": ""
},
{
"docid": "35462fc9bf7197a39bb6bc74359ea8ab",
"score": "0.6244048",
"text": "def check_box(attribute, options = {}, checked_value = \"1\", unchecked_value = \"0\")\n custom_label(attribute, options[:label], options[:label_options], true) do\n options.delete(:label)\n options.delete(:label_options)\n @template.check_box(@object_name, attribute, objectify_options(options), checked_value, unchecked_value)\n end + error_and_help_text(attribute, options)\n end",
"title": ""
},
{
"docid": "a2524ffa26e8221357892f4a918df53a",
"score": "0.6231586",
"text": "def click(event)\n status.present = event.target.checked\n post_update()\n end",
"title": ""
},
{
"docid": "3e1af23d7f6aae8499ccdc52564b2882",
"score": "0.6229977",
"text": "def set?\n class_name.include? 'mat-radio-checked'\n end",
"title": ""
},
{
"docid": "48c7120b597d0fedd8513cf321e8a218",
"score": "0.62228316",
"text": "def check_box_toggle(name, checked, elt, ifchecked, ifnotchecked, opts={})\n check_box_tag name, 1, checked, opts.merge(:onchange => %Q{$('##{elt}').val($(this).is(':checked') ? '#{escape_javascript ifchecked}' : '#{escape_javascript ifnotchecked}' )})\n end",
"title": ""
},
{
"docid": "84eb6aed37346ab382372b1d55f4dc65",
"score": "0.6220179",
"text": "def verify_Checkbox_RaidoButton_selected?(page, id_name)\n\t\texpect(find(:xpath, getXpath(page, id_name)).checked?).to eq true\n\tend",
"title": ""
},
{
"docid": "8130e850b0736fe72db0d05370502e08",
"score": "0.6219072",
"text": "def is_checkbox?\n return (has_style_type and paragraph_style.style_type == AppleNote::STYLE_TYPE_CHECKBOX)\n end",
"title": ""
},
{
"docid": "4dec9271dd4639943722ba2325887ae8",
"score": "0.62044597",
"text": "def get_checked_value(param, option)\n if (param.blank? && option == \"degrees\") || (param == option)\n \"checked\"\n else\n \"\"\n end \n end",
"title": ""
},
{
"docid": "f69d3080d4a73353c5db206c6f599656",
"score": "0.6201566",
"text": "def checkbox_field_methods label, id, type\n field_label = label.ams_layout_snakecase\n field_id = '#' + id\n\n text =<<TEXT\n\n def check_#{field_label}\n if ! checked?('#{field_id}')\n super()\n # else skip sending the value.\n end\n end\n\n def uncheck_#{field_label}\n if checked?('#{field_id}')\n super()\n # else skip sending the value.\n end\n end\nTEXT\n end",
"title": ""
},
{
"docid": "b28c6a11da3a14ee5d01fe5c654ca220",
"score": "0.6185247",
"text": "def checkbox(how, what, value = nil) \n return CheckBox.new(self, how, what, [\"checkbox\"], value) \n end",
"title": ""
},
{
"docid": "f44a6387a0602a11fb7f865ebc34d545",
"score": "0.6182039",
"text": "def checked?( id )\n\t\tparent.checklist.include? \"#{shortname}#{id}\".hash\n\tend",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.